Browse Source

筛选项调整

sangwenwei 5 tháng trước cách đây
mục cha
commit
ff76b40503

+ 36 - 6
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml

@@ -716,7 +716,14 @@ END) as projectScale*/
 				</otherwise>
 			</choose>
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
-				and prd.number like concat('%',#{reportData.number},'%')
+				and (
+				<if test="reportData.number == '暂无报告'">
+					(prd.number = '' or prd.number is null)
+				</if>
+				<if test="reportData.number != '暂无报告'">
+					prd.number like concat('%', #{reportData.number}, '%')
+				</if>
+				)
 			</if>
 			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}
@@ -744,8 +751,16 @@ END) as projectScale*/
 			</if>
 
 
-			<if test="projectReportStatus != null and projectReportStatus != ''">
-				AND prd.status = #{projectReportStatus}
+			<if test="projectReportStatus != null">
+				AND
+				<choose>
+					<when test="projectReportStatus != 0">
+						prd.status = #{projectReportStatus}
+					</when>
+					<otherwise>
+						prd.STATUS is null
+					</otherwise>
+				</choose>
 			</if>
 			<if test="submitMoney != null and submitMoney != ''">
 				AND a.submit_money = #{submitMoney}
@@ -1614,7 +1629,14 @@ END) as projectScale*/
 				</choose>
 			</if>
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
-				and prd.number like concat('%',#{reportData.number},'%')
+				and (
+				<if test="reportData.number == '暂无报告'">
+					(prd.number = '' or prd.number is null)
+				</if>
+				<if test="reportData.number != '暂无报告'">
+					prd.number like concat('%', #{reportData.number}, '%')
+				</if>
+				)
 			</if>
 			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}
@@ -1628,8 +1650,16 @@ END) as projectScale*/
 					#{officeId}
 				</foreach>
 			</if>
-			<if test="projectReportStatus != null and projectReportStatus != ''">
-				AND prd.status = #{projectReportStatus}
+			<if test="projectReportStatus != null ">
+				AND
+				<choose>
+					<when test="projectReportStatus != 0">
+						prd.status = #{projectReportStatus}
+					</when>
+					<otherwise>
+						prd.STATUS is null
+					</otherwise>
+				</choose>
 			</if>
 			<if test="reportedState !=null and reportedState !=''">
 				<choose>

+ 58 - 26
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageDao.xml

@@ -632,7 +632,14 @@
 				</otherwise>
 			</choose>
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
-				and prd.number like concat('%',#{reportData.number},'%')
+				and (
+				<if test="reportData.number == '暂无报告'">
+					(prd.number = '' or prd.number is null)
+				</if>
+				<if test="reportData.number != '暂无报告'">
+					prd.number like concat('%', #{reportData.number}, '%')
+				</if>
+				)
 			</if>
 			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}
@@ -660,8 +667,16 @@
             </if>
 
 
-			<if test="projectReportStatus != null and projectReportStatus != ''">
-				AND prd.status = #{projectReportStatus}
+			<if test="projectReportStatus != null ">
+				AND
+				<choose>
+					<when test="projectReportStatus != 0">
+						prd.status = #{projectReportStatus}
+					</when>
+					<otherwise>
+						prd.STATUS is null
+					</otherwise>
+				</choose>
 			</if>
 			<if test="submitMoney != null and submitMoney != ''">
 				AND a.submit_money = #{submitMoney}
@@ -696,16 +711,17 @@
 			<if test="projectType != null and projectType != ''">
 				AND a.project_type = #{projectType}
 			</if>
-			<choose>
-				<when test="projectReportStatusTwo == 0">
-					AND prdt.status is null
-				</when>
-				<otherwise>
-					<if test="projectReportStatusTwo!=null and projectReportStatusTwo !=''">
-						AND prdt.status = #{projectReportStatusTwo}
-					</if>
-				</otherwise>
-			</choose>
+			<if test="projectReportStatusTwo!=null">
+				AND
+				<choose>
+					<when test="projectReportStatusTwo != 0">
+						prdt.status = #{projectReportStatusTwo}
+					</when>
+					<otherwise>
+						prdt.STATUS is null
+					</otherwise>
+				</choose>
+			</if>
 
             AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
             <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
@@ -967,7 +983,14 @@
 				</otherwise>
 			</choose>
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
-				and prd.number like concat('%',#{reportData.number},'%')
+				and (
+				<if test="reportData.number == '暂无报告'">
+					(prd.number = '' or prd.number is null)
+				</if>
+				<if test="reportData.number != '暂无报告'">
+					prd.number like concat('%', #{reportData.number}, '%')
+				</if>
+				)
 			</if>
 			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}
@@ -981,8 +1004,16 @@
 					#{officeId}
 				</foreach>
 			</if>
-			<if test="projectReportStatus != null and projectReportStatus != ''">
-				AND prd.status = #{projectReportStatus}
+			<if test="projectReportStatus != null">
+				AND
+				<choose>
+					<when test="projectReportStatus != 0">
+						prd.status = #{projectReportStatus}
+					</when>
+					<otherwise>
+						prd.STATUS is null
+					</otherwise>
+				</choose>
 			</if>
 			<if test="reportedState !=null and reportedState !=''">
 				<choose>
@@ -1023,16 +1054,17 @@
 					</choose>
 				</otherwise>
 			</choose>
-			<choose>
-				<when test="projectReportStatusTwo == 0">
-					AND prdt.status is null
-				</when>
-				<otherwise>
-					<if test="projectReportStatusTwo!=null and projectReportStatusTwo !=''">
-						AND prdt.status = #{projectReportStatusTwo}
-					</if>
-				</otherwise>
-			</choose>
+			<if test="projectReportStatusTwo!=null">
+				AND
+				<choose>
+					<when test="projectReportStatusTwo != 0">
+						prdt.status = #{projectReportStatusTwo}
+					</when>
+					<otherwise>
+						prdt.STATUS is null
+					</otherwise>
+				</choose>
+			</if>
 			<if test="projectType != null and projectType != ''">
 				AND a.project_type = #{projectType}
 			</if>

+ 16 - 2
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -640,7 +640,14 @@
 				</otherwise>
 			</choose>
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
-				and prd.number like concat('%',#{reportData.number},'%')
+				and (
+				<if test="reportData.number == '暂无报告'">
+					(prd.number = '' or prd.number is null)
+				</if>
+				<if test="reportData.number != '暂无报告'">
+					prd.number like concat('%', #{reportData.number}, '%')
+				</if>
+				)
 			</if>
 			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}
@@ -1171,7 +1178,14 @@
 				</choose>
 			</if>
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
-				and prd.number like concat('%',#{reportData.number},'%')
+				and (
+				<if test="reportData.number == '暂无报告'">
+					(prd.number = '' or prd.number is null)
+				</if>
+				<if test="reportData.number != '暂无报告'">
+					prd.number like concat('%', #{reportData.number}, '%')
+				</if>
+				)
 			</if>
 			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}