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.
 
 
 
 
 

109 lines
2.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.WxCouponSendMapper">
  4. <resultMap id="BaseResultMap" type="com.simple.domain.po.WxCouponSend">
  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="coupon_id" jdbcType="BIGINT" property="couponId" />
  9. <result column="type" jdbcType="INTEGER" property="type" />
  10. <result column="title" jdbcType="VARCHAR" property="title" />
  11. <result column="send_type" jdbcType="INTEGER" property="sendType" />
  12. <result column="status" jdbcType="INTEGER" property="status" />
  13. <result column="send_start_time" jdbcType="TIMESTAMP" property="sendStartTime" />
  14. <result column="send_end_time" jdbcType="TIMESTAMP" property="sendEndTime" />
  15. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  16. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  17. </resultMap>
  18. <sql id="allColumns">
  19. `id`,`tenant_id`,`merchant_id`,`coupon_id`,`type`,`title`,`send_type`,`status`,`send_start_time`,`send_end_time`,`create_date`,`update_date`
  20. </sql>
  21. <sql id="dynamicWhereConditions">
  22. where 1 = 1
  23. <if test=" null != id ">
  24. and `id` = #{id}
  25. </if>
  26. <if test=" null != tenantId ">
  27. and `tenant_id` like concat('%', #{tenantId},'%')
  28. </if>
  29. <if test=" null != merchantId ">
  30. and `merchant_id` = #{merchantId}
  31. </if>
  32. <if test=" null != couponId ">
  33. and `coupon_id` = #{couponId}
  34. </if>
  35. <if test=" null != type ">
  36. and `type` = #{type}
  37. </if>
  38. <if test=" null != title ">
  39. and `title` like concat('%', #{title},'%')
  40. </if>
  41. <if test=" null != sendType ">
  42. and `send_type` = #{sendType}
  43. </if>
  44. <if test=" null != status ">
  45. and `status` = #{status}
  46. </if>
  47. <if test=" null != sendStartTime ">
  48. and `send_start_time` = #{sendStartTime}
  49. </if>
  50. <if test=" null != sendEndTime ">
  51. and `send_end_time` = #{sendEndTime}
  52. </if>
  53. <if test=" null != status and status==0">
  54. and `send_end_time` &gt;= NOW()
  55. and `send_start_time` &lt;= NOW()
  56. </if>
  57. <if test=" null != createDate ">
  58. and `create_date` = #{createDate}
  59. </if>
  60. <if test=" null != updateDate ">
  61. and `update_date` = #{updateDate}
  62. </if>
  63. <if test=" null != ids ">
  64. and id in
  65. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  66. #{idItem}
  67. </foreach>
  68. </if>
  69. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  70. </sql>
  71. <select id="findList" parameterType="com.simple.domain.po.WxCouponSend" resultMap="BaseResultMap">
  72. select <include refid="allColumns" /> from wx_coupon_send
  73. <include refid="dynamicWhereConditions" />
  74. </select>
  75. </mapper>