Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

128 wiersze
5.3 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.WxCardInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCardInfo">
  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="coupon_id" jdbcType="BIGINT" property="couponId" />
  9. <result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
  10. <result column="owner_user_id" jdbcType="BIGINT" property="ownerUserId" />
  11. <result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
  12. <result column="amount" jdbcType="INTEGER" property="amount" />
  13. <result column="sale_amount" jdbcType="INTEGER" property="saleAmount" />
  14. <result column="remaining_amount" jdbcType="INTEGER" property="remainingAmount" />
  15. <result column="service_fee_amount" jdbcType="INTEGER" property="serviceFeeAmount" />
  16. <result column="share_fee_amount" jdbcType="INTEGER" property="shareFeeAmount" />
  17. <result column="remaining_share_fee_amount" jdbcType="INTEGER" property="remainingShareFeeAmount" />
  18. <result column="rate_amount" jdbcType="INTEGER" property="rateAmount" />
  19. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  20. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  21. <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/>
  22. <result column="coupon_password_id" jdbcType="BIGINT" property="couponPasswordId"/>
  23. <result column="coupon_password" jdbcType="VARCHAR" property="couponPassword"/>
  24. </resultMap>
  25. <sql id="allColumns">
  26. `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`c_user_id`,`owner_user_id`,`coupon_password_id`,`coupon_password`,`transaction_id`,
  27. `amount`,`sale_amount`,`remaining_amount`,`service_fee_amount`,`share_fee_amount`,`remaining_share_fee_amount`,
  28. `rate_amount`,`create_date`,`update_date`,`support_transfer`
  29. </sql>
  30. <sql id="dynamicWhereConditions">
  31. where `tenant_id` = #{tenantId}
  32. <if test=" null != id ">
  33. and `id` = #{id}
  34. </if>
  35. <if test=" null != parentTenantId and '' != parentTenantId">
  36. and `parent_tenant_id` = #{parentTenantId}
  37. </if>
  38. <if test=" null != couponId ">
  39. and `coupon_id` = #{couponId}
  40. </if>
  41. <if test=" null != cUserId ">
  42. and `c_user_id` = #{cUserId}
  43. </if>
  44. <if test=" null != ownerUserId ">
  45. and `owner_user_id` = #{ownerUserId}
  46. </if>
  47. <if test=" null != transactionId ">
  48. and `transaction_id` = #{transactionId}
  49. </if>
  50. <if test=" null != amount ">
  51. and `amount` = #{amount}
  52. </if>
  53. <if test=" null != saleAmount ">
  54. and `sale_amount` = #{saleAmount}
  55. </if>
  56. <if test=" null != remainingAmount ">
  57. and `remaining_amount` = #{remainingAmount}
  58. </if>
  59. <if test=" null != serviceFeeAmount ">
  60. and `service_fee_amount` = #{serviceFeeAmount}
  61. </if>
  62. <if test=" null != shareFeeAmount ">
  63. and `share_fee_amount` = #{shareFeeAmount}
  64. </if>
  65. <if test=" null != remainingShareFeeAmount ">
  66. and `remaining_share_fee_amount` = #{remainingShareFeeAmount}
  67. </if>
  68. <if test=" null != rateAmount ">
  69. and `rate_amount` = #{rateAmount}
  70. </if>
  71. <if test=" null != createDate ">
  72. and `create_date` = #{createDate}
  73. </if>
  74. <if test=" null != updateDate ">
  75. and `update_date` = #{updateDate}
  76. </if>
  77. <if test=" null != couponPasswordId">
  78. and `coupon_password_id` = #{couponPasswordId}
  79. </if>
  80. <if test=" null != couponPasswordIdLike">
  81. and `coupon_password_id` like concat('%',#{couponPasswordIdLike},'%')
  82. </if>
  83. <if test=" null != couponPassword">
  84. and `coupon_password` like concat('%',#{couponPassword},'%')
  85. </if>
  86. <if test=" null != startdate and null!=enddate">
  87. and `create_date` between #{startdate} and #{enddate}
  88. </if>
  89. <if test=" null != couponPasswordIdList ">
  90. and coupon_password_id in
  91. <foreach collection="couponPasswordIdList" index="index" item="cpidItem" open="(" separator="," close=")">
  92. #{cpidItem}
  93. </foreach>
  94. </if>
  95. <if test=" null != couponIdList ">
  96. and coupon_id in
  97. <foreach collection="couponIdList" index="index" item="cidItem" open="(" separator="," close=")">
  98. #{cidItem}
  99. </foreach>
  100. </if>
  101. <if test=" null != ids ">
  102. and id in
  103. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  104. #{idItem}
  105. </foreach>
  106. </if>
  107. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  108. </sql>
  109. <update id="updateTransferStatusByCouponId" parameterType="Long">
  110. update wx_card_info set support_transfer=0,update_date=now() where support_transfer=1 and coupon_id=#{couponId}
  111. </update>
  112. <select id="findList" parameterType="com.iformall.domain.po.WxCardInfo" resultMap="BaseResultMap">
  113. select <include refid="allColumns" />
  114. from wx_card_info
  115. <include refid="dynamicWhereConditions" />
  116. </select>
  117. <select id="findIdList" parameterType="com.iformall.domain.po.WxCardInfo" resultType="Long">
  118. select id from wx_card_info
  119. <include refid="dynamicWhereConditions" />
  120. </select>
  121. </mapper>