|
@@ -341,74 +341,8 @@
|
|
|
LEFT JOIN act_ru_task d ON fi.proc_ins_id = d.PROC_INST_ID_
|
|
|
LEFT JOIN cw_project_records pr on a.program_id=pr.id
|
|
|
${ew.customSqlSegment}
|
|
|
- ORDER BY
|
|
|
- fi.create_time DESC, cfid.number asc
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findList2" resultMap="BaseResultMap">
|
|
|
- select DISTINCT a.id as 'baseId',
|
|
|
- <include refid="Base_Column_List"></include>,
|
|
|
- su.name as operator,
|
|
|
- so.name as operator_office,
|
|
|
- d.ID_ AS task_id,
|
|
|
- (
|
|
|
- case
|
|
|
- when a.type = '0' then (concat('其他:',a.program_name))
|
|
|
- when a.type = '1' then (select rpr.project_name from cw_project_records rpr where id = a.program_id)
|
|
|
- when a.type = '2' then (select rpr.project_name from cw_project_records rpr where id = (select project_id from cw_project_report where id = a.program_id))
|
|
|
- when a.type = '4' then (select rpr.project_name from cw_project_records rpr where id = a.program_id)
|
|
|
- else '' end
|
|
|
- ) as programName,
|
|
|
-
|
|
|
- (
|
|
|
- case
|
|
|
- when a.type = '0' then (fi.report_type)
|
|
|
- when a.type = '1' then (select rpr.report_type from cw_project_records rpr where id = a.program_id)
|
|
|
- when a.type = '4' then (select rpr.report_type from cw_project_records rpr where id = a.program_id)
|
|
|
- when a.type = '2' then (select rpr.report_type from cw_project_records rpr where id = (select project_id from cw_project_report where id = a.program_id))
|
|
|
- else '' end
|
|
|
- ) as reportType,
|
|
|
- (
|
|
|
- case
|
|
|
- when a.type = '0' then ("")
|
|
|
- when a.type = '1' then (select rpr.project_classification from cw_project_records rpr where id = a.program_id)
|
|
|
- when a.type = '4' then (select rpr.project_classification from cw_project_records rpr where id = a.program_id)
|
|
|
- when a.type = '2' then (select rpr.project_classification from cw_project_records rpr where id = (select project_id from cw_project_report where id = a.program_id))
|
|
|
- else '' end
|
|
|
- ) as projectClassification,
|
|
|
- (
|
|
|
- CASE WHEN a.type = '0' THEN ( "")
|
|
|
- WHEN a.type = '1' THEN ( select GROUP_CONCAT(cprnlz.report_no) from cw_project_report cprz
|
|
|
- left join cw_project_report_new_line cprnlz on cprz.id = cprnlz.report_id
|
|
|
- left join cw_project_records cprsz on cprz.project_id= cprsz.id
|
|
|
- where cprsz.id = a.program_id )
|
|
|
- WHEN a.type = '2' THEN (
|
|
|
- select cprnlz.report_no from cw_project_report cprz
|
|
|
- left join cw_project_report_new_line cprnlz on cprz.id = cprnlz.report_id
|
|
|
- where cprz.id = a.program_id)
|
|
|
- WHEN a.type = '4' THEN ( select GROUP_CONCAT(cprnlz.report_no) from cw_project_report cprz
|
|
|
- left join cw_project_report_new_line cprnlz on cprz.id = cprnlz.report_id
|
|
|
- left join cw_project_records cprsz on cprz.project_id= cprsz.id
|
|
|
- where cprsz.id = a.program_id )ELSE ''
|
|
|
- END
|
|
|
- ) AS reportNos,
|
|
|
- cfid.number as "number",
|
|
|
- ifnull(cfid.account,"0") as "accountDetail",
|
|
|
- a.program_id,
|
|
|
- pr.is_pre_invoice as isPreInvoice,
|
|
|
- a.type as 'recordType'
|
|
|
- from cw_finance_invoice_base a
|
|
|
- left join cw_finance_invoice fi on a.invoice_id = fi.id
|
|
|
- left join cw_finance_invoice_detail cfid on cfid.invoice_id = fi.id and cfid.del_flag = '0'
|
|
|
- left join sys_user su on fi.create_by_id = su.id and su.del_flag = '0'
|
|
|
- left join sys_user su1 on fi.reconciliation_people = su1.id and su1.del_flag = '0'
|
|
|
- left join sys_user_manage_office sumo on sumo.office_id = su.office_id
|
|
|
- left join sys_office so on su.office_id = so.id and so.del_flag = '0'
|
|
|
- LEFT JOIN act_ru_task d ON fi.proc_ins_id = d.PROC_INST_ID_
|
|
|
- LEFT JOIN cw_project_records pr on a.program_id=pr.id
|
|
|
- ${ew.customSqlSegment}
|
|
|
- ORDER BY
|
|
|
- fi.billing_date DESC
|
|
|
+-- ORDER BY
|
|
|
+-- fi.create_time DESC, cfid.number asc
|
|
|
</select>
|
|
|
|
|
|
<select id="findExportList" resultMap="BaseExportResultMap">
|