Explorar o código

项目列表-咨询营业收入统计-调整

huangguoce hai 3 días
pai
achega
1e0c49fe62

+ 79 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml

@@ -2220,8 +2220,33 @@ END) as projectScale*/
 		LEFT JOIN sys_user sua on a.create_by = sua.id
 		left join project_paper_filing ppf on ppf.project_id = a.id
 		LEFT JOIN sys_office o ON o.id = a.office_id
+		left join rural_project_records_reported rprr on rprr.id = a.id
+		left join case_base cb on a.id = cb.project_id
 		<where>
 			a.status = 5
+			<if test="caseStatus !=null and caseStatus != ''">
+				<choose>
+					<when test="caseStatus == 0">
+						and a.id not in (select project_id from case_base)
+					</when>
+					<otherwise>
+						AND cb.case_status = #{caseStatus}
+					</otherwise>
+				</choose>
+			</if>
+			<if test="null != defectRecordStatus">
+				<choose>
+					<when test="defectRecordStatus == 0">
+						and pmdr.status is null
+					</when>
+					<otherwise>
+						and pmdr.status = #{defectRecordStatus}
+					</otherwise>
+				</choose>
+			</if>
+			<if test="projectMaterialStorageStatus !=null and projectMaterialStorageStatus!=''">
+				AND a.project_material_storage_status= #{projectMaterialStorageStatus}
+			</if>
 			<if test="bzshbUserId!=null and bzshbUserId!=''">
 				and prd.bzshb_user_id=#{bzshbUserId}
 			</if>
@@ -2317,12 +2342,66 @@ END) as projectScale*/
 					</if>
 				</otherwise>
 			</choose>
+
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
 				and prd.number like concat('%',#{reportData.number},'%')
 			</if>
 			<if test="engineeringType !=null and engineeringType !=''">
 				and a.engineering_type= #{engineeringType}
 			</if>
+			<!-- 质量复核审核时间 -->
+			<if test="reportBeginDate !=null">
+				AND prd.audit_pass_date >= #{reportBeginDate}
+			</if>
+			<if test="reportEndDate !=null">
+				AND prd.audit_pass_date &lt;= #{reportEndDate}
+			</if>
+			<if test="reportBeginDate !=null or reportEndDate !=null">
+				AND prd.status in (5,7)
+			</if>
+			<!-- 报告签发审核时间 -->
+			<if test="reportTwoBeginDate !=null">
+				AND prdt.audit_pass_date >= #{reportTwoBeginDate}
+			</if>
+			<if test="reportTwoEndDate !=null">
+				AND prdt.audit_pass_date &lt;= #{reportTwoEndDate}
+			</if>
+			<if test="reportTwoBeginDate !=null or reportTwoEndDate !=null">
+				AND prdt.status in (5,7)
+			</if>
+			<!-- 电子归档审核时间 -->
+			<if test="reportRecordBeginDate !=null">
+				AND prr.accomplish_date >= #{reportRecordBeginDate}
+			</if>
+			<if test="reportRecordEndDate !=null">
+				AND prr.accomplish_date &lt;= #{reportRecordEndDate}
+			</if>
+			<if test="reportRecordBeginDate !=null or reportRecordEndDate !=null">
+				AND prr.status in (5,7)
+			</if>
+			<!-- 纸质归档审核时间 -->
+			<if test="paperRecordBeginDate !=null">
+				and (pfp.audit_pass_date >= #{paperRecordBeginDate}
+				or ppf.audit_pass_date >= #{paperRecordBeginDate})
+			</if>
+			<if test="paperRecordEndDate !=null">
+				and (pfp.audit_pass_date &lt;= #{paperRecordEndDate}
+				or ppf.audit_pass_date &lt;= #{paperRecordEndDate})
+			</if>
+			<if test="paperRecordBeginDate !=null or paperRecordBeginDate !=null">
+				AND (ppf.status in (5,7) or pfp.status in (5,7))
+				and (a.paper_filing_status != 10 or a.paper_filing_status is null)
+			</if>
+			<!-- 上报审核时间 -->
+			<if test="reportedBeginDate !=null">
+				AND rprr.accomplish_date >= #{reportedBeginDate}
+			</if>
+			<if test="reportedEndDate !=null">
+				AND rprr.accomplish_date &lt;= #{reportedEndDate}
+			</if>
+			<if test="reportedBeginDate !=null or reportedEndDate !=null">
+				AND a.reported_state in (5,7)
+			</if>
 			<if test="attachmentProjectSort !=null and attachmentProjectSort !=''">
 				and a.attachment_project_sort= #{attachmentProjectSort}
 			</if>