示例#1
0
        /// <summary>
        /// 获取区域的企业
        /// </summary>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        private static List <dynamic> GetCompanyInfo(string areaCode)
        {
            SqlModel sql = SqlModel.SelectAll()
                           .From(DB.T_BASE_COMPANY)
                           .Where(T_BASE_COMPANY.AREA.In(StringHelper.SqlInCondition(areaCode)));

            return(sql.ExecToDynamicList());
        }
示例#2
0
        /// <summary>
        /// 获取区域信息
        /// </summary>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        private static List <dynamic> GetAreaInfo(string areaCode)
        {
            SqlModel sql = SqlModel.Select(
                T_SYS_AREA.AREA_CODE
                , T_SYS_AREA.AREA_TEXT
                )
                           .From(DB.T_SYS_AREA).Where(T_SYS_AREA.AREA_CODE.In(StringHelper.SqlInCondition(areaCode)));

            return(sql.ExecToDynamicList());
        }
示例#3
0
        /// <summary>
        /// 获取行业信息
        /// </summary>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        private static List <dynamic> GetAreaInfo(string industryCode)
        {
            SqlModel sql = SqlModel.Select(
                BASDIC.CODE
                , BASDIC.TITLE
                )
                           .From(DB.BASDIC).Where(BASDIC.CODE.In(StringHelper.SqlInCondition(industryCode)));

            return(sql.ExecToDynamicList());
        }
示例#4
0
        /// <summary>
        /// 获取监测项
        /// </summary>
        /// <param name="type">P:排口 C:企业</param>
        /// <param name="id"></param>
        /// <param name="pkType">当type为企业是,只获取对应类型的排口因子(1-废气、2-废水、3-VOCs)</param>
        /// <returns></returns>
        public List <string> GetMonitorItem(string type, string id, List <string> pkType)
        {
            List <string> itemCode = new List <string>();

            if ("P" == type)
            {
                SqlModel.Select(T_BASE_COMPANY_PK_TX.CLCS)
                .From(DB.T_BASE_COMPANY_PK)
                .LeftJoin(DB.T_BASE_COMPANY_PK_TX).On(T_BASE_COMPANY_PK.ID == T_BASE_COMPANY_PK_TX.PKID)
                .Where(T_BASE_COMPANY_PK.ID == id)
                .ExecToDynamicList()
                .ForEach(item => {
                    string codes = StringHelper.DynamicToString(item["CLCS"]);
                    if (string.IsNullOrEmpty(codes))
                    {
                        return;
                    }
                    codes.Split(',').ToList()
                    .ForEach(code => {
                        if (itemCode.Exists(c => c == code))
                        {
                            return;
                        }
                        itemCode.Add(code);
                    });
                });
            }
            if ("C" == type)
            {
                SqlModel.Select(T_BASE_COMPANY_PK_TX.CLCS)
                .From(DB.T_BASE_COMPANY)
                .LeftJoin(DB.T_BASE_COMPANY_PK).On(T_BASE_COMPANY_PK.COMPANYID == T_BASE_COMPANY.ID & T_BASE_COMPANY_PK.TYPE.In(StringHelper.SqlInCondition(pkType)))
                .LeftJoin(DB.T_BASE_COMPANY_PK_TX).On(T_BASE_COMPANY_PK.ID == T_BASE_COMPANY_PK_TX.PKID)
                .Where(T_BASE_COMPANY.ID == id)
                .ExecToDynamicList()
                .ForEach(item => {
                    string codes = StringHelper.DynamicToString(item["CLCS"]);
                    if (string.IsNullOrEmpty(codes))
                    {
                        return;
                    }
                    codes.Split(',').ToList()
                    .ForEach(code => {
                        if (itemCode.Exists(c => c == code))
                        {
                            return;
                        }
                        itemCode.Add(code);
                    });
                });
            }
            return(itemCode);
        }