Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

195 lignes
5.8 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.simple.mapper.WxCouponMapper">
  4. <resultMap id="BaseResultMap" type="com.simple.domain.po.WxCoupon">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
  8. <result column="type" jdbcType="INTEGER" property="type" />
  9. <result column="cover_img" jdbcType="VARCHAR" property="coverImg" />
  10. <result column="title" jdbcType="VARCHAR" property="title" />
  11. <result column="sub_title" jdbcType="VARCHAR" property="subTitle" />
  12. <result column="sale_price" jdbcType="DECIMAL" property="salePrice" />
  13. <result column="use_price" jdbcType="DECIMAL" property="usePrice" />
  14. <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity" />
  15. <result column="target_ad" jdbcType="INTEGER" property="targetAd" />
  16. <result column="send_type" jdbcType="INTEGER" property="sendType" />
  17. <result column="send_start_date" jdbcType="TIMESTAMP" property="sendStartDate" />
  18. <result column="send_end_date" jdbcType="TIMESTAMP" property="sendEndDate" />
  19. <result column="valid_type" jdbcType="INTEGER" property="validType" />
  20. <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate" />
  21. <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate" />
  22. <result column="valid_days" jdbcType="INTEGER" property="validDays" />
  23. <result column="detail" jdbcType="VARCHAR" property="detail" />
  24. <result column="price" jdbcType="DECIMAL" property="price" />
  25. <result column="remain_inventory" jdbcType="INTEGER" property="remainInventory" />
  26. <result column="inventory" jdbcType="INTEGER" property="inventory" />
  27. <result column="remark" jdbcType="VARCHAR" property="remark" />
  28. <result column="status" jdbcType="INTEGER" property="status" />
  29. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  30. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  31. <result column="business" jdbcType="VARCHAR" property="business" />
  32. </resultMap>
  33. <sql id="allColumns">
  34. `id`,`tenant_id`,`merchant_id`,`type`,`cover_img`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`target_ad`,`send_type`,`send_start_date`,`send_end_date`,`valid_type`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`price`,`remain_inventory`,`inventory`,`remark`,`status`,`create_date`,`update_date`,`business`
  35. </sql>
  36. <sql id="dynamicWhereConditions">
  37. where 1 = 1
  38. <if test=" null != id ">
  39. and `id` = #{id}
  40. </if>
  41. <if test=" null != tenantId ">
  42. and `tenant_id` like concat('%', #{tenantId},'%')
  43. </if>
  44. <if test=" null != merchantId ">
  45. and `merchant_id` = #{merchantId}
  46. </if>
  47. <if test=" null != type ">
  48. and `type` = #{type}
  49. </if>
  50. <if test=" null != coverImg ">
  51. and `cover_img` like concat('%', #{coverImg},'%')
  52. </if>
  53. <if test=" null != title ">
  54. and `title` like concat('%', #{title},'%')
  55. </if>
  56. <if test=" null != subTitle ">
  57. and `sub_title` like concat('%', #{subTitle},'%')
  58. </if>
  59. <if test=" null != salePrice ">
  60. and `sale_price` = #{salePrice}
  61. </if>
  62. <if test=" null != usePrice ">
  63. and `use_price` = #{usePrice}
  64. </if>
  65. <if test=" null != useLimitQuantity ">
  66. and `use_limit_quantity` = #{useLimitQuantity}
  67. </if>
  68. <if test=" null != targetAd ">
  69. and `target_ad` = #{targetAd}
  70. </if>
  71. <if test=" null != sendType ">
  72. and `send_type` = #{sendType}
  73. </if>
  74. <if test=" null != sendStartDate ">
  75. and `send_start_date` = #{sendStartDate}
  76. </if>
  77. <if test=" null != sendEndDate ">
  78. and `send_end_date` = #{sendEndDate}
  79. </if>
  80. <if test=" null != validType ">
  81. and `valid_type` = #{validType}
  82. </if>
  83. <if test=" null != validStartDate ">
  84. and `valid_start_date` = #{validStartDate}
  85. </if>
  86. <if test=" null != validEndDate ">
  87. and `valid_end_date` = #{validEndDate}
  88. </if>
  89. <if test=" null != validDays ">
  90. and `valid_days` = #{validDays}
  91. </if>
  92. <if test=" null != detail ">
  93. and `detail` like concat('%', #{detail},'%')
  94. </if>
  95. <if test=" null != price ">
  96. and `price` = #{price}
  97. </if>
  98. <if test=" null != remainInventory ">
  99. and `remain_inventory` = #{remainInventory}
  100. </if>
  101. <if test=" null != inventory ">
  102. and `inventory` = #{inventory}
  103. </if>
  104. <if test=" null != remark ">
  105. and `remark` like concat('%', #{remark},'%')
  106. </if>
  107. <if test=" null != status ">
  108. and `status` = #{status}
  109. </if>
  110. <if test=" null != createDate ">
  111. and `create_date` = #{createDate}
  112. </if>
  113. <if test=" null != updateDate ">
  114. and `update_date` = #{updateDate}
  115. </if>
  116. <if test=" null != business ">
  117. and `business` like concat('%', #{business},'%')
  118. </if>
  119. <if test=" null != ids ">
  120. and id in
  121. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  122. #{idItem}
  123. </foreach>
  124. </if>
  125. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  126. </sql>
  127. <select id="findList" parameterType="com.simple.domain.po.WxCoupon" resultMap="BaseResultMap">
  128. select <include refid="allColumns" /> from wx_coupon
  129. <include refid="dynamicWhereConditions" />
  130. </select>
  131. </mapper>