Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

376 řádky
19 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.iformall.mapper.WxAllBillMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxAllBill">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
  9. <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
  10. <result column="create_by" jdbcType="BIGINT" property="createBy"/>
  11. <result column="create_by_name" jdbcType="VARCHAR" property="createByName"/>
  12. <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/>
  13. <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
  14. <result column="update_by_name" jdbcType="VARCHAR" property="updateByName"/>
  15. <result column="price_detail" jdbcType="VARCHAR" property="priceDetail"/>
  16. <result column="need_pay" jdbcType="VARCHAR" property="needPay"/>
  17. <result column="receive_pay" jdbcType="VARCHAR" property="receivePay"/>
  18. <result column="pay" jdbcType="VARCHAR" property="pay"/>
  19. <result column="bill_type" jdbcType="INTEGER" property="billType"/>
  20. <result column="pay_way" jdbcType="BIGINT" property="payWay"/>
  21. <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/>
  22. <result column="set_off" jdbcType="VARCHAR" property="setOff"/>
  23. <result column="use_money" jdbcType="VARCHAR" property="useMoney"/>
  24. <result column="starttime" jdbcType="TIMESTAMP" property="starttime"/>
  25. <result column="endtime" jdbcType="TIMESTAMP" property="endtime"/>
  26. <result column="receive_date" jdbcType="TIMESTAMP" property="receiveDate"/>
  27. <result column="period" jdbcType="VARCHAR" property="period"/>
  28. <result column="status" jdbcType="INTEGER" property="status"/>
  29. <result column="energy_fees_id" jdbcType="BIGINT" property="energyFeesId"/>
  30. <result column="return_pay" jdbcType="VARCHAR" property="returnPay"/>
  31. <result column="bill_remark" jdbcType="VARCHAR" property="billRemark"/>
  32. <result column="last_owe_call_time" jdbcType="TIMESTAMP" property="lastOweCallTime"/>
  33. <result column="last_owe_call_user" jdbcType="VARCHAR" property="lastOweCallUser"/>
  34. <result column="bussiness_manage_fee_need_pay" jdbcType="VARCHAR" property="bussinessManageFeeNeedPay"/>
  35. <result column="operating_manage_fee_need_pay" jdbcType="VARCHAR" property="operatingManageFeeNeedPay"/>
  36. <result column="shop_id" jdbcType="BIGINT" property="shopId"/>
  37. <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
  38. <result column="is_preview" jdbcType="INTEGER" property="isPreview"/>
  39. <result column="shop_info" jdbcType="VARCHAR" property="shopInfo"/>
  40. <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/>
  41. <result column="property_contract_id" jdbcType="BIGINT" property="propertyContractId"/>
  42. <result column="parent_bill_id" jdbcType="BIGINT" property="parentBillId"/>
  43. <result column="energy_reading_calcuteId" jdbcType="BIGINT" property="energyReadingCalcuteId" />
  44. <result column="energy_reading_id" jdbcType="BIGINT" property="energyReadingId" />
  45. <result column="extra_create_from" jdbcType="INTEGER" property="extraCreateFrom" />
  46. <result column="rent_area" jdbcType="VARCHAR" property="rentArea" />
  47. <result column="can_edit" jdbcType="INTEGER" property="canEdit" />
  48. </resultMap>
  49. <sql id="allColumns">
  50. `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`createtime`,`create_by`,`create_by_name`,`updatetime`,`update_by`,`update_by_name`,
  51. `price_detail`,`need_pay`,`receive_pay`,`pay`,`bill_type`,`pay_way`,`pay_date`,`set_off`,`use_money`,`starttime`,`endtime`,`status`,`energy_fees_id`,`return_pay`,
  52. `bill_remark`,`last_owe_call_time`,`last_owe_call_user`,`bussiness_manage_fee_need_pay`,`operating_manage_fee_need_pay`,`shop_id`,`shop_number`,`receive_date`,`period`,
  53. `is_preview`,`shop_info`,`rent_contract_id`,`property_contract_id`,`parent_bill_id`,`energy_reading_calcuteId`,`energy_reading_id`,`extra_create_from`,`rent_area`,
  54. `can_edit`
  55. </sql>
  56. <sql id="dynamicWhereConditions">
  57. where `tenant_id` = #{tenantId}
  58. <if test=" null != id ">and `id` = #{id}</if>
  59. <if test=" null != parentTenantId and '' != parentTenantId"> and `parent_tenant_id` = #{parentTenantId}</if>
  60. <if test=" null != merchantId ">and `merchant_id` = #{merchantId}</if>
  61. <if test=" null != createBy ">and `create_by` = #{createBy}</if>
  62. <if test=" null != createByName and '' != createByName"> and `create_by_name` like concat('%',#{createByName},'%')</if>
  63. <if test=" null != billType ">and `bill_type` = #{billType}</if>
  64. <if test=" null != payWay ">and `pay_way` = #{payWay}</if>
  65. <if test=" null != status ">and `status` = #{status}</if>
  66. <if test=" null != energyFeesId ">and `energy_fees_id` = #{energyFeesId}</if>
  67. <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if>
  68. <if test=" null != propertyContractId ">and `property_contract_id` = #{propertyContractId}</if>
  69. <if test=" null != parentBillId ">and `parent_bill_id` = #{parentBillId}</if>
  70. <if test=" null != isPreview ">and `is_preview` = #{isPreview}</if>
  71. <if test=" null != starttime">and `starttime` &gt;= #{starttime}</if>
  72. <if test=" null != endtime">and `endtime` &lt;= #{endtime}</if>
  73. <if test=" null != receiveDate">and `receive_date` &lt;= #{receiveDate}</if>
  74. <if test=" null != starttimeEqual">and `starttime` = #{starttimeEqual}</if>
  75. <if test=" null != endtimeEqual">and `endtime` = #{endtimeEqual}</if>
  76. <if test=" null != extraCreateFrom">and `extra_create_from` = #{extraCreateFrom}</if>
  77. <if test=" null != noExtraCreateFrom">and `extra_create_from` is null</if>
  78. <if test=" null != advanceHasMoney">and bill_type = 6 and IFNULL(`pay`,'0') - IFNULL(`use_money`,'0') &gt; 0</if>
  79. <if test=" null != canEdit">and `can_edit` = #{canEdit}</if>
  80. <if test=" null != shopNumber and '' != shopNumber"> and shop_number like concat('%',#{shopNumber},'%')</if>
  81. <if test=" null != queryShopNumber and '' != queryShopNumber"> and shop_number like concat('%,',#{shopNumber},',%')</if>
  82. <if test=" null != month and '' != month">
  83. and date_format(starttime,'%Y-%m') &lt;= #{month} and date_format(endtime,'%Y-%m') &gt;= #{month}
  84. </if>
  85. <if test=" null == nearBillLastTime and null != oweBillLastTime">
  86. and (
  87. (`receive_date` &lt;= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 0 and bill_type not in (13,21,5,7))
  88. or
  89. (`receive_date` &lt;= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') &gt; 0 and bill_type in (13,21,5,7))
  90. )
  91. </if>
  92. <if test=" null != nearBillLastTime and null != oweBillLastTime">
  93. and (
  94. (`receive_date` &gt; #{oweBillLastTime} and `receive_date` &lt;= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 0 and bill_type not in (13,21,5,7))
  95. or
  96. (`receive_date` &gt; #{oweBillLastTime} and `receive_date` &lt;= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') &gt; 0 and bill_type in (13,21,5,7))
  97. )
  98. </if>
  99. <if test=" null != needPayStartDay">
  100. and (
  101. (`receive_date` &lt;= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 0 and bill_type not in (13,21,5,7))
  102. or
  103. (`receive_date` &lt;= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') &gt; 0 and bill_type in (13,21,5,7))
  104. )
  105. </if>
  106. <if test=" null != needPayNoDays">
  107. and (
  108. ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 0 and bill_type not in (13,21,5,7))
  109. or
  110. ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') &gt; 0 and bill_type in (13,21,5,7))
  111. )
  112. </if>
  113. <if test=" null != toPayMerchant">
  114. and (
  115. ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &lt; 0 and bill_type not in (13,21,5,7))
  116. or
  117. ( `pay` - IFNULL(`return_pay`,'0') &gt; 0 and bill_type in (13,21,5,7))
  118. )
  119. </if>
  120. <if test=" 1 == notifyed ">
  121. and (
  122. (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 0 and bill_type not in (13,21,5,7))
  123. or
  124. (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') &gt; 0 and bill_type in (13,21,5,7))
  125. )
  126. </if>
  127. <if test=" null != hasMerchant ">and `merchant_id` is not null</if>
  128. <if test=" 1 == hasParentBillId ">and `parent_bill_id` is not null</if>
  129. <if test=" 0 == hasParentBillId ">and `parent_bill_id` is null</if>
  130. <if test=" null != energyReadingCalcuteId ">and `energy_reading_calcuteId` = #{energyReadingCalcuteId}</if>
  131. <if test=" null != energyReadingId ">and `energy_reading_id` = #{energyReadingId}</if>
  132. <if test=" null != energyFeesIds ">
  133. and `energy_fees_id` in
  134. <foreach collection="energyFeesIds" index="index" item="eidItem" open="(" separator="," close=")">
  135. #{eidItem}
  136. </foreach>
  137. </if>
  138. <if test=" null != rentContractIdList ">
  139. and `rent_contract_id` in
  140. <foreach collection="rentContractIdList" index="index" item="ridItem" open="(" separator="," close=")">
  141. #{ridItem}
  142. </foreach>
  143. </if>
  144. <if test=" null != propertyContractIds ">
  145. and property_contract_id in
  146. <foreach collection="propertyContractIds" index="index" item="pidItem" open="(" separator="," close=")">
  147. #{pidItem}
  148. </foreach>
  149. </if>
  150. <if test=" null != merchantIdList ">
  151. and `merchant_id` in
  152. <foreach collection="merchantIdList" index="index" item="midItem" open="(" separator="," close=")">
  153. #{midItem}
  154. </foreach>
  155. </if>
  156. <if test=" null != statusList ">
  157. and `status` in
  158. <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")">
  159. #{stItem}
  160. </foreach>
  161. </if>
  162. <if test=" null != notInIds ">
  163. and id not in
  164. <foreach collection="notInIds" index="index" item="nidItem" open="(" separator="," close=")">
  165. #{nidItem}
  166. </foreach>
  167. </if>
  168. <if test=" null != ids ">
  169. and id in
  170. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  171. #{idItem}
  172. </foreach>
  173. </if>
  174. <if test=" null != sortColumns">order by ${sortColumns}</if>
  175. <if test="null != limitStart and null != limitEnd">
  176. limit #{limitStart},#{limitEnd}
  177. </if>
  178. </sql>
  179. <select id="findList" parameterType="com.iformall.domain.po.WxAllBill" resultMap="BaseResultMap">
  180. select
  181. <include refid="allColumns"/>
  182. from wx_all_bill
  183. <include refid="dynamicWhereConditions"/>
  184. </select>
  185. <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
  186. select
  187. <include refid="allColumns"/>
  188. from wx_all_bill where id = #{id} and `tenant_id` = #{tenantId}
  189. </select>
  190. <select id="queryBillRentContractIdList" parameterType="com.iformall.domain.po.WxAllBill" resultType="Long">
  191. select distinct rent_contract_id from wx_all_bill
  192. <include refid="dynamicWhereConditions"/>
  193. </select>
  194. <select id="getMerchantAdvanceGroupSumList" parameterType="com.iformall.domain.po.WxAllBill" resultMap="BaseResultMap">
  195. select energy_fees_id, sum(CAST(pay AS DECIMAL(20,2))) pay , sum(CAST(ifnull(use_money,'0') AS DECIMAL(20,2))) use_money
  196. from wx_all_bill
  197. <include refid="dynamicWhereConditions"/>
  198. group by energy_fees_id
  199. </select>
  200. <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum">
  201. <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/>
  202. <result column="paid" jdbcType="VARCHAR" property="paid" />
  203. <result column="min_date" jdbcType="TIMESTAMP" property="minDate" />
  204. <result column="max_date" jdbcType="TIMESTAMP" property="maxDate" />
  205. <result column="return_pay" jdbcType="VARCHAR" property="returnPay"/>
  206. <result column="set_off" jdbcType="VARCHAR" property="setOff"/>
  207. <result column="energy_fees_id" jdbcType="BIGINT" property="energyFeesId"/>
  208. </resultMap>
  209. <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxAllBill" resultMap="SumBaseResultMap">
  210. select
  211. sum(CAST(receive_pay AS DECIMAL(20,2))) receive_pay ,
  212. sum(CAST(ifnull(pay,'0') AS DECIMAL(20,2))) paid,
  213. min(starttime) min_date,
  214. max(endtime) max_date,
  215. sum(CAST(ifnull(set_off,'0') AS DECIMAL(20,2))) set_off ,
  216. sum(CAST(ifnull(return_pay,'0') AS DECIMAL(20,2))) return_pay
  217. from wx_all_bill
  218. <include refid="dynamicWhereConditions"/>
  219. </select>
  220. <select id="getFeesBillSum" parameterType="com.iformall.domain.po.WxAllBill" resultMap="SumBaseResultMap">
  221. select
  222. energy_fees_id,
  223. sum(CAST(receive_pay AS DECIMAL(20,2))) receive_pay ,
  224. sum(CAST(ifnull(pay,'0') AS DECIMAL(20,2))) paid,
  225. min(starttime) min_date,
  226. max(endtime) max_date,
  227. sum(CAST(ifnull(set_off,'0') AS DECIMAL(20,2))) set_off ,
  228. sum(CAST(ifnull(return_pay,'0') AS DECIMAL(20,2))) return_pay
  229. from wx_all_bill
  230. <include refid="dynamicWhereConditions"/>
  231. group by energy_fees_id
  232. </select>
  233. <select id="getMerchantIdList" parameterType="com.iformall.domain.po.WxAllBill" resultType="Long">
  234. select distinct merchant_id from wx_all_bill
  235. <include refid="dynamicWhereConditions"/>
  236. </select>
  237. <resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify">
  238. <result column="total_count" jdbcType="INTEGER" property="totalCount"/>
  239. <result column="total_money" jdbcType="VARCHAR" property="totalMoney" />
  240. <result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/>
  241. <result column="bill_type" jdbcType="INTEGER" property="billType"/>
  242. </resultMap>
  243. <select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxAllBill" resultMap="HotNotifyBaseResultMap">
  244. select
  245. bill_type,
  246. count(1) total_count ,
  247. case when bill_type in (13,21,5) then sum(CAST(`receive_pay` AS DECIMAL(20,2)) - CAST(`pay` AS DECIMAL(20,2)) - CAST(IFNULL(`set_off`,'0') AS DECIMAL(20,2)) )
  248. else sum(CAST(`receive_pay` AS DECIMAL(20,2)) - CAST(`pay` AS DECIMAL(20,2)) - CAST(IFNULL(`set_off`,'0') AS DECIMAL(20,2)) + CAST(IFNULL(`return_pay`,'0') AS DECIMAL(20,2)))
  249. end as total_money,
  250. MIN(starttime) min_begin_time from wx_all_bill
  251. <include refid="dynamicWhereConditions"/>
  252. group by bill_type
  253. </select>
  254. <resultMap id="NotifyResultMap" type="com.iformall.domain.vo.WxBillNotify">
  255. <result column="bill_type" jdbcType="INTEGER" property="billType"/>
  256. <result column="bill_id" jdbcType="BIGINT" property="billId" />
  257. <result column="starttime" jdbcType="TIMESTAMP" property="starttime"/>
  258. <result column="endtime" jdbcType="TIMESTAMP" property="endtime"/>
  259. <result column="receive_pay" jdbcType="VARCHAR" property="receivePay"/>
  260. <result column="pay" jdbcType="VARCHAR" property="pay"/>
  261. <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
  262. </resultMap>
  263. <select id="getBillNotifyList" parameterType="com.iformall.domain.po.WxAllBill" resultMap="NotifyResultMap">
  264. select bill_type,br.id as bill_id, br.starttime,br.endtime,br.receive_pay,br.pay,br.merchant_id from wx_all_bill br
  265. <include refid="dynamicWhereConditions"/>
  266. </select>
  267. <delete id="deleteBillByContract" parameterType="com.iformall.domain.po.WxRentContract">
  268. delete from wx_all_bill where rent_contract_id = #{id}
  269. </delete>
  270. <delete id="deleteBillByPropertyContract" parameterType="com.iformall.domain.po.WxPropertyContract">
  271. delete from wx_all_bill where property_contract_id = #{id}
  272. </delete>
  273. <delete id="deletePreviewBill" parameterType="com.iformall.domain.po.WxAllBill">
  274. delete from wx_all_bill where is_preview = 1
  275. <if test=" null != rentContractId">
  276. and rent_contract_id = #{rentContractId}
  277. </if>
  278. <if test=" null != propertyContractId">
  279. and property_contract_id = #{propertyContractId}
  280. </if>
  281. </delete>
  282. <delete id="deleteNoNeedPayBill" parameterType="com.iformall.domain.po.WxAllBill">
  283. delete from wx_all_bill where starttime &gt;= #{shopEndtime} and IFNULL(`pay`,'0') &lt;= 0 AND IFNULL(`set_off`,'0') &lt;= 0
  284. and IFNULL(`return_pay`,'0') &lt;= 0 and IFNULL(`use_money`,'0') &lt;= 0
  285. <if test=" null != rentContractId">
  286. and rent_contract_id = #{rentContractId}
  287. </if>
  288. <if test=" null != propertyContractId">
  289. and property_contract_id = #{propertyContractId}
  290. </if>
  291. <if test=" null != merchantId">
  292. and merchant_id = #{merchantId}
  293. </if>
  294. </delete>
  295. <delete id="deleteByRentHuiSuan" parameterType="com.iformall.domain.po.WxAllBill">
  296. delete from wx_all_bill where rent_contract_id = #{rentContractId}
  297. and IFNULL(`pay`,'0') &lt;= 0 AND IFNULL(`set_off`,'0') &lt;= 0 and IFNULL(`return_pay`,'0') &lt;= 0 and IFNULL(`use_money`,'0') &lt;= 0
  298. and extra_create_from = #{extraCreateFrom} and `starttime` = #{starttimeEqual}
  299. </delete>
  300. <select id="countValidBillCountByRentHuiSuan" parameterType="com.iformall.domain.po.WxAllBill" resultType="Integer">
  301. select count(1) from wx_all_bill where rent_contract_id = #{rentContractId}
  302. and (IFNULL(`pay`,'0') &gt; 0 or IFNULL(`set_off`,'0') &gt; 0 or IFNULL(`return_pay`,'0') &gt; 0 or IFNULL(`use_money`,'0') &gt; 0)
  303. and extra_create_from = #{extraCreateFrom} and `starttime` = #{starttimeEqual}
  304. </select>
  305. <delete id="deleteByRentReveneuSales" parameterType="com.iformall.domain.po.WxAllBill">
  306. delete from wx_all_bill where extra_create_from = #{extraCreateFrom}
  307. and IFNULL(`pay`,'0') &lt;= 0 AND IFNULL(`set_off`,'0') &lt;= 0 and IFNULL(`return_pay`,'0') &lt;= 0 and IFNULL(`use_money`,'0') &lt;= 0
  308. and `starttime` = #{starttimeEqual}
  309. <if test=" null != rentContractId">
  310. and rent_contract_id = #{rentContractId}
  311. </if>
  312. <if test=" null != propertyContractId">
  313. and property_contract_id = #{propertyContractId}
  314. </if>
  315. </delete>
  316. <update id="updatePreviewStatus" parameterType="com.iformall.domain.po.WxAllBill">
  317. update wx_all_bill set is_preview = #{isPreview}
  318. <if test=" null != rentContractId">
  319. where rent_contract_id = #{rentContractId}
  320. </if>
  321. <if test=" null != propertyContractId">
  322. where property_contract_id = #{propertyContractId}
  323. </if>
  324. </update>
  325. <insert id="insertBills" parameterType="HashMap">
  326. INSERT INTO wx_all_bill (
  327. <include refid="allColumns"/>
  328. )
  329. VALUES
  330. <foreach collection="list" item="item" index="index" separator=",">
  331. (
  332. #{item.id},#{item.tenantId},#{item.parentTenantId},#{item.merchantId},#{item.createtime},
  333. #{item.createBy},#{item.createByName},#{item.updatetime},#{item.updateBy},#{item.updateByName},#{item.priceDetail},
  334. #{item.needPay},#{item.receivePay},#{item.pay},#{item.billType},#{item.payWay},#{item.payDate},#{item.setOff},#{item.useMoney},
  335. #{item.starttime},#{item.endtime},#{item.status},#{item.energyFeesId},#{item.returnPay},#{item.billRemark},
  336. #{item.lastOweCallTime},#{item.lastOweCallUser},#{item.bussinessManageFeeNeedPay},#{item.operatingManageFeeNeedPay},
  337. #{item.shopId},#{item.shopNumber},#{item.receiveDate},#{item.period},#{item.isPreview},#{item.shopInfo},#{item.rentContractId},#{item.propertyContractId},
  338. #{item.parentBillId},#{item.energyReadingCalcuteId},#{item.energyReadingId},#{item.extraCreateFrom},#{item.rentArea},#{item.canEdit}
  339. )
  340. </foreach>
  341. </insert>
  342. <delete id = "deleteById" parameterType="HashMap">
  343. delete from wx_all_bill where id = #{id} and tenant_id = #{tenantId}
  344. and pay &lt;= 0 and IFNULL(`set_off`,'0') &lt;= 0 and IFNULL(`return_pay`,'0') &lt;= 0 and IFNULL(`use_money`,'0') &lt;= 0
  345. </delete>
  346. <delete id = "deleteEnergyReadingBills" parameterType="HashMap">
  347. delete from wx_all_bill where energy_reading_calcuteId = #{energyReadingCalcuteId} and tenant_id = #{tenantId}
  348. and pay &lt;= 0 and IFNULL(`set_off`,'0') &lt;= 0 and IFNULL(`return_pay`,'0') &lt;= 0 and IFNULL(`use_money`,'0') &lt;= 0
  349. </delete>
  350. </mapper>