|
@@ -646,12 +646,15 @@
|
|
|
ifnull((select sum(wir.money) from work_invoice_receipt wir where wir.invoice_id = a.id ),0) as "receiptMoneyD"
|
|
|
FROM work_invoice a
|
|
|
LEFT JOIN sys_user su ON su.id = a.create_by
|
|
|
- LEFT JOIN work_client_info w ON w.id = a.client_id
|
|
|
- LEFT JOIN rural_project_records p ON p.id = a.project_id
|
|
|
+ LEFT JOIN work_client_info w ON w.id = a.client_id
|
|
|
LEFT JOIN sys_user sua ON sua.id = a.account_checking_user_id
|
|
|
- left join work_invoice_detail wid on a.id = wid.invoice_id
|
|
|
- LEFT join sys_office so on so.id = a.office_id
|
|
|
- left join work_invoice_receipt wir on wir.invoice_id = a.id
|
|
|
+ LEFT JOIN work_invoice_detail wid ON a.id = wid.invoice_id
|
|
|
+ LEFT JOIN sys_office so ON so.id = a.office_id
|
|
|
+ LEFT JOIN work_invoice_receipt wir ON wir.invoice_id = a.id
|
|
|
+ left join work_invoice_project_relation wipr on wipr.invoice_id = a.id
|
|
|
+ left join work_invoice_project_relation wiprd on wiprd.invoice_id = a.id
|
|
|
+ LEFT JOIN rural_project_records p ON p.id = wipr.project_id
|
|
|
+ LEFT JOIN project_report_data prds ON p.id = prds.project_id
|
|
|
<where>
|
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
<if test="widNumber != null and widNumber != ''">
|
|
@@ -720,10 +723,15 @@
|
|
|
AND a.billing_content = #{billingContent}
|
|
|
</if>
|
|
|
<if test="projectName != null and projectName != ''">
|
|
|
- AND rpr.project_name LIKE
|
|
|
+ AND (p.project_name LIKE
|
|
|
<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
|
|
|
<if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
|
|
|
<if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
|
|
|
+ or wiprd.details LIKE
|
|
|
+ <if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
|
|
|
+ <if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
|
|
|
+ <if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
|
|
|
+ )
|
|
|
</if>
|
|
|
<if test="reportNumber != null and reportNumber != ''">
|
|
|
and prds.number like
|
|
@@ -750,11 +758,15 @@
|
|
|
SELECT count((a.id))
|
|
|
FROM work_invoice a
|
|
|
LEFT JOIN sys_user su ON su.id = a.create_by
|
|
|
- LEFT JOIN work_client_info w ON w.id = a.client_id
|
|
|
- LEFT JOIN rural_project_records p ON p.id = a.project_id
|
|
|
+ LEFT JOIN work_client_info w ON w.id = a.client_id
|
|
|
LEFT JOIN sys_user sua ON sua.id = a.account_checking_user_id
|
|
|
- left join work_invoice_detail wid on a.id = wid.invoice_id
|
|
|
- left join work_invoice_receipt wir on wir.invoice_id = a.id
|
|
|
+ LEFT JOIN work_invoice_detail wid ON a.id = wid.invoice_id
|
|
|
+ LEFT JOIN sys_office so ON so.id = a.office_id
|
|
|
+ LEFT JOIN work_invoice_receipt wir ON wir.invoice_id = a.id
|
|
|
+ left join work_invoice_project_relation wipr on wipr.invoice_id = a.id
|
|
|
+ left join work_invoice_project_relation wiprd on wiprd.invoice_id = a.id
|
|
|
+ LEFT JOIN rural_project_records p ON p.id = wipr.project_id
|
|
|
+ LEFT JOIN project_report_data prds ON p.id = prds.project_id
|
|
|
<where>
|
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
<if test="widNumber != null and widNumber != ''">
|
|
@@ -821,10 +833,15 @@
|
|
|
AND a.billing_content = #{billingContent}
|
|
|
</if>
|
|
|
<if test="projectName != null and projectName != ''">
|
|
|
- AND rpr.project_name LIKE
|
|
|
+ AND (p.project_name LIKE
|
|
|
<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
|
|
|
<if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
|
|
|
<if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
|
|
|
+ or wiprd.details LIKE
|
|
|
+ <if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
|
|
|
+ <if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
|
|
|
+ <if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
|
|
|
+ )
|
|
|
</if>
|
|
|
<if test="reportNumber != null and reportNumber != ''">
|
|
|
and prds.number like
|