|
|
|
@@ -95,31 +95,31 @@ |
|
|
|
|
|
|
|
<select id="queryBillRentList" parameterType="com.iformall.domain.po.WxBillRent" resultMap="BaseResultMap"> |
|
|
|
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, |
|
|
|
case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`need_pay`,m.`name` merchant_name, |
|
|
|
case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`need_pay`,r.merchant_name, |
|
|
|
s.shop_number,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,r.type as rent_type, |
|
|
|
r.pay_ratio,br.`revenue`,br.`late_pay_ratio`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`, |
|
|
|
d.receive_pay deposit,case when br.late_pay_status=2 then (case when br.late_pay_time is null then 0 |
|
|
|
else FLOOR(DATEDIFF(now(),br.late_pay_time)*br.late_pay_ratio/10000*br.owe)end) else br.late_pay_price end |
|
|
|
late_pay_price,d.`status` |
|
|
|
deposit_status,br.shop_info,br.pay_way,br.late_pay_status,br.`comments`,br.starttime,br.endtime |
|
|
|
from wx_bill_rent br left join wx_merchant m on br.merchant_id=m.id |
|
|
|
from wx_bill_rent br |
|
|
|
left join wx_shop s on br.shop_id=s.id |
|
|
|
left join wx_rent_contract r on br.rent_contract_id=r.id |
|
|
|
left join wx_bill_rent_deposit d on br.rent_contract_id=d.rent_contract_id and br.merchant_id=d.merchant_id |
|
|
|
<where> |
|
|
|
br.is_preview = 0 |
|
|
|
<if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> |
|
|
|
<if test=" null != status ">and br.`status` = #{status}</if> |
|
|
|
<if test=" null != depositStatus ">and d.`status` = #{depositStatus}</if> |
|
|
|
<if test=" null != id ">and br.`id` = #{id}</if> |
|
|
|
<if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> |
|
|
|
<if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if> |
|
|
|
<if test=" null != status ">and br.`status` = #{status}</if> |
|
|
|
<if test=" null != isDel ">and br.`is_del` = #{isDel}</if> |
|
|
|
<if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}</if> |
|
|
|
<if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> |
|
|
|
<if test=" null != rentContractId ">and br.`rent_contract_id` = #{rentContractId}</if> |
|
|
|
<if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> |
|
|
|
<if test=" null != latePayStatus ">and br.`late_pay_status` = #{latePayStatus}</if> |
|
|
|
<if test=" null != depositStatus ">and d.`status` = #{depositStatus}</if> |
|
|
|
|
|
|
|
<if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
<if test=" null != sortColumns">order by ${sortColumns}</if> |
|
|
|
</select> |
|
|
|
|