|
|
@@ -782,21 +782,21 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
- <select id="findExportList" resultType="RuralProjectRecordsExport" >
|
|
|
+ <select id="findExportList" resultType="RuralProjectRecordsExport" >
|
|
|
+ select * from (
|
|
|
SELECT
|
|
|
- <include refid="projectRecordsColumnss"/>
|
|
|
- ,a.record_state as "recordState"
|
|
|
- ,a.submit_money as "submitMoney"
|
|
|
- ,a.submit_scale as "submitScale"
|
|
|
- ,a.attachment_project_sort as "attachmentProjectSort"
|
|
|
+ <include refid="newProjectRecordsColumns"/>
|
|
|
+ ,wci.contract_num as "workContractInfo.contractNum"
|
|
|
+ ,(select name from sys_user user where user.id=a.create_by) AS "createByName"
|
|
|
+ ,o.name AS "createByOffice"
|
|
|
+ ,sub.name as "projectMasterName"
|
|
|
+ ,(case when a.submit_money = '1' then 'B级' when a.submit_money = '2' then 'A级' else '' end) as submitMoneyStr
|
|
|
,rprr.ZiXunBDE as "ziXunBDE"
|
|
|
- ,(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
|
|
|
+ ,ifnull(prd.review_fee ,"") as "reviewFee"
|
|
|
+ ,ifnull(prd.approval_fee ,"") as "approvalFee"
|
|
|
+ ,ifnull(prd.verify_fee ,"") as "verifyFee"
|
|
|
+ ,ifnull(prd.verify_rate ,"") as "verifyRate"
|
|
|
+
|
|
|
,(case
|
|
|
when a.submit_money = '1' and pfp.status = '5' then
|
|
|
'已归档'
|
|
|
@@ -804,35 +804,38 @@
|
|
|
'已归档' else '未归档'
|
|
|
end) as downArchiveStatus
|
|
|
|
|
|
+ ,prr.accomplish_date as "projectReportRecordAuditDate"
|
|
|
+ ,prd.first_audit_date as "reportAuditDate"
|
|
|
+ ,rprr.accomplish_date as "projectRecordsReportedAuditPassDate"
|
|
|
+ ,prdt.audit_pass_date as "reportTwoAuditDate"
|
|
|
+ ,concat(ifnull( pfp.STATUS, 0 ),ifnull( ppf.STATUS, 0 )) as "downProjectReportRecordPaperFilingStatus"
|
|
|
+ ,su.name as "leaderNameStr"
|
|
|
+ ,su.id as "leaderNameIds"
|
|
|
+ ,a.submit_money as "submitMoney"
|
|
|
,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
|
|
|
+ ,a.project_material_storage_status as "projectMaterialStorageStatus"
|
|
|
+ <choose>
|
|
|
+ <when test="projectReportRecordStatus != null and projectReportRecordStatus != ''">
|
|
|
+ ,ifnull(prr.status,#{projectReportRecordStatus}) as "projectReportRecordStatus"
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ,ifnull(prr.status,0) as "projectReportRecordStatus"
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ ,prr.process_instance_id as prrProcessInstanceId
|
|
|
,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 #{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
|
|
|
@@ -840,55 +843,66 @@
|
|
|
,ifnull(pmdr.status,0) as "defectRecordStatus"
|
|
|
,pmdr.process_instance_id as "pmdrProcessInstanceId"
|
|
|
,pmdr.id as pmdrId
|
|
|
- ,ifnull(ppf.status,0) as "paperFilingStatus"
|
|
|
+
|
|
|
+ ,(case when a.submit_money = '1' then ifnull((case when a.paper_filing_status = '10' then 10 when a.paper_filing_status = '6' then '6' when a.paper_filing_status = '7' then '7' else ifnull(pfp.status,0) end),0) when a.submit_money = '2' then ifnull((case when a.paper_filing_status = '10' then 10 when a.paper_filing_status = '6' then '6' when a.paper_filing_status = '7' then '7' else ifnull(ppf.status,0) end),0) else '' end) as paperFilingStatus
|
|
|
+ ,pfp.audit_pass_date as "filingBatchAuditPassDate"
|
|
|
+ ,pfp.box_num as "filingBoxNum"
|
|
|
+ ,ppf.file_num as "ppfFileNum"
|
|
|
+ /*,ifnull(ppf.status,0) as "paperFilingStatus"*/
|
|
|
,ppf.process_instance_id as "ppfProcessInstanceId"
|
|
|
,ppf.id as "ppfId"
|
|
|
+ ,ppf.audit_pass_date as "paperFilingAuditPassDate"
|
|
|
,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"*/
|
|
|
+ /*,ifnull(pfp.status,0) as "filingProjectStatus"*/
|
|
|
+ ,prd.audit_pass_date as "prdAuditDate"
|
|
|
,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"
|
|
|
- ,(SELECT group_concat( su.NAME ) FROM work_project_user wpu LEFT JOIN sys_user su ON su.id = wpu.user_id WHERE wpu.project_id = a.id ) AS "leaderNameStr",
|
|
|
- (SELECT group_concat( su.id ) FROM work_project_user wpu LEFT JOIN sys_user su ON su.id = wpu.user_id WHERE wpu.project_id = a.id ) AS "leaderNameIds"
|
|
|
+ ,cb.case_process_id as "caseProcessId"
|
|
|
+ ,cb.case_type as "caseType"
|
|
|
+ ,cb.case_create_by as "caseCreateBy"
|
|
|
+ ,if(case_status > 0 ,case_status,"0") as "caseStatus"
|
|
|
+ ,a.paper_filing_status as "apaperFilingStatus"
|
|
|
+ ,a.over_paper_filing_status as "overPaperFilingStatus"
|
|
|
+ ,rprr.accomplish_date AS "accomplishDate"
|
|
|
FROM rural_project_records a
|
|
|
LEFT JOIN sys_area area ON area.id = a.area_id
|
|
|
+ LEFT JOIN sys_user sub on a.project_master_id = sub.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 case_base cb on a.id = cb.project_id
|
|
|
+ /*LEFT JOIN project_flingbatch_relation pfp on pfp.project_id=a.id*/
|
|
|
+ left join
|
|
|
+ (select id,status,project_id,filing_batch,audit_pass_date,box_num from
|
|
|
+ (
|
|
|
+ select id,create_date,status,project_id,filing_batch,audit_pass_date,box_num
|
|
|
+ from project_flingbatch_relation order by create_date desc
|
|
|
+ )z
|
|
|
+ group by z.project_id
|
|
|
+ ) 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="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 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 sys_user su on w1.user_id = su.id
|
|
|
+ LEFT JOIN sys_user suMaster on a.project_master_id = suMaster.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 project_report_data_two prdt on prdt.project_id = a.id and prdt.del_flag = 0
|
|
|
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
|
|
|
+ <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="projectId != null and projectId != ''">
|
|
|
AND a.project_id like concat('%',#{projectId},'%')
|
|
|
</if>
|
|
|
@@ -913,7 +927,6 @@
|
|
|
<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 (area.parent_ids LIKE
|
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
|
@@ -940,30 +953,179 @@
|
|
|
<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 !=''">
|
|
|
+ <!--<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>-->
|
|
|
+ <if test="(leaderNameStr != null and leaderNameStr != '') or (leaderId != null and leaderId != '')">
|
|
|
+ AND ((w1.user_id = #{leaderId}) or su.name like concat('%',#{leaderNameStr},'%')) AND w1.is_master = '1' AND w1.del_flag='0'
|
|
|
+ </if>
|
|
|
+ <if test="(projectMasterName != null and projectMasterName != '') or (projectMasterId != null and projectMasterId != '')">
|
|
|
+ AND ((a.project_master_id = #{projectMasterId}) or suMaster.name like concat('%',#{projectMasterName},'%')) AND suMaster.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="beginSubmitScale !=null and beginSubmitScale != ''">
|
|
|
+ AND a.submit_scale >= #{beginSubmitScale}
|
|
|
+ </if>
|
|
|
+ <if test="endSubmitScale !=null and endSubmitScale != ''">
|
|
|
+ AND a.submit_scale < #{endSubmitScale}
|
|
|
+ </if>
|
|
|
+ <!-- 质量复核审核时间 -->
|
|
|
+ <if test="reportBeginDate !=null">
|
|
|
+ AND prd.audit_pass_date >= #{reportBeginDate}
|
|
|
+ </if>
|
|
|
+ <if test="reportEndDate !=null">
|
|
|
+ AND prd.audit_pass_date <= #{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 <= #{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 <= #{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 <= #{paperRecordEndDate}
|
|
|
+ or ppf.audit_pass_date <= #{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 <= #{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>
|
|
|
- <if test="endDate !=null">
|
|
|
- AND a.create_date < #{endDate}
|
|
|
- </if>
|
|
|
- <if test="projectType !=null and projectType !=''">
|
|
|
- and project_type= #{projectType}
|
|
|
- </if>
|
|
|
<if test="engineeringType !=null and engineeringType !=''">
|
|
|
and a.engineering_type= #{engineeringType}
|
|
|
</if>
|
|
|
+
|
|
|
+ <if test="bzshbUserId!=null and bzshbUserId!=''">
|
|
|
+ and prd.bzshb_user_id=#{bzshbUserId}
|
|
|
+ </if>
|
|
|
+ <if test="projectMaterialStorageStatus !=null and projectMaterialStorageStatus!=''">
|
|
|
+ AND a.project_material_storage_status= #{projectMaterialStorageStatus}
|
|
|
+ </if>
|
|
|
+ <if test="emergencyProject !=null and emergencyProject != ''">
|
|
|
+ <choose>
|
|
|
+ <when test="emergencyProject == 0">
|
|
|
+ AND (a.emergency_project = #{emergencyProject} or a.emergency_project is null)
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND a.emergency_project = #{emergencyProject}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </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="downProjectReportRecordStatus == 0">
|
|
|
+ <choose>
|
|
|
+ <when test="submitMoney !=null and submitMoney !=''">
|
|
|
+ <if test="submitMoney == 1">
|
|
|
+ AND( pfp.status is null)
|
|
|
+ </if>
|
|
|
+ <if test="submitMoney == 2">
|
|
|
+ AND( /*pfp.status is null or*/ ppf.status is null )
|
|
|
+ </if>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <if test="downProjectReportRecordStatus!=null and downProjectReportRecordStatus !=''">
|
|
|
+ <choose>
|
|
|
+ <when test="submitMoney !=null and submitMoney !=''">
|
|
|
+ <if test="submitMoney == 1">
|
|
|
+ <choose>
|
|
|
+ <when test="downProjectReportRecordStatus == 10">
|
|
|
+ and a.paper_filing_status = #{downProjectReportRecordStatus}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and pfp.status = #{downProjectReportRecordStatus}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="submitMoney == 2">
|
|
|
+ <choose>
|
|
|
+ <when test="downProjectReportRecordStatus == 10 or downProjectReportRecordStatus == 6">
|
|
|
+ and a.paper_filing_status = #{downProjectReportRecordStatus}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and ppf.status = #{downProjectReportRecordStatus}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+
|
|
|
+ </if>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ <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="reportData!=null and reportData.number !=null and reportData.number !=''">
|
|
|
+ and prd.number like concat('%',#{reportData.number},'%')
|
|
|
+ </if>
|
|
|
<!--<if test="office!=null and office.id!=null and office.id!=''">
|
|
|
and a.office_id = #{office.id}
|
|
|
</if>-->
|
|
|
+ <if test="office!=null and office.id=='' and office.name!=null and office.name!='' ">
|
|
|
+ and o.name like concat('%',#{office.name},'%')
|
|
|
+ </if>
|
|
|
+
|
|
|
<if test="officeIdList!=null and officeIdList.size!=0">
|
|
|
and a.office_id in
|
|
|
<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
|
|
|
@@ -971,39 +1133,141 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
|
|
|
- <if test="reportData!=null and reportData.number !=null and reportData.number !=''">
|
|
|
- and prd.number like concat('%',#{reportData.number},'%')
|
|
|
+ <if test="reportedState !=null and reportedState !=''">
|
|
|
+ <choose>
|
|
|
+ <when test="reportedState == 0">
|
|
|
+ AND a.reported_state is null
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND a.reported_state = #{reportedState}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
- <if test="filingProjectStatus!=null and filingProjectStatus !=''">
|
|
|
- and pfp.status =${filingProjectStatus}
|
|
|
+
|
|
|
+
|
|
|
+ <if test="projectReportStatus != null and projectReportStatus != ''">
|
|
|
+ AND prd.status = #{projectReportStatus}
|
|
|
</if>
|
|
|
- <if test="submitMoney!=null and submitMoney !=''">
|
|
|
- and a.submit_money =${submitMoney}
|
|
|
+ <if test="submitMoney != null and submitMoney != ''">
|
|
|
+ AND a.submit_money = #{submitMoney}
|
|
|
</if>
|
|
|
- <if test="createBy !=null and createBy !=''">
|
|
|
- <if test="createBy.name !=null and createBy.name !=''">
|
|
|
- AND sua.name like concat(concat('%',#{createBy.name}),'%')
|
|
|
- </if>
|
|
|
+ <choose>
|
|
|
+ <when test="projectReportRecordStatus != null and projectReportRecordStatus != '' and projectReportRecordStatus != 0">
|
|
|
+ <choose>
|
|
|
+ <when test="projectReportRecordStatus == 6 or projectReportRecordStatus == 7">
|
|
|
+ <choose>
|
|
|
+ <when test="projectReportRecordStatus == 6">
|
|
|
+ AND a.record_state= #{projectReportRecordStatus} and prr.status is null
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND prr.status = #{projectReportRecordStatus}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND prr.status = #{projectReportRecordStatus}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <choose>
|
|
|
+ <when test="projectReportRecordStatus == 0">
|
|
|
+ AND prr.status is null
|
|
|
+ </when>
|
|
|
+ </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>
|
|
|
- <if test="office!=null and office.name!=null and office.name!=''">
|
|
|
- AND o.name like concat(concat('%',#{office.name}),'%')
|
|
|
+ <choose>
|
|
|
+ <when test="projectReportStatusTwo == 0">
|
|
|
+ AND prdt.status is null
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <if test="projectReportStatusTwo!=null and projectReportStatusTwo !=''">
|
|
|
+ AND prdt.status = #{projectReportStatusTwo}
|
|
|
+ </if>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+
|
|
|
+ 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>
|
|
|
- <if test="sqlMap.delFlag !=null and sqlMap.delFlag!=''">
|
|
|
- ${sqlMap.delFlag}
|
|
|
- </if>
|
|
|
- <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>
|
|
|
- GROUP BY a.id
|
|
|
<choose>
|
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
ORDER BY ${page.orderBy}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- ORDER BY a.update_date DESC
|
|
|
+ ORDER BY SUBSTRING(a.project_id,6,4) DESC,cast( SUBSTRING(a.project_id,11) as UNSIGNED) DESC
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
+ ) temporarydb
|
|
|
+ <where>
|
|
|
+ 1=1
|
|
|
+ <choose>
|
|
|
+ <when test="downProjectReportRecordStatus == 0">
|
|
|
+ <choose>
|
|
|
+ <when test="submitMoney !=null and submitMoney !=''">
|
|
|
+ <if test="submitMoney == 1">
|
|
|
+ AND( temporarydb.downProjectReportRecordPaperFilingStatus = '00')
|
|
|
+ </if>
|
|
|
+ <if test="submitMoney == 2">
|
|
|
+ AND( temporarydb.downProjectReportRecordPaperFilingStatus = '00')
|
|
|
+ </if>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND( temporarydb.downProjectReportRecordPaperFilingStatus = '00')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <if test="downProjectReportRecordStatus!=null and downProjectReportRecordStatus !=''">
|
|
|
+ <choose>
|
|
|
+ <when test="submitMoney !=null and submitMoney !=''">
|
|
|
+ <if test="submitMoney == 1">
|
|
|
+ <choose>
|
|
|
+ <when test="downProjectReportRecordStatus == 10">
|
|
|
+ and temporarydb.apaperFilingStatus = #{downProjectReportRecordStatus}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and (temporarydb.downProjectReportRecordPaperFilingStatus like concat(#{downProjectReportRecordStatus},'%'))
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="submitMoney == 2">
|
|
|
+ <choose>
|
|
|
+ <when test="downProjectReportRecordStatus == 10 or downProjectReportRecordStatus == 6">
|
|
|
+ and temporarydb.apaperFilingStatus = #{downProjectReportRecordStatus}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and ( temporarydb.downProjectReportRecordPaperFilingStatus like concat('%',#{downProjectReportRecordStatus}))
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <choose>
|
|
|
+ <when test="downProjectReportRecordStatus == 10 or downProjectReportRecordStatus == 6 or downProjectReportRecordStatus == 7">
|
|
|
+ and temporarydb.apaperFilingStatus = #{downProjectReportRecordStatus}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND( temporarydb.downProjectReportRecordPaperFilingStatus like concat('%',#{downProjectReportRecordStatus},'%'))
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+
|
|
|
+ </if>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
|
|
|
<select id="queryCount" resultType="int" >
|