2019/01/08

Posted hexx

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2019/01/08相关的知识,希望对你有一定的参考价值。

1. 查询条件

        /// <summary>
        /// 查询条件
        /// </summary>
        /// <returns></returns>
        private List<ConditionHelper.SqlqueryCondition> InquiryCondition()
        {
            var wheres = new List<ConditionHelper.SqlqueryCondition>();

            string branchname = hidBranchCode.Text;
            wheres.Add(new ConditionHelper.SqlqueryCondition(ConstraintType.And, V_b_u_chemicalenterpriseTable.Branch, Comparison.Equals, branchname));

            if (!string.IsNullOrEmpty(txtEnterpriseName.Text.Trim()))
            {

                wheres.Add(new ConditionHelper.SqlqueryCondition(ConstraintType.And, V_b_u_chemicalenterpriseTable.Enterprisename,
                    Comparison.Like, "%" + StringHelper.FilterSql(txtEnterpriseName.Text) + "%"));
            }

            if (!string.IsNullOrEmpty(ddlIndustryCode1.SelectedValue) && ddlIndustryCode1.SelectedValue != "-1")
            {
                var indusM1 = Basics_industry.SingleOrDefault(x => x.Classcode1 == ddlIndustryCode1.SelectedValue && x.Classgrade == 1);
                wheres.Add(new ConditionHelper.SqlqueryCondition(ConstraintType.And, V_b_u_chemicalenterpriseTable.Industrycode1,
                    Comparison.Equals, indusM1.Id));
            }
            if (!string.IsNullOrEmpty(ddlIndustryCode2.SelectedValue) && ddlIndustryCode2.SelectedValue != "-1")
            {
                var indusM2 = Basics_industry.SingleOrDefault(x => x.Classcode2 == ddlIndustryCode2.SelectedValue);
                wheres.Add(new ConditionHelper.SqlqueryCondition(ConstraintType.And, V_b_u_chemicalenterpriseTable.Industrycode2,
                    Comparison.Equals, indusM2.Id));
            }
            if (!string.IsNullOrEmpty(ddlIndustryCode3.SelectedValue) && ddlIndustryCode3.SelectedValue != "-1")
            {
                var indusM3 = Basics_industry.SingleOrDefault(x => x.Classcode3 == ddlIndustryCode3.SelectedValue);
                wheres.Add(new ConditionHelper.SqlqueryCondition(ConstraintType.And, V_b_u_chemicalenterpriseTable.Industrycode3,
                    Comparison.Equals, indusM3.Id));
            }
            if (!string.IsNullOrEmpty(ddlIndustryCode4.SelectedValue) && ddlIndustryCode4.SelectedValue != "-1")
            {
                var indusM4 = Basics_industry.SingleOrDefault(x => x.Classcode4 == ddlIndustryCode4.SelectedValue);
                wheres.Add(new ConditionHelper.SqlqueryCondition(ConstraintType.And, V_b_u_chemicalenterpriseTable.Industrycode4,
                    Comparison.Equals, indusM4.Id));
            }

            //
            if (!string.IsNullOrEmpty(ddlProvince.SelectedText.Trim()) && ddlProvince.SelectedText.Trim() != "选择省")
            {
                wheres.Add(new ConditionHelper.SqlqueryCondition(ConstraintType.And, V_b_u_chemicalenterpriseTable.Provinceid,
                    Comparison.Equals, StringHelper.FilterSql(ddlProvince.SelectedValue.Trim())));
            }
            //
            if (!string.IsNullOrEmpty(ddlCity.SelectedText.Trim()) && ddlCity.SelectedText.Trim() != "选择市")
            {
                wheres.Add(new ConditionHelper.SqlqueryCondition(ConstraintType.And, V_b_u_chemicalenterpriseTable.Cityid,
                    Comparison.Equals, StringHelper.FilterSql(ddlCity.SelectedValue.Trim())));
            }
            //
            if (!string.IsNullOrEmpty(ddlCounty.SelectedText.Trim()) && ddlCounty.SelectedText.Trim() != "选择区县")
            {
                wheres.Add(new ConditionHelper.SqlqueryCondition(ConstraintType.And, V_b_u_chemicalenterpriseTable.Countyid,
                    Comparison.Equals, StringHelper.FilterSql(ddlCounty.SelectedValue.Trim())));
            }
            ///审核状态
            //if (!string.IsNullOrEmpty(ddlAuditStatus.SelectedValue))
            //{
            //    wheres.Add(new ConditionHelper.SqlqueryCondition(ConstraintType.And, V_b_u_chemicalenterpriseTable.Auditstatus,
            //        Comparison.Equals, StringHelper.FilterSql(ddlAuditStatus.SelectedValue)));
            //}
            wheres.Add(new ConditionHelper.SqlqueryCondition(ConstraintType.And, V_b_u_chemicalenterpriseTable.Iszjaj,
                   Comparison.NotEquals, StringHelper.FilterSql("2")));
            //wheres.Add(new ConditionHelper.SqlqueryCondition(ConstraintType.And, V_b_u_chemicalenterpriseTable.Iszjaj,
            //        Comparison.Equals, StringHelper.FilterSql("1")));

            return wheres;
        }

 

以上是关于2019/01/08的主要内容,如果未能解决你的问题,请参考以下文章

2019-01-08 Echarts还有api接口

微信小程序代码片段

VSCode自定义代码片段——CSS选择器

谷歌浏览器调试jsp 引入代码片段,如何调试代码片段中的js

片段和活动之间的核心区别是啥?哪些代码可以写成片段?

VSCode自定义代码片段——.vue文件的模板