Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

208 строки
8.5 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="coupon_id" jdbcType="BIGINT" property="couponId" />
  8. <result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
  9. <result column="amount" jdbcType="INTEGER" property="amount" />
  10. <result column="sale_amount" jdbcType="INTEGER" property="saleAmount" />
  11. <result column="remaining_amount" jdbcType="INTEGER" property="remainingAmount" />
  12. <result column="service_fee_amount" jdbcType="INTEGER" property="serviceFeeAmount" />
  13. <result column="share_fee_amount" jdbcType="INTEGER" property="shareFeeAmount" />
  14. <result column="remaining_share_fee_amount" jdbcType="INTEGER" property="remainingShareFeeAmount" />
  15. <result column="rate_amount" jdbcType="INTEGER" property="rateAmount" />
  16. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  17. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  18. <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/>
  19. </resultMap>
  20. <sql id="allColumns">
  21. `id`,`tenant_id`,`coupon_id`,`transaction_id`,
  22. `amount`,`sale_amount`,`remaining_amount`,`service_fee_amount`,
  23. `share_fee_amount`,`remaining_share_fee_amount`, `rate_amount`,
  24. `create_date`,`update_date`,`support_transfer`
  25. </sql>
  26. <sql id="dynamicWhereConditions">
  27. where 1 = 1
  28. <if test=" null != id ">
  29. and `id` = #{id}
  30. </if>
  31. <if test=" null != tenantId ">
  32. and `tenant_id` = #{tenantId}
  33. </if>
  34. <if test=" null != couponId ">
  35. and `coupon_id` = #{couponId}
  36. </if>
  37. <if test=" null != transactionId ">
  38. and `transaction_id` = #{transactionId}
  39. </if>
  40. <if test=" null != amount ">
  41. and `amount` = #{amount}
  42. </if>
  43. <if test=" null != saleAmount ">
  44. and `sale_amount` = #{saleAmount}
  45. </if>
  46. <if test=" null != remainingAmount ">
  47. and `remaining_amount` = #{remainingAmount}
  48. </if>
  49. <if test=" null != serviceFeeAmount ">
  50. and `service_fee_amount` = #{serviceFeeAmount}
  51. </if>
  52. <if test=" null != shareFeeAmount ">
  53. and `share_fee_amount` = #{shareFeeAmount}
  54. </if>
  55. <if test=" null != remainingShareFeeAmount ">
  56. and `remaining_share_fee_amount` = #{remainingShareFeeAmount}
  57. </if>
  58. <if test=" null != rateAmount ">
  59. and `rate_amount` = #{rateAmount}
  60. </if>
  61. <if test=" null != createDate ">
  62. and `create_date` = #{createDate}
  63. </if>
  64. <if test=" null != updateDate ">
  65. and `update_date` = #{updateDate}
  66. </if>
  67. <if test=" null != startdate and null!=enddate">
  68. and `create_date` between #{startdate} and #{enddate}
  69. </if>
  70. <if test=" null != ids ">
  71. and id in
  72. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  73. #{idItem}
  74. </foreach>
  75. </if>
  76. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  77. </sql>
  78. <resultMap id="VoBaseResultMap" type="com.iformall.domain.vo.WxCardVo">
  79. <id column="id" jdbcType="BIGINT" property="id" />
  80. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  81. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  82. <result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
  83. <result column="amount" jdbcType="INTEGER" property="amount" />
  84. <result column="sale_amount" jdbcType="INTEGER" property="saleAmount" />
  85. <result column="remaining_amount" jdbcType="INTEGER" property="remainingAmount" />
  86. <result column="service_fee_amount" jdbcType="INTEGER" property="serviceFeeAmount" />
  87. <result column="share_fee_amount" jdbcType="INTEGER" property="shareFeeAmount" />
  88. <result column="remaining_share_fee_amount" jdbcType="INTEGER" property="remainingShareFeeAmount" />
  89. <result column="rate_amount" jdbcType="INTEGER" property="rateAmount" />
  90. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  91. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  92. <result column="cover_img" jdbcType="VARCHAR" property="coverImg" />
  93. <result column="cover_picture" jdbcType="VARCHAR" property="coverPicture" />
  94. <result column="detail_picture" jdbcType="VARCHAR" property="detailPicture" />
  95. <result column="title" jdbcType="VARCHAR" property="title" />
  96. <result column="sub_title" jdbcType="VARCHAR" property="subTitle" />
  97. <result column="detail" jdbcType="VARCHAR" property="detail" />
  98. <result column="unit" jdbcType="INTEGER" property="unit" />
  99. <result column="remark" jdbcType="VARCHAR" property="remark" />
  100. <result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
  101. <result column="price" jdbcType="INTEGER" property="price"/>
  102. <result column="subsidy_type" jdbcType="INTEGER" property="subsidyType"/>
  103. <result column="subsidy_num" jdbcType="INTEGER" property="subsidyNum"/>
  104. <result column="c_user_id" jdbcType="BIGINT" property="cuserId" />
  105. <result column="owner_id" jdbcType="BIGINT" property="ownerId" />
  106. <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime" />
  107. <result column="status" jdbcType="INTEGER" property="status"/>
  108. <result column="c_nick_name" jdbcType="VARCHAR" property="cnickName"/>
  109. <result column="o_nick_name" jdbcType="VARCHAR" property="onickName"/>
  110. <result column="ou_phone" jdbcType="VARCHAR" property="ouPhone"/>
  111. </resultMap>
  112. <sql id="allVoColumns">
  113. ci.`id`,ci.`tenant_id`,ci.`coupon_id`,ci.`transaction_id`,
  114. ci.`amount`,ci.`sale_amount`,ci.`remaining_amount`,ci.`service_fee_amount`,
  115. ci.`share_fee_amount`,ci.`remaining_share_fee_amount`, ci.`rate_amount`,
  116. ci.`create_date`,ci.`update_date`,
  117. c.`cover_img`, c.`cover_picture`,c.`detail_picture`,c.`title`, c.`sub_title`, c.`detail`, c.`unit`, c.`remark`, c.`sale_price`, c.`price`, c.`subsidy_type`, c.`subsidy_num`,
  118. co.`c_user_id`, co.`owner_id`, co.`expired_time`, co.`coupon_order_status` as status,
  119. cu.`nick_name` as c_nick_name, ou.`nick_name` as o_nick_name, ou.`phone` as ou_phone
  120. </sql>
  121. <sql id="dynamicVoWhereConditions">
  122. where 1 = 1
  123. <if test=" null != id ">
  124. and ci.`id` = #{id}
  125. </if>
  126. <if test=" null != tenantId ">
  127. and ci.`tenant_id` = #{tenantId}
  128. </if>
  129. <if test=" null != couponId ">
  130. and ci.`coupon_id` = #{couponId}
  131. </if>
  132. <if test=" null != transactionId ">
  133. and ci.`transaction_id` = #{transactionId}
  134. </if>
  135. <if test=" null != amount ">
  136. and ci.`amount` = #{amount}
  137. </if>
  138. <if test=" null != saleAmount ">
  139. and ci.`sale_amount` = #{saleAmount}
  140. </if>
  141. <if test=" null != remainingAmount ">
  142. and ci.`remaining_amount` = #{remainingAmount}
  143. </if>
  144. <if test=" null != serviceFeeAmount ">
  145. and ci.`service_fee_amount` = #{serviceFeeAmount}
  146. </if>
  147. <if test=" null != shareFeeAmount ">
  148. and ci.`share_fee_amount` = #{shareFeeAmount}
  149. </if>
  150. <if test=" null != remainingShareFeeAmount ">
  151. and ci.`remaining_share_fee_amount` = #{remainingShareFeeAmount}
  152. </if>
  153. <if test=" null != rateAmount ">
  154. and ci.`rate_amount` = #{rateAmount}
  155. </if>
  156. <if test=" null != createDate ">
  157. and ci.`create_date` = #{createDate}
  158. </if>
  159. <if test=" null != updateDate ">
  160. and ci.`update_date` = #{updateDate}
  161. </if>
  162. <if test=" null != status ">
  163. and co.`coupon_order_status` = #{status}
  164. </if>
  165. <if test=" null != ouPhone and '' != ouPhone">
  166. and ou.`phone` = #{ouPhone}
  167. </if>
  168. <if test=" null != startdate and null!=enddate">
  169. and ci.`create_date` between #{startdate} and #{enddate}
  170. </if>
  171. <if test=" null != statusS ">
  172. and co.`coupon_order_status` in
  173. <foreach collection="statusS" index="index" item="sItem" open="(" separator="," close=")">
  174. #{sItem}
  175. </foreach>
  176. </if>
  177. <if test=" null != ids ">
  178. and ci.id in
  179. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  180. #{idItem}
  181. </foreach>
  182. </if>
  183. order by ci.id desc
  184. </sql>
  185. <select id="findVoList" parameterType="com.iformall.domain.vo.WxCardVo" resultMap="VoBaseResultMap">
  186. select <include refid="allVoColumns" />
  187. from wx_card_info ci
  188. left join wx_coupon c on c.id = ci.coupon_id
  189. left join wx_coupon_order co on co.id = ci.id
  190. left join wx_c_user cu on cu.id = co.c_user_id
  191. left join wx_c_user ou on ou.id = co.owner_id
  192. <include refid="dynamicVoWhereConditions" />
  193. </select>
  194. </mapper>