|
@@ -427,10 +427,12 @@
|
|
AND a.is_invalid = #{isInvalid}
|
|
AND a.is_invalid = #{isInvalid}
|
|
</if>
|
|
</if>
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
- AND a.area_parent_id LIKE
|
|
|
|
|
|
+ AND (a.area_parent_id LIKE
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
|
|
+ or a.area_id = #{area.id}
|
|
|
|
+ )
|
|
</if>
|
|
</if>
|
|
<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
|
|
<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
|
|
@@ -462,6 +464,7 @@
|
|
,wid.number as "widNumber"
|
|
,wid.number as "widNumber"
|
|
,wid.total_money as "widTotalMoney"
|
|
,wid.total_money as "widTotalMoney"
|
|
|
|
|
|
|
|
+ ,sa.name as "accountCheckingArea"
|
|
,ifnull(( SELECT wir.receipt_date FROM work_invoice_receipt wir WHERE wir.invoice_id = a.id ORDER BY wir.receipt_date DESC LIMIT 1 ),a.receipt_money_date) AS "receiptMoneyDate",
|
|
,ifnull(( SELECT wir.receipt_date FROM work_invoice_receipt wir WHERE wir.invoice_id = a.id ORDER BY wir.receipt_date DESC LIMIT 1 ),a.receipt_money_date) AS "receiptMoneyDate",
|
|
ifnull((select sum(wir.money) from work_invoice_receipt wir where wir.invoice_id = a.id ),0) as "receiptMoneyD"
|
|
ifnull((select sum(wir.money) from work_invoice_receipt wir where wir.invoice_id = a.id ),0) as "receiptMoneyD"
|
|
FROM work_invoice a
|
|
FROM work_invoice a
|
|
@@ -479,6 +482,7 @@
|
|
left join project_report_data prds on rpr.id = prds.project_id
|
|
left join project_report_data prds on rpr.id = prds.project_id
|
|
left join work_invoice_detail wid on a.id = wid.invoice_id
|
|
left join work_invoice_detail wid on a.id = wid.invoice_id
|
|
LEFT JOIN sys_user sua ON sua.id = a.account_checking_user_id
|
|
LEFT JOIN sys_user sua ON sua.id = a.account_checking_user_id
|
|
|
|
+ left join sys_area sa on sa.id = a.area_id
|
|
<where>
|
|
<where>
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
<if test="number != null and number != ''">
|
|
<if test="number != null and number != ''">
|
|
@@ -592,10 +596,12 @@
|
|
AND a.billing_content = #{billingContent}
|
|
AND a.billing_content = #{billingContent}
|
|
</if>
|
|
</if>
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
- AND a.area_parent_id LIKE
|
|
|
|
|
|
+ AND (a.area_parent_id LIKE
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
|
|
+ or a.area_id = #{area.id}
|
|
|
|
+ )
|
|
</if>
|
|
</if>
|
|
<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
|
|
<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
|
|
@@ -796,10 +802,12 @@
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
|
|
</if>
|
|
</if>
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
- AND a.area_parent_id LIKE
|
|
|
|
|
|
+ AND (a.area_parent_id LIKE
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
|
|
+ or a.area_id = #{area.id}
|
|
|
|
+ )
|
|
</if>
|
|
</if>
|
|
<if test="number != null and number != ''">
|
|
<if test="number != null and number != ''">
|
|
AND a.number LIKE
|
|
AND a.number LIKE
|
|
@@ -924,6 +932,7 @@
|
|
(case when a.receipt_money = '0' then '否' when a.receipt_money = '1' then '是' when a.receipt_money = '2' then '部分收款' else '否' end) as receiptMoney,
|
|
(case when a.receipt_money = '0' then '否' when a.receipt_money = '1' then '是' when a.receipt_money = '2' then '部分收款' else '否' end) as receiptMoney,
|
|
a.cancellation_remark as "cancellationRemark",
|
|
a.cancellation_remark as "cancellationRemark",
|
|
a.account_checking_user_id as "accountCheckingUserId",
|
|
a.account_checking_user_id as "accountCheckingUserId",
|
|
|
|
+ sa.name as "accountCheckingArea",
|
|
a.area_id as "area.id",
|
|
a.area_id as "area.id",
|
|
a.new_drawer_id as "newDrawerId",
|
|
a.new_drawer_id as "newDrawerId",
|
|
a.new_drawer as "newDrawer",
|
|
a.new_drawer as "newDrawer",
|
|
@@ -959,6 +968,7 @@
|
|
LEFT JOIN sys_user sua ON sua.id = a.account_checking_user_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_detail wid on a.id = wid.invoice_id
|
|
LEFT join sys_office so on so.id = a.office_id
|
|
LEFT join sys_office so on so.id = a.office_id
|
|
|
|
+ LEFT join sys_area sa on sa.id = a.area_id
|
|
left join work_invoice_receipt wir on wir.invoice_id = a.id
|
|
left join work_invoice_receipt wir on wir.invoice_id = a.id
|
|
<where>
|
|
<where>
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
@@ -1155,10 +1165,12 @@
|
|
AND a.billing_content = #{billingContent}
|
|
AND a.billing_content = #{billingContent}
|
|
</if>
|
|
</if>
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
- AND a.area_parent_id LIKE
|
|
|
|
|
|
+ AND (a.area_parent_id LIKE
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
|
|
+ or a.area_id = #{area.id}
|
|
|
|
+ )
|
|
</if>
|
|
</if>
|
|
<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
|
|
<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or acu.name like concat('%',#{accountCheckingUserName},'%'))
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or acu.name like concat('%',#{accountCheckingUserName},'%'))
|
|
@@ -1310,10 +1322,12 @@
|
|
AND a.is_invalid = #{isInvalid}
|
|
AND a.is_invalid = #{isInvalid}
|
|
</if>
|
|
</if>
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
- AND a.area_parent_id LIKE
|
|
|
|
|
|
+ AND (a.area_parent_id LIKE
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
|
|
+ or a.area_id = #{area.id}
|
|
|
|
+ )
|
|
</if>
|
|
</if>
|
|
<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
|
|
<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
|
|
@@ -1480,10 +1494,12 @@
|
|
AND a.is_invalid = #{isInvalid}
|
|
AND a.is_invalid = #{isInvalid}
|
|
</if>
|
|
</if>
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
- AND a.area_parent_id LIKE
|
|
|
|
|
|
+ AND (a.area_parent_id LIKE
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
|
|
+ or a.area_id = #{area.id}
|
|
|
|
+ )
|
|
</if>
|
|
</if>
|
|
<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
|
|
<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
|
|
@@ -1992,10 +2008,12 @@
|
|
AND a.is_invalid = #{isInvalid}
|
|
AND a.is_invalid = #{isInvalid}
|
|
</if>
|
|
</if>
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
<if test="area != null and area.id != null and area.id != ''">
|
|
- AND a.area_parent_id LIKE
|
|
|
|
|
|
+ AND (a.area_parent_id LIKE
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
|
|
|
|
+ or a.area_id = #{area.id}
|
|
|
|
+ )
|
|
</if>
|
|
</if>
|
|
<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
|
|
<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
|
|
AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
|