|
@@ -44,7 +44,10 @@
|
|
|
a.install_unit_fees AS "installUnitFees",
|
|
|
a.total_fees AS "totalFees",
|
|
|
ifnull(a.reported_state,0) as "reportedState",
|
|
|
- a.over_due_status as "overDueStatus"
|
|
|
+ a.over_due_status as "overDueStatus",
|
|
|
+ ifnull(a.record_state,0) as "projectRecordStatus",
|
|
|
+ a.over_record_status as "overRecordStatus",
|
|
|
+ a.emergency_project as "emergencyProject"
|
|
|
</sql>
|
|
|
|
|
|
|
|
@@ -92,9 +95,9 @@
|
|
|
|
|
|
<select id="findList" resultType="RuralProjectRecords" >
|
|
|
SELECT
|
|
|
- <include refid="projectRecordsColumns"/>
|
|
|
- ,
|
|
|
- a.project_type as projectType,
|
|
|
+ <include refid="projectRecordsColumns"/>
|
|
|
+ ,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",
|
|
@@ -104,7 +107,7 @@
|
|
|
,ifnull(prd.name,"") as "projectReportName"
|
|
|
,ifnull(prr.status,0) as "projectReportRecordStatus"
|
|
|
,ifnull(prrd.status,0) as "downProjectReportRecordStatus",
|
|
|
- prrd.file_num as recodeNum,
|
|
|
+ prrd.file_num as recodeNum,
|
|
|
prr.process_instance_id as prrProcessInstanceId,
|
|
|
prrd.process_instance_id as prrdProcessInstanceId
|
|
|
,prd.id as prdId
|
|
@@ -125,15 +128,15 @@
|
|
|
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
|
|
|
-
|
|
|
- <if test="leaderNameStr !=null and 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 work_project_user w1 on a.id = w1.project_id
|
|
|
+ LEFT JOIN sys_user sua on a.create_by = sua.id
|
|
|
+ <if test="leaderNameStr !=null and 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 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 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
|
|
@@ -141,6 +144,9 @@
|
|
|
left join rural_project_report_record_down prrd on prrd.report_id = prd.id
|
|
|
<where>
|
|
|
a.status = 5
|
|
|
+ <if test="bzshbUserId!=null and bzshbUserId!=''">
|
|
|
+ and prd.bzshb_user_id=#{bzshbUserId}
|
|
|
+ </if>
|
|
|
<if test="projectId != null and projectId != ''">
|
|
|
AND a.project_id like concat('%',#{projectId},'%')
|
|
|
</if>
|
|
@@ -183,8 +189,11 @@
|
|
|
<if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
|
|
|
AND wct.name like concat(concat('%',#{workContractInfo.client.name}),'%')
|
|
|
</if>
|
|
|
- <if test="leaderNameStr !=null and leaderNameStr !=''">
|
|
|
- AND su.name like concat(concat('%',#{leaderNameStr}),'%') AND w.is_master = '1' AND w.del_flag='0'
|
|
|
+ <!--<if test="leaderNameStr !=null and leaderNameStr !=''">
|
|
|
+ AND su.name like concat(concat('%',#{leaderNameStr}),'%') AND w.is_master = '1' AND w.del_flag='0'
|
|
|
+ </if>-->
|
|
|
+ <if test="(leaderNameStr != null and leaderNameStr != '') or (leaderId != null and leaderId != '')">
|
|
|
+ AND ((w.user_id = #{leaderId}) or su.name like concat('%',#{leaderNameStr},'%')) AND w.is_master = '1' AND w.del_flag='0'
|
|
|
</if>
|
|
|
<if test="projectStatus !=null">
|
|
|
AND a.status = #{projectStatus}
|
|
@@ -195,11 +204,11 @@
|
|
|
<if test="endDate !=null">
|
|
|
AND a.create_date < #{endDate}
|
|
|
</if>
|
|
|
- <if test="createBy != null and createBy.id !=null and createBy.id !=''">
|
|
|
+ <!--<if test="createBy != null and createBy.id !=null and createBy.id !=''">
|
|
|
AND a.create_by = #{createBy.id}
|
|
|
- </if>
|
|
|
- <if test="bzshbUserId!=null and bzshbUserId!=''">
|
|
|
- and prd.bzshb_user_id=#{bzshbUserId}
|
|
|
+ </if>-->
|
|
|
+ <if test="createBy != null and((createBy.id != null and createBy.id != '') or (createBy.name != null and createBy.name != ''))">
|
|
|
+ AND (a.create_by = #{createBy.id} or sua.name like concat('%',#{createBy.name},'%'))
|
|
|
</if>
|
|
|
<choose>
|
|
|
<when test="filingProjectStatus == 0">
|
|
@@ -217,15 +226,14 @@
|
|
|
<!--<if test="office!=null and office.id!=null and office.id!=''">
|
|
|
and a.office_id = #{office.id}
|
|
|
</if>-->
|
|
|
+
|
|
|
<if test="officeIdList!=null and officeIdList.size!=0">
|
|
|
and a.office_id in
|
|
|
<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
|
|
|
#{officeId}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="projectReportStatus != null and projectReportStatus != ''">
|
|
|
- AND prd.status = #{projectReportStatus}
|
|
|
- </if>
|
|
|
+
|
|
|
<if test="reportedState !=null and reportedState !=''">
|
|
|
<choose>
|
|
|
<when test="reportedState == 0">
|
|
@@ -237,6 +245,13 @@
|
|
|
</choose>
|
|
|
</if>
|
|
|
|
|
|
+
|
|
|
+ <if test="projectReportStatus != null and projectReportStatus != ''">
|
|
|
+ AND prd.status = #{projectReportStatus}
|
|
|
+ </if>
|
|
|
+ <if test="submitMoney != null and submitMoney != ''">
|
|
|
+ AND a.submit_money = #{submitMoney}
|
|
|
+ </if>
|
|
|
<choose>
|
|
|
<when test="projectReportRecordStatus != null and projectReportRecordStatus != '' and projectReportRecordStatus != 0">
|
|
|
AND prr.status = #{projectReportRecordStatus}
|
|
@@ -249,6 +264,13 @@
|
|
|
</choose>
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
+
|
|
|
+ <if test="typeList !=null and typeList !=''">
|
|
|
+ and a.project_type in
|
|
|
+ <foreach collection="typeList" item="id" index="index" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<choose>
|
|
|
<when test="projectReportStatusTwo == 0">
|
|
|
AND prdt.status is null
|
|
@@ -259,12 +281,6 @@
|
|
|
</if>
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
- <if test="typeList !=null and typeList !=''">
|
|
|
- and project_type in
|
|
|
- <foreach collection="typeList" item="id" index="index" open="(" close=")" separator=",">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
|
|
|
AND a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
|
|
@@ -282,89 +298,97 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryCount" resultType="int" >
|
|
|
- SELECT count(DISTINCT a.id)
|
|
|
- FROM rural_project_records a
|
|
|
+ SELECT count(DISTINCT a.id)
|
|
|
+ FROM rural_project_records a
|
|
|
|
|
|
- <if test="leaderNameStr !=null and 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 work_project_user w1 on a.id = w1.project_id
|
|
|
- <if test="workContractInfo !=null">
|
|
|
- LEFT JOIN work_contract_info wci on a.contract_id = wci.id
|
|
|
- </if>
|
|
|
- <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
|
|
|
- LEFT JOIN work_client_info wct on wci.client_id = wct.id
|
|
|
- </if>
|
|
|
+ <if test="leaderNameStr !=null and 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 work_project_user w1 on a.id = w1.project_id
|
|
|
+ <if test="workContractInfo !=null">
|
|
|
+ LEFT JOIN work_contract_info wci on a.contract_id = wci.id
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
|
|
|
+ LEFT JOIN work_client_info wct on wci.client_id = wct.id
|
|
|
+ </if>
|
|
|
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_flingbatch_relation pfp on pfp.project_id= a.id
|
|
|
+ LEFT JOIN sys_user sua on a.create_by = sua.id
|
|
|
|
|
|
<where>
|
|
|
- a.status = 5
|
|
|
- <if test="projectId != null and projectId != ''">
|
|
|
- AND a.project_id like concat('%',#{projectId},'%')
|
|
|
- </if>
|
|
|
- <if test="projectName != null and projectName != ''">
|
|
|
- AND a.project_name like concat(concat('%',#{projectName}),'%')
|
|
|
- </if>
|
|
|
- <if test="scaleType != null and scaleType != ''">
|
|
|
- AND a.scale_type = #{scaleType}
|
|
|
- </if>
|
|
|
- <if test="scaleUnit != null and scaleUnit != ''">
|
|
|
- AND a.scale_unit = #{scaleUnit}
|
|
|
- </if>
|
|
|
- <if test="scaleQuantity != null and scaleQuantity != ''">
|
|
|
- AND a.scale_quantity = #{scaleQuantity}
|
|
|
- </if>
|
|
|
- <if test="projectSite != null and projectSite != ''">
|
|
|
- AND a.project_site LIKE concat('%',#{projectSite},'%')
|
|
|
- </if>
|
|
|
- <if test="remarks != null and remarks != ''">
|
|
|
- AND a.remarks LIKE concat('%',#{remarks},'%')
|
|
|
- </if>
|
|
|
- <if test="projectDesc != null and projectDesc != ''">
|
|
|
- AND a.project_desc LIKE concat('%',#{projectDesc},'%')
|
|
|
- </if>
|
|
|
- <if test="area != null and area.id != null and area.id != ''">
|
|
|
- AND a.area_id = #{area.id}
|
|
|
- </if>
|
|
|
- <if test="workContractInfo !=null and workContractInfo.name !=null and workContractInfo.name !=''">
|
|
|
- AND wci.name like concat(concat('%',#{workContractInfo.name}),'%')
|
|
|
- </if>
|
|
|
- <if test="workContractInfo !=null and workContractInfo.contractNum !=null and workContractInfo.contractNum !=''">
|
|
|
- AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
|
|
|
- </if>
|
|
|
- <if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
|
|
|
- AND wci.contract_price = #{workContractInfo.contractPrice}
|
|
|
- </if>
|
|
|
- <if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
|
|
|
- AND wci.contract_type = #{workContractInfo.contractType}
|
|
|
- </if>
|
|
|
- <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
|
|
|
- AND wct.name like concat(concat('%',#{workContractInfo.client.name}),'%')
|
|
|
- </if>
|
|
|
- <if test="leaderNameStr !=null and leaderNameStr !=''">
|
|
|
- AND su.name like concat(concat('%',#{leaderNameStr}),'%') AND w.is_master = '1' AND w.del_flag='0'
|
|
|
- </if>
|
|
|
- <if test="projectStatus !=null">
|
|
|
- AND a.status = #{projectStatus}
|
|
|
- </if>
|
|
|
- <if test="beginDate !=null">
|
|
|
- AND a.create_date >= #{beginDate}
|
|
|
- </if>
|
|
|
- <if test="endDate !=null">
|
|
|
- AND a.create_date < #{endDate}
|
|
|
- </if>
|
|
|
- <if test="createBy != null and createBy.id !=null and createBy.id !=''">
|
|
|
- AND a.create_by = #{createBy.id}
|
|
|
- </if>
|
|
|
+ a.status = 5
|
|
|
<if test="bzshbUserId!=null and bzshbUserId!=''">
|
|
|
and prd.bzshb_user_id=#{bzshbUserId}
|
|
|
</if>
|
|
|
+ <if test="projectId != null and projectId != ''">
|
|
|
+ AND a.project_id like concat('%',#{projectId},'%')
|
|
|
+ </if>
|
|
|
+ <if test="projectName != null and projectName != ''">
|
|
|
+ AND a.project_name like concat(concat('%',#{projectName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="scaleType != null and scaleType != ''">
|
|
|
+ AND a.scale_type = #{scaleType}
|
|
|
+ </if>
|
|
|
+ <if test="scaleUnit != null and scaleUnit != ''">
|
|
|
+ AND a.scale_unit = #{scaleUnit}
|
|
|
+ </if>
|
|
|
+ <if test="scaleQuantity != null and scaleQuantity != ''">
|
|
|
+ AND a.scale_quantity = #{scaleQuantity}
|
|
|
+ </if>
|
|
|
+ <if test="projectSite != null and projectSite != ''">
|
|
|
+ AND a.project_site LIKE concat('%',#{projectSite},'%')
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ AND a.remarks LIKE concat('%',#{remarks},'%')
|
|
|
+ </if>
|
|
|
+ <if test="projectDesc != null and projectDesc != ''">
|
|
|
+ AND a.project_desc LIKE concat('%',#{projectDesc},'%')
|
|
|
+ </if>
|
|
|
+ <if test="area != null and area.id != null and area.id != ''">
|
|
|
+ AND a.area_id = #{area.id}
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.name !=null and workContractInfo.name !=''">
|
|
|
+ AND wci.name like concat(concat('%',#{workContractInfo.name}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractNum !=null and workContractInfo.contractNum !=''">
|
|
|
+ AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
|
|
|
+ AND wci.contract_price = #{workContractInfo.contractPrice}
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
|
|
|
+ AND wci.contract_type = #{workContractInfo.contractType}
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
|
|
|
+ AND wct.name like concat(concat('%',#{workContractInfo.client.name}),'%')
|
|
|
+ </if>
|
|
|
+ <!--<if test="leaderNameStr !=null and leaderNameStr !=''">
|
|
|
+ AND su.name like concat(concat('%',#{leaderNameStr}),'%') AND w.is_master = '1' AND w.del_flag='0'
|
|
|
+ </if>-->
|
|
|
+ <if test="(leaderNameStr != null and leaderNameStr != '') or (leaderId != null and leaderId != '')">
|
|
|
+ AND ((w.user_id = #{leaderId}) or su.name like concat('%',#{leaderNameStr},'%')) AND w.is_master = '1' AND w.del_flag='0'
|
|
|
+ </if>
|
|
|
+ <if test="projectStatus !=null">
|
|
|
+ AND a.status = #{projectStatus}
|
|
|
+ </if>
|
|
|
+ <if test="beginDate !=null">
|
|
|
+ AND a.create_date >= #{beginDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate !=null">
|
|
|
+ AND a.create_date < #{endDate}
|
|
|
+ </if>
|
|
|
+ <!--<if test="createBy != null and createBy.id !=null and createBy.id !=''">
|
|
|
+ AND a.create_by = #{createBy.id}
|
|
|
+ </if>-->
|
|
|
+ <if test="createBy != null and((createBy.id != null and createBy.id != '') or (createBy.name != null and createBy.name != ''))">
|
|
|
+ AND (a.create_by = #{createBy.id} or sua.name like concat('%',#{createBy.name},'%'))
|
|
|
+ </if>
|
|
|
+
|
|
|
<choose>
|
|
|
<when test="filingProjectStatus == 0">
|
|
|
AND pfp.status is null
|
|
@@ -400,7 +424,9 @@
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</if>
|
|
|
-
|
|
|
+ <if test="submitMoney != null and submitMoney != ''">
|
|
|
+ AND a.submit_money = #{submitMoney}
|
|
|
+ </if>
|
|
|
<choose>
|
|
|
<when test="projectReportRecordStatus != null and projectReportRecordStatus != '' and projectReportRecordStatus != 0">
|
|
|
AND prr.status = #{projectReportRecordStatus}
|
|
@@ -424,16 +450,110 @@
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<if test="typeList !=null and typeList !=''">
|
|
|
- and project_type in
|
|
|
+ and a.project_type in
|
|
|
<foreach collection="typeList" item="id" index="index" open="(" close=")" separator=",">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
-
|
|
|
- AND a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
- <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
|
|
|
- AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id})${sqlMap.dsf} )
|
|
|
- </if>
|
|
|
- </where>
|
|
|
+ AND a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
+ <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
|
|
|
+ AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id})${sqlMap.dsf} )
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="findListOnRecordDownload" resultType="RuralProjectRecords" >
|
|
|
+ SELECT
|
|
|
+ <include refid="projectRecordsColumns"/>
|
|
|
+ ,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="recordTypeList !=null and recordTypeList !=''">
|
|
|
+ and (prr.status in
|
|
|
+ <foreach collection="recordTypeList" item="status" index="index" open="(" close=")" separator=",">
|
|
|
+ #{status}
|
|
|
+ </foreach>
|
|
|
+ <if test="projectRecordStatus == 0">
|
|
|
+ or prr.status is null)
|
|
|
+ </if>
|
|
|
+ <if test="projectRecordStatus == 1">
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getProjectMaterialList" resultType="RuralProjectRecords" >
|
|
|
+ select a.id,a.project_name as "projectName"
|
|
|
+ from rural_project_record a
|
|
|
+ left join project_report_data prd on a.id = prd.project_id
|
|
|
+ left join project_material_defect_record pmdr on prd.id = pmdr.report_id
|
|
|
+ <where>
|
|
|
+ <if test="projectIdList!=null and projectIdList.size!=0">
|
|
|
+ and a.id in
|
|
|
+ <foreach collection="projectIdList" item="id" separator="," open="(" close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and pmrd.status = 5
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|