后台服务
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.

95 lines
2.9 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.WxCouponSendInjectMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCouponSendInject">
  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="user_id" jdbcType="BIGINT" property="userId" />
  10. <result column="send_status" jdbcType="INTEGER" property="sendStatus" />
  11. <result column="send_msg" jdbcType="INTEGER" property="sendMsg" />
  12. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  13. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  14. <result column="order_id" jdbcType="BIGINT" property="orderId" />
  15. <result column="coupon_order_id" jdbcType="BIGINT" property="couponOrderId" />
  16. <result column="msg_model" jdbcType="VARCHAR" property="msgModel" />
  17. </resultMap>
  18. <sql id="allColumns">
  19. `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`user_id`,`send_status`,`send_msg`,`create_time`,`update_time`,
  20. `order_id`,`coupon_order_id`,`msg_model`
  21. </sql>
  22. <sql id="dynamicWhereConditions">
  23. where 1 = 1
  24. <if test=" null != id ">
  25. and `id` = #{id}
  26. </if>
  27. <if test=" null != tenantId and '' != tenantId">
  28. and `tenant_id` = #{tenantId}
  29. </if>
  30. <if test=" null != parentTenantId and '' != parentTenantId">
  31. and `parent_tenant_id` = #{parentTenantId}
  32. </if>
  33. <if test=" null != couponId ">
  34. and `coupon_id` = #{couponId}
  35. </if>
  36. <if test=" null != userId ">
  37. and `user_id` = #{userId}
  38. </if>
  39. <if test=" null != sendStatus ">
  40. and `send_status` = #{sendStatus}
  41. </if>
  42. <if test=" null != sendMsg ">
  43. and `send_msg` = #{sendMsg}
  44. </if>
  45. <if test=" null != orderId ">
  46. and `order_id` = #{orderId}
  47. </if>
  48. <if test=" null != couponOrderId ">
  49. and `coupon_order_id` = #{couponOrderId}
  50. </if>
  51. <if test=" null != ids ">
  52. and id in
  53. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  54. #{idItem}
  55. </foreach>
  56. </if>
  57. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  58. </sql>
  59. <select id="findList" parameterType="com.iformall.domain.po.WxCouponSendInject" resultMap="BaseResultMap">
  60. select
  61. <include refid="allColumns"/>
  62. from wx_coupon_send_inject
  63. <include refid="dynamicWhereConditions" />
  64. </select>
  65. <update id="updateMsgByUserIds" parameterType="hashmap">
  66. update wx_coupon_send_inject set `send_msg` = 1
  67. where `user_id` in
  68. <foreach collection="userIds" index="index" item="idItem" open="(" separator="," close=")">
  69. #{idItem}
  70. </foreach>
  71. </update>
  72. </mapper>