后台服务
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

148 Zeilen
6.1 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.WxBillSettleScheduleMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillSettleSchedule">
  5. <id column="id" property="id"/>
  6. <result column="tenant_id" property="tenantId"/>
  7. <result column="parent_tenant_id" property="parentTenantId"/>
  8. <result column="settle_number" property="settleNumber"/>
  9. <result column="merchant_id" property="merchantId"/>
  10. <result column="status" property="status"/>
  11. <result column="apply_status" property="applyStatus"/>
  12. <result column="receiveMoney" property="receiveMoney"/>
  13. <result column="payMoney" property="payMoney"/>
  14. <result column="settletime" property="settletime"/>
  15. <result column="createtime" property="createtime"/>
  16. <result column="updatetime" property="updatetime"/>
  17. <result column="merchantName" property="merchantName"/>
  18. <result column="settle_receive_pay" property="settleReceivePay"/>
  19. </resultMap>
  20. <sql id="allColumns">
  21. `id`,`tenant_id`,`parent_tenant_id`,`settle_number`,`merchant_id`,`status`,`apply_status`,
  22. `receive_money`,`pay_money`,`settletime`,`createtime`,`updatetime`,`settle_receive_pay`
  23. </sql>
  24. <insert id = "createScheduleFromBillSettle" parameterType= "hashmap">
  25. insert into wx_bill_settle_schedule(`id`,`tenant_id`,`parent_tenant_id`,`settle_number`,`merchant_id`,`status`,`apply_status`,`receive_money`,`pay_money`,`settletime`,`createtime`,
  26. `updatetime`,`settle_receive_pay`)
  27. select `id`,`tenant_id`,`parent_tenant_id`,`settle_number`,`merchant_id`,`status`,`apply_status`,`receive_money`,`pay_money`,`settletime`,`createtime`,`updatetime`,#{settleReceivePay}
  28. from wx_bill_settle where id = #{id}
  29. </insert>
  30. <select id="listToSettleBillIdList" resultType="Long" parameterType="com.iformall.domain.vo.WxBillAll">
  31. select s.id from wx_bill_settle s where has_recorded != 1 and s.status > 0
  32. <if test=" null != tenantId and '' != tenantId">
  33. and s.`tenant_id` = #{tenantId}
  34. </if>
  35. <if test=" null != parentTenantId and '' != parentTenantId">
  36. and s.`parent_tenant_id` = #{parentTenantId}
  37. </if>
  38. </select>
  39. <select id="listBillSettleBillBillId" resultType="Long" parameterType="hashmap">
  40. select bb.bill_id from wx_bill_settle_bill bb where bb.settle_id = #{settleId} and bb.type=#{type}
  41. </select>
  42. <select id="calculteRentRecivePay" resultType="Double" parameterType="com.iformall.domain.po.WxBillRent">
  43. select IFNULL(sum( (receive_pay+service_charge_pay+ifnull(late_pay_price,0)-pay)),0) owe
  44. from wx_bill_rent where is_preview = 0 and tenant_id = #{tenantId}
  45. <if test=" null != idList ">
  46. and `id` in
  47. <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
  48. #{idItem}
  49. </foreach>
  50. </if>
  51. </select>
  52. <select id="calculteRentDepositRecivePay" resultType="Double" parameterType="com.iformall.domain.po.WxBillRent">
  53. select IFNULL(sum( (receive_pay-pay)),0) owe
  54. from wx_bill_rent_deposit where tenant_id = #{tenantId}
  55. <if test=" null != idList ">
  56. and `id` in
  57. <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
  58. #{idItem}
  59. </foreach>
  60. </if>
  61. </select>
  62. <select id="calcultePropertyRecivePay" resultType="Double" parameterType="com.iformall.domain.po.WxBillProperty">
  63. select IFNULL(sum( (receive_pay+service_charge_pay+ifnull(late_pay_price,0)-pay)),0) owe
  64. from wx_bill_property where is_preview = 0 and tenant_id = #{tenantId}
  65. <if test=" null != idList ">
  66. and `id` in
  67. <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
  68. #{idItem}
  69. </foreach>
  70. </if>
  71. </select>
  72. <select id="calcultePropertyDepositRecivePay" resultType="Double" parameterType="com.iformall.domain.po.WxBillProperty">
  73. select IFNULL(sum( (receive_pay-pay)),0) owe
  74. from wx_bill_property_deposit where tenant_id = #{tenantId}
  75. <if test=" null != idList ">
  76. and `id` in
  77. <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
  78. #{idItem}
  79. </foreach>
  80. </if>
  81. </select>
  82. <select id="calculteDailyRecivePay" resultType="Double" parameterType="com.iformall.domain.po.WxBillDaily">
  83. select IFNULL(sum( (receive_pay+service_charge_pay-pay)),0) owe
  84. from wx_bill_daily where tenant_id = #{tenantId} and type in (1,2,3)
  85. <if test=" null != idList ">
  86. and `id` in
  87. <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
  88. #{idItem}
  89. </foreach>
  90. </if>
  91. </select>
  92. <select id="calculteOtherRecivePay0" resultType="Double" parameterType="com.iformall.domain.po.WxBillOther">
  93. select IFNULL(sum( (receive_pay+service_charge_pay-pay)),0) owe
  94. from wx_bill_other where tenant_id = #{tenantId}
  95. <if test=" null != idList ">
  96. and `id` in
  97. <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
  98. #{idItem}
  99. </foreach>
  100. </if>
  101. </select>
  102. <select id="calculteOtherRecivePay1" resultType="Double" parameterType="com.iformall.domain.po.WxBillOther">
  103. select IFNULL(sum( owe ),0) owe
  104. from wx_bill_other where tenant_id = #{tenantId}
  105. <if test=" null != idList ">
  106. and `id` in
  107. <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
  108. #{idItem}
  109. </foreach>
  110. </if>
  111. </select>
  112. <select id="calculteOtherDepositRecivePay0" resultType="Double" parameterType="com.iformall.domain.po.WxBillOther">
  113. select IFNULL(sum( (receive_pay+service_charge_pay-pay)),0) owe
  114. from wx_bill_other_deposit where tenant_id = #{tenantId}
  115. <if test=" null != idList ">
  116. and `id` in
  117. <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
  118. #{idItem}
  119. </foreach>
  120. </if>
  121. </select>
  122. <select id="calculteMerchantSubsidyRecivePay1" resultType="Double" parameterType="com.iformall.domain.po.WxMerchantSubsidy">
  123. select IFNULL(sum( subsidy),0) owe
  124. from wx_merchant_subsidy where tenant_id = #{tenantId}
  125. <if test=" null != idList ">
  126. and `id` in
  127. <foreach collection="idList" index="index" item="idItem" open="(" separator="," close=")">
  128. #{idItem}
  129. </foreach>
  130. </if>
  131. </select>
  132. </mapper>