Exemple #1
0
        /// <summary>
        /// 查询工单表
        /// </summary>
        public void QueryProductionPlan(DataTable queryDataTable, string planNoStr, string planDateBeginStr, string planDateEndStr, string projectNoStr, string commonStr)
        {
            string sqlStr = " Head.CurrentStatus in (2) and PlanStatus = 1 and IsNull(IsEnd, 0) = 0";

            if (planNoStr != "")
            {
                sqlStr += string.Format(" and Head.PlanNo like '%{0}%'", planNoStr);
            }
            if (planDateBeginStr != "")
            {
                //sqlStr += string.Format(" and (StartTime between '{0}' and '{1}' or EndTime between '{0}' and '{1}')", planDateBeginStr, planDateEndStr);
                sqlStr += BaseSQL.GetDateRegion_DoubleColumn_WhereSql("StartTime", "EndTime", planDateBeginStr, planDateEndStr);
            }
            if (projectNoStr != "")
            {
                sqlStr += string.Format(" and Head.ProjectNo='{0}'", projectNoStr);
            }
            if (commonStr != "")
            {
                sqlStr += string.Format(" and (PlanNo like '%{0}%' or Head.ProjectNo like '%{0}%' or Head.Line like '%{0}%' or Head.Remark like '%{0}%')", commonStr);
            }
            sqlStr = string.Format("select Head.*, BS_ProjectList.ProjectName, CodeFileName, CodeName from PB_ProductionPlan as Head join BS_ProjectList on Head.ProjectNo = BS_ProjectList.ProjectNo left join SW_PartsCode on Head.CodeId = SW_PartsCode.AutoId where {0} order by Head.AutoId", sqlStr);
            BaseSQL.Query(sqlStr, queryDataTable);
        }