|
@@ -1762,6 +1762,7 @@
|
|
left join sys_office so on so.id = su.office_id
|
|
left join sys_office so on so.id = su.office_id
|
|
<where>
|
|
<where>
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
|
+ a.status = 5
|
|
and a.emergency_project = 1
|
|
and a.emergency_project = 1
|
|
and (a.reported_state=6 or a.reported_state is null)
|
|
and (a.reported_state=6 or a.reported_state is null)
|
|
and prd.status = 5
|
|
and prd.status = 5
|
|
@@ -1787,6 +1788,7 @@
|
|
left join sys_office so on so.id = su.office_id
|
|
left join sys_office so on so.id = su.office_id
|
|
<where>
|
|
<where>
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
|
+ a.status = 5
|
|
and (a.emergency_project = 0 or a.emergency_project is null)
|
|
and (a.emergency_project = 0 or a.emergency_project is null)
|
|
and (a.reported_state=6 or a.reported_state is null)
|
|
and (a.reported_state=6 or a.reported_state is null)
|
|
and prd.status = 5
|
|
and prd.status = 5
|
|
@@ -2159,6 +2161,7 @@
|
|
left join sys_office so on so.id = su.office_id
|
|
left join sys_office so on so.id = su.office_id
|
|
<where>
|
|
<where>
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
|
+ a.status = 5
|
|
and a.emergency_project = 1
|
|
and a.emergency_project = 1
|
|
and (a.record_state=6 or a.record_state is null)
|
|
and (a.record_state=6 or a.record_state is null)
|
|
and prd.status = 5
|
|
and prd.status = 5
|
|
@@ -2183,6 +2186,7 @@
|
|
left join sys_office so on so.id = su.office_id
|
|
left join sys_office so on so.id = su.office_id
|
|
<where>
|
|
<where>
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
|
+ a.status = 5
|
|
and (a.emergency_project = 0 or a.emergency_project is null)
|
|
and (a.emergency_project = 0 or a.emergency_project is null)
|
|
and (a.record_state=6 or a.record_state is null)
|
|
and (a.record_state=6 or a.record_state is null)
|
|
and prd.status = 5
|
|
and prd.status = 5
|
|
@@ -3874,8 +3878,6 @@
|
|
WHERE
|
|
WHERE
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
AND ( prd.STATUS IS NULL OR prd.STATUS = '' )
|
|
AND ( prd.STATUS IS NULL OR prd.STATUS = '' )
|
|
- AND a.emergency_project = 1
|
|
|
|
- AND ( a.reported_state = 6 OR a.reported_state IS NULL )
|
|
|
|
AND datediff( now(), prd.create_date )> 53
|
|
AND datediff( now(), prd.create_date )> 53
|
|
</select>
|
|
</select>
|
|
<select id="findProjectRegistrantResponsiblePersonList" resultType="com.jeeplus.modules.sys.entity.User">
|
|
<select id="findProjectRegistrantResponsiblePersonList" resultType="com.jeeplus.modules.sys.entity.User">
|
|
@@ -3928,4 +3930,666 @@ GROUP BY
|
|
</where>
|
|
</where>
|
|
</update>
|
|
</update>
|
|
|
|
|
|
|
|
+
|
|
|
|
+ <select id="selectProjectReportDataList" resultType="RuralProjectRecords">
|
|
|
|
+ SELECT
|
|
|
|
+ <include refid="projectRecordsColumnss"/>
|
|
|
|
+ ,a.record_state as "recordState"
|
|
|
|
+ ,a.submit_money as "submitMoney"
|
|
|
|
+ ,(case when a.submit_money = '1' then 'B级' when a.submit_money = '2' then 'A级' else '' end) as projectScale
|
|
|
|
+ ,(case
|
|
|
|
+ when a.submit_money = '1' and prd.status = '5' then
|
|
|
|
+ '已完成'
|
|
|
|
+ when a.submit_money = '2' and prdt.status = '5' then
|
|
|
|
+ '已完成' else '未完成'
|
|
|
|
+ end) as completionStatus
|
|
|
|
+ ,a.project_type as projectType,
|
|
|
|
+ wci.name AS "workContractInfo.name",
|
|
|
|
+ wci.contract_num as "workContractInfo.contractNum",
|
|
|
|
+ wci.contract_price as "workContractInfo.contractPrice",
|
|
|
|
+ sub.name as "projectMasterName",
|
|
|
|
+ sob.name as "projectMasterOffice",
|
|
|
|
+ wct.id AS "workContractInfo.client.id",
|
|
|
|
+ wct.name AS "workContractInfo.client.name",
|
|
|
|
+ o.top_company AS "office.name",
|
|
|
|
+ o.name AS "createByOffice",
|
|
|
|
+ ifnull(prd.number ,"") as "projectReportNumber"
|
|
|
|
+ ,ifnull(prd.status,0) as "projectReportStatus"
|
|
|
|
+ ,ifnull(prd.name,"") as "projectReportName"
|
|
|
|
+ ,ifnull(prr.status,0) as "projectReportRecordStatus"
|
|
|
|
+ ,ifnull(prrd.status,0) as "downProjectReportRecordStatus",
|
|
|
|
+ prrd.file_num as recodeNum,
|
|
|
|
+ prr.process_instance_id as prrProcessInstanceId,
|
|
|
|
+ prrd.process_instance_id as prrdProcessInstanceId
|
|
|
|
+ ,prd.id as prdId
|
|
|
|
+ ,prr.id as prrId
|
|
|
|
+ ,prrd.id as prrdId
|
|
|
|
+ ,prd.audit_pass_date as auditPassDate
|
|
|
|
+ ,if(date_add(prd.audit_pass_date,interval #{ruralProjectRecords.endingCount} day) >now(),"0","1") as reportedType
|
|
|
|
+ ,ifnull(rprr.report_status,0) as "reportStatus"
|
|
|
|
+ ,ifnull(rprr.sync_status,0) as "syncStatus"
|
|
|
|
+ ,ifnull(pas.status,0) as "approvalSignatureStatus"
|
|
|
|
+ ,ifnull(pas.process_instance_id,"") as "approvalSignatureProcessInstanceId"
|
|
|
|
+ ,ifnull(prs.status,0) as "reportSignatureStatus"
|
|
|
|
+ ,ifnull(prs.process_instance_id,"") as "reportSignatureProcessInstanceId"
|
|
|
|
+ ,rprr.process_instance_id as "reportedProcessInstanceId"
|
|
|
|
+ ,ifnull(prdt.status,0) as "projectReportStatusTwo"
|
|
|
|
+ ,prdt.id as prdtId
|
|
|
|
+ ,prdt.process_instance_id as prdtProcessinstanceId
|
|
|
|
+ ,ifnull(pmdr.status,0) as "defectRecordStatus"
|
|
|
|
+ ,pmdr.process_instance_id as "pmdrProcessInstanceId"
|
|
|
|
+ ,pmdr.id as pmdrId
|
|
|
|
+ ,ifnull(ppf.status,0) as "paperFilingStatus"
|
|
|
|
+ ,ppf.process_instance_id as "ppfProcessInstanceId"
|
|
|
|
+ ,ppf.id as "ppfId"
|
|
|
|
+ ,pfb.process_instance_id AS "filingProcessinstanceId"
|
|
|
|
+ ,ifnull(pfp.status,0) as "filingProjectStatus"
|
|
|
|
+ ,ifnull(prd.approval_fee ,"") as "approvalFee"
|
|
|
|
+ ,ifnull(prd.review_fee ,"") as "reviewFee"
|
|
|
|
+ ,ifnull(prd.verify_fee ,"") as "verifyFee"
|
|
|
|
+ ,ifnull(prd.verify_rate ,"") as "verifyRate"
|
|
|
|
+ ,prd.audit_pass_date as "reportAuditDate"
|
|
|
|
+ ,prdt.audit_pass_date as "reportTwoAuditDate"
|
|
|
|
+ /*,SUM(wi.money) as "money"*/
|
|
|
|
+ ,prd.ZiXunShouRu as "money"
|
|
|
|
+ ,prd.signature_flag as "signatureFlag"
|
|
|
|
+ ,prd.signature_contract_id as "signatureContractId"
|
|
|
|
+ ,prd.signature_url as "signatureUrl"
|
|
|
|
+ ,a.report_signature_flag as "reportSignatureFlag"
|
|
|
|
+ ,a.report_signature_url as "reportSignatureUrl"
|
|
|
|
+ ,a.report_signature_contract_id as "reportSignatureContractId"
|
|
|
|
+ ,prsi.id as "prsiId"
|
|
|
|
+ FROM statement_report_data_info sdi
|
|
|
|
+
|
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field1 == '5'.toString() ">
|
|
|
|
+ LEFT JOIN rural_project_records a ON sdi.field1 = a.id
|
|
|
|
+ </if>
|
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field2 == '5'.toString() ">
|
|
|
|
+ LEFT JOIN rural_project_records a ON sdi.field2 = a.id
|
|
|
|
+ </if>
|
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field6 == '5'.toString() ">
|
|
|
|
+ LEFT JOIN rural_project_records a ON sdi.field3 = a.id
|
|
|
|
+ </if>
|
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field7 == '5'.toString() ">
|
|
|
|
+ LEFT JOIN rural_project_records a ON sdi.field4 = 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>
|
|
|
|
+ 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.field1 == '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="statementCompanyComprehensiveInfo.field2 == '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="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="statementCompanyComprehensiveInfo.field6 == '5'.toString() ">
|
|
|
|
+ and a.office_id in(select id from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
|
|
|
|
+ AND ( prd.STATUS IS NULL OR prd.STATUS = '' )
|
|
|
|
+ AND datediff( now(), prd.create_date ) <= 60
|
|
|
|
+ </if>
|
|
|
|
+ <if test="statementCompanyComprehensiveInfo.field7 == '5'.toString() ">
|
|
|
|
+ and a.office_id in(select id from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
|
|
|
|
+ AND ( prd.STATUS IS NULL OR prd.STATUS = '' )
|
|
|
|
+ AND datediff( now(), prd.create_date ) > 60
|
|
|
|
+ </if>
|
|
|
|
+ <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>
|
|
|
|
+ GROUP BY a.id
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="ruralProjectRecords.page !=null and ruralProjectRecords.page.orderBy != null and ruralProjectRecords.page.orderBy != ''">
|
|
|
|
+ ORDER BY ${ruralProjectRecords.page.orderBy}
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ ORDER BY a.update_date DESC
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ limit ${ruralProjectRecords.page.pageNo},${ruralProjectRecords.page.pageSize}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <select id="selectProjectReportDataCount" resultType="integer">
|
|
|
|
+ select
|
|
|
|
+ count(DISTINCT id)
|
|
|
|
+ from statement_report_data_info
|
|
|
|
+ <where>
|
|
|
|
+ year = #{year}
|
|
|
|
+ and type = #{type}
|
|
|
|
+ and big_date_type = #{bigDateType}
|
|
|
|
+ and small_date_type = #{smallDateType}
|
|
|
|
+ and office_id = #{officeId}
|
|
|
|
+ <if test="field1 == '5'.toString()">
|
|
|
|
+ and field1 IS NOT NULL and field1 != ''
|
|
|
|
+ </if>
|
|
|
|
+ <if test="field2 == '5'.toString() ">
|
|
|
|
+ and field2 IS NOT NULL and field2 != ''
|
|
|
|
+ </if>
|
|
|
|
+ <if test="field6 == '5'.toString() ">
|
|
|
|
+ and field3 IS NOT NULL and field3 != ''
|
|
|
|
+ </if>
|
|
|
|
+ <if test="field7 == '5'.toString() ">
|
|
|
|
+ and field4 IS NOT NULL and field4 != ''
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectReportZJPage" resultType="RuralProjectRecords">
|
|
|
|
+ SELECT
|
|
|
|
+ <include refid="projectRecordsColumnss"/>
|
|
|
|
+ ,a.record_state as "recordState"
|
|
|
|
+ ,a.submit_money as "submitMoney"
|
|
|
|
+ ,(case when a.submit_money = '1' then 'B级' when a.submit_money = '2' then 'A级' else '' end) as projectScale
|
|
|
|
+ ,(case
|
|
|
|
+ when a.submit_money = '1' and prd.status = '5' then
|
|
|
|
+ '已完成'
|
|
|
|
+ when a.submit_money = '2' and prdt.status = '5' then
|
|
|
|
+ '已完成' else '未完成'
|
|
|
|
+ end) as completionStatus
|
|
|
|
+ ,a.project_type as projectType,
|
|
|
|
+ wci.name AS "workContractInfo.name",
|
|
|
|
+ wci.contract_num as "workContractInfo.contractNum",
|
|
|
|
+ wci.contract_price as "workContractInfo.contractPrice",
|
|
|
|
+ sub.name as "projectMasterName",
|
|
|
|
+ sob.name as "projectMasterOffice",
|
|
|
|
+ wct.id AS "workContractInfo.client.id",
|
|
|
|
+ wct.name AS "workContractInfo.client.name",
|
|
|
|
+ o.top_company AS "office.name",
|
|
|
|
+ o.name AS "createByOffice",
|
|
|
|
+ ifnull(prd.number ,"") as "projectReportNumber"
|
|
|
|
+ ,ifnull(prd.status,0) as "projectReportStatus"
|
|
|
|
+ ,ifnull(prd.name,"") as "projectReportName"
|
|
|
|
+ ,ifnull(prr.status,0) as "projectReportRecordStatus"
|
|
|
|
+ ,ifnull(prrd.status,0) as "downProjectReportRecordStatus",
|
|
|
|
+ prrd.file_num as recodeNum,
|
|
|
|
+ prr.process_instance_id as prrProcessInstanceId,
|
|
|
|
+ prrd.process_instance_id as prrdProcessInstanceId
|
|
|
|
+ ,prd.id as prdId
|
|
|
|
+ ,prr.id as prrId
|
|
|
|
+ ,prrd.id as prrdId
|
|
|
|
+ ,prd.audit_pass_date as auditPassDate
|
|
|
|
+ ,if(date_add(prd.audit_pass_date,interval #{ruralProjectRecords.endingCount} day) >now(),"0","1") as reportedType
|
|
|
|
+ ,ifnull(rprr.report_status,0) as "reportStatus"
|
|
|
|
+ ,ifnull(rprr.sync_status,0) as "syncStatus"
|
|
|
|
+ ,ifnull(pas.status,0) as "approvalSignatureStatus"
|
|
|
|
+ ,ifnull(pas.process_instance_id,"") as "approvalSignatureProcessInstanceId"
|
|
|
|
+ ,ifnull(prs.status,0) as "reportSignatureStatus"
|
|
|
|
+ ,ifnull(prs.process_instance_id,"") as "reportSignatureProcessInstanceId"
|
|
|
|
+ ,rprr.process_instance_id as "reportedProcessInstanceId"
|
|
|
|
+ ,ifnull(prdt.status,0) as "projectReportStatusTwo"
|
|
|
|
+ ,prdt.id as prdtId
|
|
|
|
+ ,prdt.process_instance_id as prdtProcessinstanceId
|
|
|
|
+ ,ifnull(pmdr.status,0) as "defectRecordStatus"
|
|
|
|
+ ,pmdr.process_instance_id as "pmdrProcessInstanceId"
|
|
|
|
+ ,pmdr.id as pmdrId
|
|
|
|
+ ,ifnull(ppf.status,0) as "paperFilingStatus"
|
|
|
|
+ ,ppf.process_instance_id as "ppfProcessInstanceId"
|
|
|
|
+ ,ppf.id as "ppfId"
|
|
|
|
+ ,pfb.process_instance_id AS "filingProcessinstanceId"
|
|
|
|
+ ,ifnull(pfp.status,0) as "filingProjectStatus"
|
|
|
|
+ ,ifnull(prd.approval_fee ,"") as "approvalFee"
|
|
|
|
+ ,ifnull(prd.review_fee ,"") as "reviewFee"
|
|
|
|
+ ,ifnull(prd.verify_fee ,"") as "verifyFee"
|
|
|
|
+ ,ifnull(prd.verify_rate ,"") as "verifyRate"
|
|
|
|
+ ,prd.audit_pass_date as "reportAuditDate"
|
|
|
|
+ ,prdt.audit_pass_date as "reportTwoAuditDate"
|
|
|
|
+ /*,SUM(wi.money) as "money"*/
|
|
|
|
+ ,prd.ZiXunShouRu as "money"
|
|
|
|
+ ,prd.signature_flag as "signatureFlag"
|
|
|
|
+ ,prd.signature_contract_id as "signatureContractId"
|
|
|
|
+ ,prd.signature_url as "signatureUrl"
|
|
|
|
+ ,a.report_signature_flag as "reportSignatureFlag"
|
|
|
|
+ ,a.report_signature_url as "reportSignatureUrl"
|
|
|
|
+ ,a.report_signature_contract_id as "reportSignatureContractId"
|
|
|
|
+ ,prsi.id as "prsiId"
|
|
|
|
+ FROM rural_project_records a
|
|
|
|
+ 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>
|
|
|
|
+ a.del_flag=0
|
|
|
|
+ and a.status = 5
|
|
|
|
+ and a.office_id in(select id from sys_office where id = #{officeId} or parent_ids like concat('%',#{officeId},'%'))
|
|
|
|
+ <if test="recordState == '5'.toString() ">
|
|
|
|
+ and a.record_state = 5
|
|
|
|
+ and a.over_record_status = 0
|
|
|
|
+ and prr.status = 5
|
|
|
|
+ and prr.del_flag = 0
|
|
|
|
+ and prr.accomplish_date >= #{beginDate}
|
|
|
|
+ and prr.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},'%')
|
|
|
|
+ </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>
|
|
|
|
+ GROUP BY a.id
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="ruralProjectRecords.page !=null and ruralProjectRecords.page.orderBy != null and ruralProjectRecords.page.orderBy != ''">
|
|
|
|
+ ORDER BY ${ruralProjectRecords.page.orderBy}
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ ORDER BY a.update_date DESC
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ limit ${ruralProjectRecords.page.pageNo},${ruralProjectRecords.page.pageSize}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <select id="reportZJPageCount" resultType="integer">
|
|
|
|
+ SELECT
|
|
|
|
+ count(DISTINCT a.id)
|
|
|
|
+ FROM rural_project_records a
|
|
|
|
+ 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>
|
|
|
|
+ a.del_flag=0
|
|
|
|
+ and a.status = 5
|
|
|
|
+ and a.office_id in(select id from sys_office where id = #{officeId} or parent_ids like concat('%',#{officeId},'%'))
|
|
|
|
+ <if test="recordState == '5'.toString() ">
|
|
|
|
+ and a.record_state = 5
|
|
|
|
+ and a.over_record_status = 0
|
|
|
|
+ and prr.status = 5
|
|
|
|
+ and prr.del_flag = 0
|
|
|
|
+ and prr.accomplish_date >= #{beginDate}
|
|
|
|
+ and prr.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},'%')
|
|
|
|
+ </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>
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|