|
@@ -283,6 +283,7 @@
|
|
when a.type = '0' then (concat('其他:',a.program_name))
|
|
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 = '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 = '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
|
|
else '' end
|
|
) as programName,
|
|
) as programName,
|
|
|
|
|
|
@@ -290,6 +291,7 @@
|
|
case
|
|
case
|
|
when a.type = '0' then (fi.report_type)
|
|
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 = '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))
|
|
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
|
|
else '' end
|
|
) as reportType,
|
|
) as reportType,
|
|
@@ -297,6 +299,7 @@
|
|
case
|
|
case
|
|
when a.type = '0' then ("")
|
|
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 = '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))
|
|
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
|
|
else '' end
|
|
) as projectClassification,
|
|
) as projectClassification,
|
|
@@ -309,7 +312,11 @@
|
|
WHEN a.type = '2' THEN (
|
|
WHEN a.type = '2' THEN (
|
|
select cprnlz.report_no from cw_project_report cprz
|
|
select 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_report_new_line cprnlz on cprz.id = cprnlz.report_id
|
|
- where cprz.id = a.program_id) ELSE ''
|
|
|
|
|
|
+ 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
|
|
END
|
|
) AS reportNos,
|
|
) AS reportNos,
|
|
cfid.number as "number",
|
|
cfid.number as "number",
|
|
@@ -343,6 +350,7 @@
|
|
when a.type = '0' then (concat('其他:',a.program_name))
|
|
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 = '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 = '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
|
|
else '' end
|
|
) as programName,
|
|
) as programName,
|
|
|
|
|
|
@@ -351,13 +359,15 @@
|
|
when a.type = '0' then (fi.report_type)
|
|
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 = '1' 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))
|
|
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
|
|
|
|
|
|
+ when a.type = '4' then (select rpr.report_type from cw_project_records rpr where id = a.program_id)
|
|
|
|
+ else '' end
|
|
) as reportType,
|
|
) as reportType,
|
|
(
|
|
(
|
|
case
|
|
case
|
|
when a.type = '0' then ("")
|
|
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 = '1' 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))
|
|
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))
|
|
|
|
+ when a.type = '4' then (select rpr.project_classification from cw_project_records rpr where id = a.program_id)
|
|
else '' end
|
|
else '' end
|
|
) as projectClassification,
|
|
) as projectClassification,
|
|
(
|
|
(
|
|
@@ -369,7 +379,9 @@
|
|
WHEN a.type = '2' THEN (
|
|
WHEN a.type = '2' THEN (
|
|
select cprnlz.report_no from cw_project_report cprz
|
|
select 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_report_new_line cprnlz on cprz.id = cprnlz.report_id
|
|
- where cprz.id = a.program_id) ELSE ''
|
|
|
|
|
|
+ where cprz.id = a.program_id)
|
|
|
|
+ WHEN a.type = '4' THEN ("")
|
|
|
|
+ ELSE ''
|
|
END
|
|
END
|
|
) AS reportNos,
|
|
) AS reportNos,
|
|
cfid.number as "number",
|
|
cfid.number as "number",
|
|
@@ -377,10 +389,9 @@
|
|
a.program_id,
|
|
a.program_id,
|
|
a.type as 'recordType',
|
|
a.type as 'recordType',
|
|
(case when a.type = '1' then (select pr.is_pre_invoice from cw_project_records pr where pr.id = a.program_id)
|
|
(case when a.type = '1' then (select pr.is_pre_invoice from cw_project_records pr where pr.id = a.program_id)
|
|
- else '' end ) as isPreInvoice,
|
|
|
|
- (case when a.type = '1' then
|
|
|
|
- (select SUBSTR(GROUP_CONCAT( pr.is_complete_invoice),1,1 ) from cw_project_report pr where pr.project_id = a.program_id)
|
|
|
|
- else '' end) as isCompleteInvoice
|
|
|
|
|
|
+ when a.type = '2' then (select rpr.is_pre_invoice 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 pr.is_pre_invoice from cw_project_records pr where pr.id = a.program_id)
|
|
|
|
+ else '' end ) as isPreInvoice
|
|
from cw_finance_invoice_base a
|
|
from cw_finance_invoice_base a
|
|
left join cw_finance_invoice fi on a.invoice_id = fi.id
|
|
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 cw_finance_invoice_detail cfid on cfid.invoice_id = fi.id and cfid.del_flag = '0'
|
|
@@ -566,4 +577,22 @@
|
|
left join sys_user su on fi.create_by_id = su.id
|
|
left join sys_user su on fi.create_by_id = su.id
|
|
${ew.customSqlSegment}
|
|
${ew.customSqlSegment}
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <select id="getByNo" resultType="com.jeeplus.finance.invoice.domain.CwFinanceInvoiceBase">
|
|
|
|
+ select
|
|
|
|
+ DISTINCT
|
|
|
|
+ <include refid="FIB_Column_List"></include>
|
|
|
|
+ from cw_finance_invoice fi
|
|
|
|
+ left join cw_finance_invoice_base fib on fib.invoice_id = fi.id
|
|
|
|
+ where fi.no = #{invoiceNumber}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getCountByNo" resultType="integer">
|
|
|
|
+ SELECT COUNT(*)
|
|
|
|
+ FROM cw_finance_invoice fi
|
|
|
|
+ LEFT JOIN cw_project_report pr ON pr.invoice_number = fi.no AND pr.del_flag = '0'
|
|
|
|
+ LEFT JOIN cw_project_records cpr ON cpr.id = pr.project_id AND cpr.del_flag = '0'
|
|
|
|
+ WHERE fi.no = #{no} AND cpr.is_pre_invoice = '1';
|
|
|
|
+ </select>
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|