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

122 строки
3.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.simple.mapper.CouponInjectMapper">
  4. <resultMap id="BaseResultMap" type="com.simple.domain.po.CouponInject">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="name" jdbcType="VARCHAR" property="name" />
  8. <result column="m_user_id" jdbcType="BIGINT" property="mUserId" />
  9. <result column="send_type" jdbcType="INTEGER" property="sendType" />
  10. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  11. <result column="coupon_name" jdbcType="VARCHAR" property="couponName" />
  12. <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
  13. <result column="send_amount" jdbcType="INTEGER" property="sendAmount" />
  14. <result column="status" jdbcType="INTEGER" property="status" />
  15. <result column="error_msg" jdbcType="VARCHAR" property="errorMsg" />
  16. <result column="tags" jdbcType="VARCHAR" property="tags" />
  17. <result column="model_id" jdbcType="BIGINT" property="modelId" />
  18. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  19. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  20. </resultMap>
  21. <sql id="allColumns">
  22. `id`,`tenant_id`,`name`,`m_user_id`,`send_type`,`coupon_id`,`coupon_name`,`send_time`,`send_amount`,`status`,`error_msg`,`tags`,`model_id`,`create_time`,`update_time`
  23. </sql>
  24. <sql id="dynamicWhereConditions">
  25. where 1 = 1
  26. <if test=" null != id ">
  27. and `id` = #{id}
  28. </if>
  29. <if test=" null != tenantId ">
  30. and `tenant_id` like concat('%', #{tenantId},'%')
  31. </if>
  32. <if test=" null != name ">
  33. and `name` like concat('%', #{name},'%')
  34. </if>
  35. <if test=" null != mUserId ">
  36. and `m_user_id` like concat('%', #{mUserId},'%')
  37. </if>
  38. <if test=" null != sendType ">
  39. and `send_type` = #{sendType}
  40. </if>
  41. <if test=" null != couponId ">
  42. and `coupon_id` = #{couponId}
  43. </if>
  44. <if test=" null != couponName ">
  45. and `coupon_name` like concat('%', #{couponName},'%')
  46. </if>
  47. <if test=" null != sendTime ">
  48. and `send_time` = #{sendTime}
  49. </if>
  50. <if test=" null != sendTimeStart and null!=sendTimeEnd ">
  51. and `send_time` >= #{sendTimeStart} and `send_time` &lt;= #{sendTimeEnd}
  52. </if>
  53. <if test=" null != sendAmount ">
  54. and `send_amount` = #{sendAmount}
  55. </if>
  56. <if test=" null != status ">
  57. and `status` = #{status}
  58. </if>
  59. <if test=" null != errorMsg ">
  60. and `error_msg` like concat('%', #{errorMsg},'%')
  61. </if>
  62. <if test=" null != tags ">
  63. and `tags` like concat('%', #{tags},'%')
  64. </if>
  65. <if test=" null != createTime ">
  66. and `create_time` = #{createTime}
  67. </if>
  68. <if test=" null != updateTime ">
  69. and `update_time` = #{updateTime}
  70. </if>
  71. <if test=" null != ids ">
  72. and id in
  73. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  74. #{idItem}
  75. </foreach>
  76. </if>
  77. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  78. </sql>
  79. <select id="findList" parameterType="com.simple.domain.po.CouponInject" resultMap="BaseResultMap">
  80. select <include refid="allColumns" /> from coupon_inject
  81. <include refid="dynamicWhereConditions" />
  82. </select>
  83. </mapper>