挂账需求
This commit is contained in:
parent
abf153968e
commit
a3c071ad83
|
|
@ -33,8 +33,8 @@
|
|||
<select id="findCreditBuyerList" resultType="com.czg.order.dto.CreditBuyerDTO">
|
||||
select x1.*,
|
||||
x2.shop_name,
|
||||
x3.owed_amount,
|
||||
x3.accumulate_amount
|
||||
ifnull(x3.owed_amount, 0 ) as owed_amount,
|
||||
ifnull(x3.accumulate_amount,0) as accumulate_amount
|
||||
from tb_credit_buyer x1
|
||||
left join tb_shop_info x2 on x1.shop_id = x2.id
|
||||
left join (select t.credit_buyer_id,ifnull(sum(t.unpaid_amount),0) as owed_amount,ifnull(sum(t.pay_amount),0) as
|
||||
|
|
@ -59,22 +59,14 @@
|
|||
</if>
|
||||
<if test="repaymentStatus !=null and repaymentStatus != ''">
|
||||
<if test="repaymentStatus == 'unpaid'">
|
||||
and 0 < ifnull((select x.count from
|
||||
<include refid="view_credit_buyer_order_count"/>
|
||||
x where x.credit_buyer_id = tb_credit_buyer.id and x.status = 'unpaid'),0)
|
||||
and 0 = ifnull((select x.count from
|
||||
<include refid="view_credit_buyer_order_count"/>
|
||||
x where x.credit_buyer_id = tb_credit_buyer.id and x.status = 'partial'),0)
|
||||
and 0 < ifnull((select x.count from <include refid="view_credit_buyer_order_count"/> x where x.credit_buyer_id = x1.id and x.status = 'unpaid'),0)
|
||||
and 0 = ifnull((select x.count from <include refid="view_credit_buyer_order_count"/> x where x.credit_buyer_id = x1.id and x.status = 'partial'),0)
|
||||
</if>
|
||||
<if test="repaymentStatus == 'partial'">
|
||||
and 0 < ifnull((select x.count from
|
||||
<include refid="view_credit_buyer_order_count"/>
|
||||
x where x.credit_buyer_id = tb_credit_buyer.id and x.status = 'partial'),0)
|
||||
and 0 < ifnull((select x.count from <include refid="view_credit_buyer_order_count"/> x where x.credit_buyer_id = x1.id and x.status = 'partial'),0)
|
||||
</if>
|
||||
<if test="repaymentStatus == 'paid'">
|
||||
and 0 = ifnull((select sum(x.count) from
|
||||
<include refid="view_credit_buyer_order_count"/>
|
||||
x where x.credit_buyer_id = tb_credit_buyer.id and x.status in ('unpaid','partial')),0)
|
||||
and 0 = ifnull((select sum(x.count) from <include refid="view_credit_buyer_order_count"/> x where x.credit_buyer_id = x1.id and x.status in ('unpaid','partial')),0)
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
|
|
|
|||
Loading…
Reference in New Issue