后台服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WxBillOtherDepositMapper.xml 7.2 KiB

2 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.WxBillOtherDepositMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillOtherDeposit">
  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="receive_pay" jdbcType="BIGINT" property="receivePay"/>
  9. <result column="pay" jdbcType="BIGINT" property="pay"/>
  10. <result column="receive_date" jdbcType="TIMESTAMP" property="receiveDate"/>
  11. <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/>
  12. <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
  13. <result column="expired_day" jdbcType="INTEGER" property="expiredDay"/>
  14. <result column="owe" jdbcType="BIGINT" property="owe"/>
  15. <result column="status" jdbcType="INTEGER" property="status"/>
  16. <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
  17. <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/>
  18. <result column="apply_update_time" jdbcType="INTEGER" property="applyUpdateTime"/>
  19. <result column="is_del" jdbcType="INTEGER" property="isDel"/>
  20. <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
  21. <result column="user_id" jdbcType="BIGINT" property="userId"/>
  22. <result column="shop_id" jdbcType="BIGINT" property="shopId"/>
  23. <result column="shop_name" jdbcType="VARCHAR" property="shopName" />
  24. <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/>
  25. <result column="name" jdbcType="VARCHAR" property="name"/>
  26. <result column="comments" jdbcType="VARCHAR" property="comments"/>
  27. <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/>
  28. <result column="return_price" jdbcType="BIGINT" property="returnPrice"/>
  29. <result column="pay_way" jdbcType="INTEGER" property="payWay"/>
  30. <result column="merchant_name" property="merchantName"/>
  31. <result column="starttime" property="starttime"/>
  32. <result column="endtime" property="endtime"/>
  33. <result column="freeze" property="freeze"/>
  34. <result column="service_charge_pay" property="serviceChargePay"/>
  35. </resultMap>
  36. <sql id="allColumns">
  37. `id`,`tenant_id`,`parent_tenant_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,
  38. `owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`name`,`comments`,`apply_status`,`apply_pay_img`,`apply_update_time`,
  39. `rent_shop_type`,`return_price`,`pay_way`,`starttime`,`endtime`,freeze,service_charge_pay
  40. </sql>
  41. <sql id="dynamicWhereConditions">
  42. where 1 = 1
  43. <if test=" null != id ">and `id` = #{id}</if>
  44. <if test=" null != tenantId and '' != tenantId">
  45. and `tenant_id` = #{tenantId}
  46. </if>
  47. <if test=" null != parentTenantId and '' != parentTenantId">
  48. and `parent_tenant_id` = #{parentTenantId}
  49. </if>
  50. <if test=" null != receivePay ">and `receive_pay` = #{receivePay}</if>
  51. <if test=" null != pay ">and `pay` = #{pay}</if>
  52. <if test=" null != receiveDate ">and `receive_date` = #{receiveDate}</if>
  53. <if test=" null != payDate ">and `pay_date` = #{payDate}</if>
  54. <if test=" null != createtime ">and `createtime` = #{createtime}</if>
  55. <if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if>
  56. <if test=" null != owe ">and `owe` = #{owe}</if>
  57. <if test=" null != status ">and `status` = #{status}</if>
  58. <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if>
  59. <if test=" null != isDel ">and `is_del` = #{isDel}</if>
  60. <if test=" null != merchantId ">and `merchant_id` = #{merchantId}</if>
  61. <if test=" null != userId ">and `user_id` = #{userId}</if>
  62. <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}</if>
  63. <if test=" null != shopId ">and `shop_id` = #{shopId}</if>
  64. <if test=" null != updatetime ">and `updatetime` = #{updatetime}</if>
  65. <if test=" null != name ">and `name` = #{name}</if>
  66. <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if>
  67. <if test=" null != payWay ">and `pay_way` = #{payWay}</if>
  68. <if test=" null != ids ">
  69. and id in
  70. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  71. #{idItem}
  72. </foreach>
  73. </if>
  74. <if test=" null != sortColumns">order by ${sortColumns}</if>
  75. </sql>
  76. <select id="findList" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultMap="BaseResultMap">
  77. select
  78. <include refid="allColumns"/>
  79. from wx_bill_other_deposit
  80. <include refid="dynamicWhereConditions"/>
  81. </select>
  82. <select id="queryBillList" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultMap="BaseResultMap">
  83. select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,
  84. br.`owe`,br.`status`,m.`name` merchant_name,br.shop_name,br.`updatetime`,br.`return_price`,br.`merchant_id`,
  85. br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,
  86. br.shop_id,br.name,br.comments,br.`rent_shop_type`,br.pay_way,br.`starttime`,br.`endtime`,br.freeze,br.service_charge_pay
  87. from wx_bill_other_deposit br left join wx_merchant m on br.merchant_id=m.id
  88. <where>
  89. <if test=" null != id ">and br.`id` = #{id}</if>
  90. <if test=" null != freeze ">and br.`freeze` = #{freeze}</if>
  91. <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if>
  92. <if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if>
  93. <if test=" null != status ">and br.`status` = #{status}</if>
  94. <if test=" null != applyStatus ">and br.`apply_status` = #{applyStatus}</if>
  95. <if test=" null != isDel ">and br.`is_del` = #{isDel}</if>
  96. <if test=" null != name and ''!=name">and br.`name` = #{name}</if>
  97. <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if>
  98. <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if>
  99. <if test=" null != comments and ''!=comments">and br.`comments` like concat('%',#{comments},'%')</if>
  100. <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}</if>
  101. </where>
  102. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  103. <if test=" null == sortColumns"> order by id desc </if>
  104. </select>
  105. <update id="updateNotPaidStatus" parameterType="hashmap">
  106. update wx_bill_other_deposit set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date)
  107. where status!=#{paid}
  108. <if test=" null != tenantId and '' != tenantId">
  109. and `tenant_id` = #{tenantId}
  110. </if>
  111. <if test=" null != parentTenantId and '' != parentTenantId">
  112. and `parent_tenant_id` = #{parentTenantId}
  113. </if>
  114. and status!=5 and DATEDIFF(now(),receive_date)>0
  115. </update>
  116. <update id="updateWaitPayStatus" parameterType="hashmap">
  117. update wx_bill_other_deposit set status=#{waitPay}
  118. where 1=1
  119. <if test=" null != tenantId and '' != tenantId">
  120. and `tenant_id` = #{tenantId}
  121. </if>
  122. <if test=" null != parentTenantId and '' != parentTenantId">
  123. and `parent_tenant_id` = #{parentTenantId}
  124. </if>
  125. and status!=5
  126. and status!=#{paid} and DATEDIFF(now(),receive_date) &lt;=0
  127. </update>
  128. </mapper>