给单据接口增加有无欠款的筛选

This commit is contained in:
季圣华
2022-11-17 00:57:05 +08:00
parent 1764ee66f3
commit b6215fc47d
5 changed files with 48 additions and 8 deletions

View File

@@ -134,6 +134,12 @@
<bind name="bindAccountId" value="'%'+accountId+'%'"/>
and (dh.account_id=#{accountId} or dh.account_id_list like #{bindAccountId})
</if>
<if test="hasDebt != null and hasDebt ==1">
and (ifnull(dh.discount_last_money,0)+ifnull(dh.other_money,0)-ifnull(dh.deposit,0)-abs(ifnull(dh.change_amount,0))>0)
</if>
<if test="hasDebt != null and hasDebt ==0">
and (ifnull(dh.discount_last_money,0)+ifnull(dh.other_money,0)-ifnull(dh.deposit,0)-abs(ifnull(dh.change_amount,0))=0)
</if>
<if test="remark != null and remark !=''">
<bind name="bindRemark" value="'%'+remark+'%'"/>
and (dh.remark like #{bindRemark} or di.remark like #{bindRemark})
@@ -224,6 +230,12 @@
<bind name="bindAccountId" value="'%'+accountId+'%'"/>
and (dh.account_id=#{accountId} or dh.account_id_list like #{bindAccountId})
</if>
<if test="hasDebt != null and hasDebt ==1">
and (ifnull(dh.discount_last_money,0)+ifnull(dh.other_money,0)-ifnull(dh.deposit,0)-abs(ifnull(dh.change_amount,0))>0)
</if>
<if test="hasDebt != null and hasDebt ==0">
and (ifnull(dh.discount_last_money,0)+ifnull(dh.other_money,0)-ifnull(dh.deposit,0)-abs(ifnull(dh.change_amount,0))=0)
</if>
<if test="remark != null and remark !=''">
<bind name="bindRemark" value="'%'+remark+'%'"/>
and (dh.remark like #{bindRemark} or di.remark like #{bindRemark})