|
@@ -487,6 +487,7 @@
|
|
|
<select id="findListOnRecordDownload" resultType="RuralProjectRecords" >
|
|
|
SELECT
|
|
|
<include refid="projectRecordsColumns"/>
|
|
|
+ ,ifnull(a.reported_state,0) as "reportedState"
|
|
|
,a.project_master_id as "projectMasterId"
|
|
|
,sub.name as "projectMasterName"
|
|
|
,a.submit_money as "submitMoney"
|
|
@@ -576,4 +577,84 @@
|
|
|
and pmdr.status = 5
|
|
|
</where>
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="findListOnReportedDownload" resultType="RuralProjectRecords" >
|
|
|
+ SELECT
|
|
|
+ <include refid="projectRecordsColumns"/>
|
|
|
+ ,ifnull(a.reported_state,0) as "reportedState"
|
|
|
+ ,a.project_master_id as "projectMasterId"
|
|
|
+ ,sub.name as "projectMasterName"
|
|
|
+ ,a.submit_money as "submitMoney"
|
|
|
+ ,a.project_type as projectType,
|
|
|
+ wci.name AS "workContractInfo.name",
|
|
|
+ wct.id AS "workContractInfo.client.id",
|
|
|
+ wct.name AS "workContractInfo.client.name",
|
|
|
+ o.top_company AS "office.name",
|
|
|
+ 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
|
|
|
+ ,ifnull(rprr.report_status,0) as "reportStatus"
|
|
|
+ ,ifnull(rprr.sync_status,0) as "syncStatus"
|
|
|
+ ,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
|
|
|
+ ,wci.contract_num as "workContractInfo.contractNum"
|
|
|
+ ,wci.contract_price as "workContractInfo.contractPrice"
|
|
|
+ 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 sys_user sua on a.create_by = sua.id
|
|
|
+ LEFT JOIN sys_user sub on a.project_master_id = sub.id
|
|
|
+ LEFT JOIN work_project_user w on a.id = w.project_id
|
|
|
+ LEFT JOIN sys_user su on w.user_id = su.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
|
|
|
+
|
|
|
+ <where>
|
|
|
+ a.status = 5
|
|
|
+ AND a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
+ <if test="beginDate !=null">
|
|
|
+ AND a.create_date >= #{beginDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate !=null">
|
|
|
+ AND a.create_date < #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="reportedTypeList !=null and reportedTypeList !=''">
|
|
|
+ and (a.reported_state in
|
|
|
+ <foreach collection="reportedTypeList" item="status" index="index" open="(" close=")" separator=",">
|
|
|
+ #{status}
|
|
|
+ </foreach>
|
|
|
+ <if test="reportedState == 0">
|
|
|
+ or a.reported_state is null)
|
|
|
+ </if>
|
|
|
+ <if test="reportedState == 1">
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|