|
@@ -2874,6 +2874,19 @@
|
|
|
and rprr.accomplish_date <= #{endDate}
|
|
|
</if>
|
|
|
|
|
|
+ <if test="projectPaperFiling == '5'.toString() ">
|
|
|
+ and ppf.status = 5
|
|
|
+ and ppf.del_flag = 0
|
|
|
+ and ppf.audit_pass_date >= #{beginDate}
|
|
|
+ and ppf.audit_pass_date <= #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="projectFlingBatchRelation == '5'.toString() ">
|
|
|
+ and pfp.status = 5
|
|
|
+ and pfp.del_flag = 0
|
|
|
+ and pfp.audit_pass_date >= #{beginDate}
|
|
|
+ and pfp.audit_pass_date <= #{endDate}
|
|
|
+ </if>
|
|
|
+
|
|
|
|
|
|
<if test="ruralProjectRecords.projectId != null and ruralProjectRecords.projectId != ''">
|
|
|
AND a.project_id like concat('%',#{ruralProjectRecords.projectId},'%')
|
|
@@ -3034,6 +3047,18 @@
|
|
|
and rprr.accomplish_date >= #{beginDate}
|
|
|
and rprr.accomplish_date <= #{endDate}
|
|
|
</if>
|
|
|
+ <if test="projectPaperFiling == '5'.toString() ">
|
|
|
+ and ppf.status = 5
|
|
|
+ and ppf.del_flag = 0
|
|
|
+ and ppf.audit_pass_date >= #{beginDate}
|
|
|
+ and ppf.audit_pass_date <= #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="projectFlingBatchRelation == '5'.toString() ">
|
|
|
+ and pfp.status = 5
|
|
|
+ and pfp.del_flag = 0
|
|
|
+ and pfp.audit_pass_date >= #{beginDate}
|
|
|
+ and pfp.audit_pass_date <= #{endDate}
|
|
|
+ </if>
|
|
|
|
|
|
|
|
|
<if test="ruralProjectRecords.projectId != null and ruralProjectRecords.projectId != ''">
|
|
@@ -3215,6 +3240,13 @@
|
|
|
LEFT JOIN rural_project_records a ON sdi.field4 = a.id
|
|
|
</if>
|
|
|
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field11 == '5'.toString() ">
|
|
|
+ LEFT JOIN rural_project_records a ON sdi.field5 = a.id
|
|
|
+ </if>
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field12 == '5'.toString() ">
|
|
|
+ LEFT JOIN rural_project_records a ON sdi.field6 = a.id
|
|
|
+ </if>
|
|
|
+
|
|
|
LEFT JOIN sys_area area ON area.id = a.area_id
|
|
|
left join rural_project_records_reported rprr on rprr.id = a.id
|
|
|
LEFT JOIN project_flingbatch_relation pfp on pfp.project_id=a.id
|
|
@@ -3385,25 +3417,181 @@
|
|
|
|
|
|
<select id="selectReportPageOverdueCount" resultType="integer">
|
|
|
select
|
|
|
- count(DISTINCT id)
|
|
|
- from statement_data_info
|
|
|
+ count(DISTINCT a.id)
|
|
|
+ from statement_data_info sdi
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field5 == '5'.toString() ">
|
|
|
+ LEFT JOIN rural_project_records a ON sdi.field1 = a.id
|
|
|
+ </if>
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field6 == '5'.toString() ">
|
|
|
+ LEFT JOIN rural_project_records a ON sdi.field2 = a.id
|
|
|
+ </if>
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field7 == '5'.toString() ">
|
|
|
+ LEFT JOIN rural_project_records a ON sdi.field3 = a.id
|
|
|
+ </if>
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field8 == '5'.toString() ">
|
|
|
+ LEFT JOIN rural_project_records a ON sdi.field4 = a.id
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field11 == '5'.toString() ">
|
|
|
+ LEFT JOIN rural_project_records a ON sdi.field5 = a.id
|
|
|
+ </if>
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field12 == '5'.toString() ">
|
|
|
+ LEFT JOIN rural_project_records a ON sdi.field6 = a.id
|
|
|
+ </if>
|
|
|
+ LEFT JOIN sys_area area ON area.id = a.area_id
|
|
|
+ left join rural_project_records_reported rprr on rprr.id = a.id
|
|
|
+ LEFT JOIN project_flingbatch_relation pfp on pfp.project_id=a.id
|
|
|
+ LEFT JOIN project_filingbatch pfb on pfb.id=pfp.filing_batch
|
|
|
+ LEFT JOIN sys_user sua on a.create_by = sua.id
|
|
|
+ <if test="ruralProjectRecords.leaderNameStr !=null and ruralProjectRecords.leaderNameStr !=''">
|
|
|
+ LEFT JOIN work_project_user w on a.id = w.project_id
|
|
|
+ LEFT JOIN sys_user su on w.user_id = su.id
|
|
|
+ </if>
|
|
|
+ LEFT JOIN sys_user sub on a.project_master_id = sub.id
|
|
|
+ LEFT JOIN sys_office sob ON sob.id = sub.office_id
|
|
|
+ LEFT JOIN work_project_user w1 on a.id = w1.project_id
|
|
|
+ LEFT JOIN work_contract_info wci on a.contract_id = wci.id
|
|
|
+ LEFT JOIN work_client_info wct on wci.client_id = wct.id
|
|
|
+ LEFT JOIN sys_office o ON o.id = a.office_id
|
|
|
+ left join project_report_data prd on prd.project_id = a.id
|
|
|
+ left join project_report_data_two prdt on prdt.project_id = a.id
|
|
|
+ left join rural_project_report_record prr on prr.report_id = prd.id
|
|
|
+ LEFT JOIN project_material_defect_record pmdr on prd.id = pmdr.report_id
|
|
|
+ left join rural_project_report_record_down prrd on prrd.report_id = prd.id
|
|
|
+ left join project_paper_filing ppf on ppf.project_id = a.id
|
|
|
+ left join project_approval_signature pas on pas.project_id = a.id
|
|
|
+ left join project_report_signature prs on prs.project_id = a.id
|
|
|
+ left join project_report_signature_info prsi on prsi.project_report_id = prd.number
|
|
|
<where>
|
|
|
- year = #{year}
|
|
|
- and type = #{type}
|
|
|
- and big_date_type = #{bigDateType}
|
|
|
- and small_date_type = #{smallDateType}
|
|
|
- and office_id = #{officeId}
|
|
|
- <if test="field5 == '5'.toString()">
|
|
|
- and field1 IS NOT NULL and field1 != ''
|
|
|
+ a.status = 5
|
|
|
+ and a.del_flag = 0
|
|
|
+ and sdi.year = #{statementCompanyComprehensiveInfo.year}
|
|
|
+ and sdi.type = #{statementCompanyComprehensiveInfo.type}
|
|
|
+ and sdi.big_date_type = #{statementCompanyComprehensiveInfo.bigDateType}
|
|
|
+ and sdi.small_date_type = #{statementCompanyComprehensiveInfo.smallDateType}
|
|
|
+ and sdi.office_id = #{statementCompanyComprehensiveInfo.officeId}
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field5 == '5'.toString() ">
|
|
|
+ and a.record_state != 7
|
|
|
+ and pmdr.id is null
|
|
|
+ and a.over_record_status = 1
|
|
|
+ and a.office_id in(select id from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
|
|
|
</if>
|
|
|
- <if test="field6 == '5'.toString() ">
|
|
|
- and field2 IS NOT NULL and field2 != ''
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field6 == '5'.toString() ">
|
|
|
+ and a.record_state = 7
|
|
|
+ and pmdr.id is null
|
|
|
+ and a.over_record_status = 1
|
|
|
+ and a.office_id in(select id from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
|
|
|
+ and prr.status = 5
|
|
|
+ and prr.del_flag = 0
|
|
|
+ and prr.accomplish_date >= #{beginDate}
|
|
|
+ and prr.accomplish_date <= #{endDate}
|
|
|
</if>
|
|
|
- <if test="field7 == '5'.toString() ">
|
|
|
- and field3 IS NOT NULL and field3 != ''
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field7 == '5'.toString() ">
|
|
|
+ and a.over_due_status = 1
|
|
|
+ and a.office_id in(select id from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
|
|
|
</if>
|
|
|
- <if test="field8 == '5'.toString() ">
|
|
|
- and field4 IS NOT NULL and field4 != ''
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field8 == '5'.toString() ">
|
|
|
+ and a.reported_state = 7
|
|
|
+ and a.over_due_status = 1
|
|
|
+ and a.office_id in(select id from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
|
|
|
+ and rprr.report_status = 5
|
|
|
+ and rprr.del_flag = 0
|
|
|
+ and rprr.accomplish_date >= #{beginDate}
|
|
|
+ and rprr.accomplish_date <= #{endDate}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="ruralProjectRecords.projectId != null and ruralProjectRecords.projectId != ''">
|
|
|
+ AND a.project_id like concat('%',#{ruralProjectRecords.projectId},'%')
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.projectName != null and ruralProjectRecords.projectName != ''">
|
|
|
+ AND a.project_name like concat(concat('%',#{ruralProjectRecords.projectName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.scaleType != null and ruralProjectRecords.scaleType != ''">
|
|
|
+ AND a.scale_type = #{ruralProjectRecords.scaleType}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.scaleUnit != null and ruralProjectRecords.scaleUnit != ''">
|
|
|
+ AND a.scale_unit = #{ruralProjectRecords.scaleUnit}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.scaleQuantity != null and ruralProjectRecords.scaleQuantity != ''">
|
|
|
+ AND a.scale_quantity = #{ruralProjectRecords.scaleQuantity}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.projectSite != null and ruralProjectRecords.projectSite != ''">
|
|
|
+ AND a.project_site LIKE concat('%',#{ruralProjectRecords.projectSite},'%')
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.remarks != null and ruralProjectRecords.remarks != ''">
|
|
|
+ AND a.remarks LIKE concat('%',#{ruralProjectRecords.remarks},'%')
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.projectDesc != null and ruralProjectRecords.projectDesc != ''">
|
|
|
+ AND a.project_desc LIKE concat('%',#{ruralProjectRecords.projectDesc},'%')
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.area != null and ruralProjectRecords.area.id != null and ruralProjectRecords.area.id != ''">
|
|
|
+ AND a.area_id = #{ruralProjectRecords.area.id}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.workContractInfo !=null and ruralProjectRecords.workContractInfo.name !=null and ruralProjectRecords.workContractInfo.name !=''">
|
|
|
+ AND wci.name like concat(concat('%',#{ruralProjectRecords.workContractInfo.name}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.workContractInfo !=null and ruralProjectRecords.workContractInfo.contractNum !=null and ruralProjectRecords.workContractInfo.contractNum !=''">
|
|
|
+ AND wci.contract_num like concat(concat('%',#{ruralProjectRecords.workContractInfo.contractNum}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.workContractInfo !=null and ruralProjectRecords.workContractInfo.contractPrice !=null and ruralProjectRecords.workContractInfo.contractPrice !=''">
|
|
|
+ AND wci.contract_price = #{ruralProjectRecords.workContractInfo.contractPrice}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.workContractInfo !=null and ruralProjectRecords.workContractInfo.contractType !=null and ruralProjectRecords.workContractInfo.contractType !=''">
|
|
|
+ AND wci.contract_type = #{ruralProjectRecords.workContractInfo.contractType}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.workContractInfo!=null and ruralProjectRecords.workContractInfo.client !=null and ruralProjectRecords.workContractInfo.client.name !=null and ruralProjectRecords.workContractInfo.client.name !=''">
|
|
|
+ AND wct.name like concat(concat('%',#{ruralProjectRecords.workContractInfo.client.name}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.leaderNameStr !=null and ruralProjectRecords.leaderNameStr !=''">
|
|
|
+ AND su.name like concat(concat('%',#{ruralProjectRecords.leaderNameStr}),'%') AND w.is_master = '1' AND w.del_flag='0'
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.projectStatus !=null">
|
|
|
+ AND a.status = #{ruralProjectRecords.projectStatus}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.beginDate !=null">
|
|
|
+ AND a.create_date >= #{ruralProjectRecords.beginDate}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.endDate !=null">
|
|
|
+ AND a.create_date < #{ruralProjectRecords.endDate}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.projectType !=null and ruralProjectRecords.projectType !=''">
|
|
|
+ and project_type= #{ruralProjectRecords.projectType}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.engineeringType !=null and ruralProjectRecords.engineeringType !=''">
|
|
|
+ and a.engineering_type= #{ruralProjectRecords.engineeringType}
|
|
|
+ </if>
|
|
|
+ <!--<if test="office!=null and office.id!=null and office.id!=''">
|
|
|
+ and a.office_id = #{office.id}
|
|
|
+ </if>-->
|
|
|
+ <if test="ruralProjectRecords.officeIdList!=null and ruralProjectRecords.officeIdList.size!=0">
|
|
|
+ and a.office_id in
|
|
|
+ <foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
|
|
|
+ #{ruralProjectRecords.officeId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="ruralProjectRecords.reportData!=null and ruralProjectRecords.reportData.number !=null and ruralProjectRecords.reportData.number !=''">
|
|
|
+ and prd.number like concat('%',#{ruralProjectRecords.reportData.number},'%')
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.filingProjectStatus!=null and ruralProjectRecords.filingProjectStatus !=''">
|
|
|
+ and pfp.status =${ruralProjectRecords.filingProjectStatus}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.submitMoney!=null and ruralProjectRecords.submitMoney !=''">
|
|
|
+ and a.submit_money =#{ruralProjectRecords.submitMoney}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.createBy !=null and ruralProjectRecords.createBy !=''">
|
|
|
+ <if test="ruralProjectRecords.createBy.name !=null and ruralProjectRecords.createBy.name !=''">
|
|
|
+ AND sua.name like concat(concat('%',#{ruralProjectRecords.createBy.name}),'%')
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.office!=null and ruralProjectRecords.office.name!=null and ruralProjectRecords.office.name!=''">
|
|
|
+ AND o.name like concat(concat('%',#{ruralProjectRecords.office.name}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.sqlMap.delFlag !=null and ruralProjectRecords.sqlMap.delFlag!=''">
|
|
|
+ ${ruralProjectRecords.sqlMap.delFlag}
|
|
|
+ </if>
|
|
|
+ <if test="ruralProjectRecords.sqlMap.dsf !=null and ruralProjectRecords.sqlMap.dsf!=''">
|
|
|
+ AND ((w1.user_id = #{ruralProjectRecords.currentUser.id} AND w1.del_flag='0' AND a.company_id = #{ruralProjectRecords.currentUser.company.id} )${ruralProjectRecords.sqlMap.dsf} )
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|