| @@ -111,7 +111,7 @@ | |||||
| and ( | and ( | ||||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') < 0 and bill_type not in (13,21,5)) | ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') < 0 and bill_type not in (13,21,5)) | ||||
| or | or | ||||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') < 0 and bill_type in (13,21,5)) | |||||
| ( `pay` - IFNULL(`return_pay`,'0') > 0 and bill_type in (13,21,5)) | |||||
| ) | ) | ||||
| </if> | </if> | ||||
| <if test=" 1 == notifyed "> | <if test=" 1 == notifyed "> | ||||
| @@ -289,7 +289,8 @@ | |||||
| </delete> | </delete> | ||||
| <delete id="deleteNoNeedPayBill" parameterType="com.iformall.domain.po.WxAllBill"> | <delete id="deleteNoNeedPayBill" parameterType="com.iformall.domain.po.WxAllBill"> | ||||
| delete from wx_all_bill where starttime >= #{shopEndtime} and IFNULL(`pay`,'0') <= 0 AND IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 | |||||
| delete from wx_all_bill where starttime >= #{shopEndtime} and IFNULL(`pay`,'0') <= 0 AND IFNULL(`set_off`,'0') <= 0 | |||||
| and IFNULL(`return_pay`,'0') <= 0 and IFNULL(`use_money`,'0') <= 0 | |||||
| <if test=" null != rentContractId"> | <if test=" null != rentContractId"> | ||||
| and rent_contract_id = #{rentContractId} | and rent_contract_id = #{rentContractId} | ||||
| </if> | </if> | ||||
| @@ -304,13 +305,13 @@ | |||||
| <delete id="deleteByRentHuiSuan" parameterType="com.iformall.domain.po.WxAllBill"> | <delete id="deleteByRentHuiSuan" parameterType="com.iformall.domain.po.WxAllBill"> | ||||
| delete from wx_all_bill where rent_contract_id = #{rentContractId} | delete from wx_all_bill where rent_contract_id = #{rentContractId} | ||||
| and IFNULL(`pay`,'0') <= 0 AND IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 | |||||
| and IFNULL(`pay`,'0') <= 0 AND IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 and IFNULL(`use_money`,'0') <= 0 | |||||
| and extra_create_from = #{extraCreateFrom} and `starttime` = #{starttimeEqual} | and extra_create_from = #{extraCreateFrom} and `starttime` = #{starttimeEqual} | ||||
| </delete> | </delete> | ||||
| <delete id="deleteByRentReveneuSales" parameterType="com.iformall.domain.po.WxAllBill"> | <delete id="deleteByRentReveneuSales" parameterType="com.iformall.domain.po.WxAllBill"> | ||||
| delete from wx_all_bill where extra_create_from = #{extraCreateFrom} | delete from wx_all_bill where extra_create_from = #{extraCreateFrom} | ||||
| and IFNULL(`pay`,'0') <= 0 AND IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 | |||||
| and IFNULL(`pay`,'0') <= 0 AND IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 and IFNULL(`use_money`,'0') <= 0 | |||||
| and `starttime` = #{starttimeEqual} | and `starttime` = #{starttimeEqual} | ||||
| <if test=" null != rentContractId"> | <if test=" null != rentContractId"> | ||||
| and rent_contract_id = #{rentContractId} | and rent_contract_id = #{rentContractId} | ||||
| @@ -353,7 +354,8 @@ | |||||
| </delete> | </delete> | ||||
| <delete id = "deleteEnergyReadingBills" parameterType="HashMap"> | <delete id = "deleteEnergyReadingBills" parameterType="HashMap"> | ||||
| delete from wx_all_bill where energy_reading_calcuteId = #{energyReadingCalcuteId} and tenant_id = #{tenantId} and pay <= 0 and IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 | |||||
| delete from wx_all_bill where energy_reading_calcuteId = #{energyReadingCalcuteId} and tenant_id = #{tenantId} | |||||
| and pay <= 0 and IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 and IFNULL(`use_money`,'0') <= 0 | |||||
| </delete> | </delete> | ||||
| </mapper> | </mapper> | ||||