后台服务
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

123 行
4.3 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.TtCouponChannelPoiMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.TtCouponChannelPoi">
  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_channel_id" jdbcType="BIGINT" property="couponChannelId"/>
  9. <result column="spu_id" jdbcType="VARCHAR" property="spuId"/>
  10. <result column="status" jdbcType="INTEGER" property="status"/>
  11. <result column="status_desc" jdbcType="VARCHAR" property="statusDesc"/>
  12. <result column="last_status" jdbcType="INTEGER" property="lastStatus"/>
  13. <result column="last_status_desc" jdbcType="VARCHAR" property="lastStatusDesc"/>
  14. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  15. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  16. </resultMap>
  17. <sql id="allColumns">
  18. `id`,`tenant_id`,`parent_tenant_id`,`coupon_channel_id`,`spu_id`,
  19. `status`,`status_desc`,`last_status`,`last_status_desc`,
  20. `create_date`,`update_date`
  21. </sql>
  22. <sql id="dynamicWhereConditions">
  23. where is_del = 0
  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 != couponChannelId ">
  34. and `coupon_channel_id` = #{couponChannelId}
  35. </if>
  36. <if test=" null != spuId and '' != spuId">
  37. and `spu_id` = #{spuId}
  38. </if>
  39. <if test=" null != status">
  40. and `status` = #{status}
  41. </if>
  42. <if test=" null != lastStatus">
  43. and `last_status` = #{lastStatus}
  44. </if>
  45. <if test=" null != ids ">
  46. and `id` in
  47. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  48. #{idItem}
  49. </foreach>
  50. </if>
  51. <if test=" null != sortColumns">order by ${sortColumns}</if>
  52. </sql>
  53. <select id="findList" parameterType="com.iformall.domain.po.TtCouponChannelPoi" resultMap="BaseResultMap">
  54. select
  55. <include refid="allColumns"/>
  56. from tt_coupon_channel_poi
  57. <include refid="dynamicWhereConditions"/>
  58. </select>
  59. <select id="selectById" resultMap="BaseResultMap">
  60. select
  61. <include refid="allColumns"/>
  62. from tt_coupon_channel_poi
  63. where `id` = #{id}
  64. </select>
  65. <select id="selectByChannelId" resultMap="BaseResultMap">
  66. select
  67. <include refid="allColumns"/>
  68. from tt_coupon_channel_poi
  69. where `coupon_channel_id` = #{couponChannelId}
  70. </select>
  71. <select id="findIdList" parameterType="com.iformall.domain.po.TtCouponChannelPoi" resultType="Long">
  72. select id
  73. from tt_coupon_channel_poi
  74. <include refid="dynamicWhereConditions"/>
  75. </select>
  76. <update id="deleteByUpdate" parameterType="Long">
  77. update tt_coupon_channel_poi set is_del = 1
  78. where id = #{id}
  79. </update>
  80. <select id="getPoiPutOnCount" resultType="Integer">
  81. select count(1)
  82. from tt_coupon_channel_poi
  83. where is_del = 0
  84. and `tenant_id` = #{tenantId}
  85. and `status` = 1
  86. and `id` in
  87. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  88. #{idItem}
  89. </foreach>
  90. </select>
  91. <update id="updateBySpuId" parameterType="com.iformall.domain.po.TtCouponChannelPoi">
  92. update tt_coupon_channel_poi set update_date = now()
  93. <if test=" null != status ">,`status` = #{status}</if>
  94. <if test=" null != statusDesc ">,`last_status` = #{statusDesc}</if>
  95. <if test=" null != lastStatus ">,`last_status` = #{lastStatus}</if>
  96. <if test=" null != lastStatusDesc ">,`last_status_desc` = #{lastStatusDesc}</if>
  97. where `spu_id` = #{spuId}
  98. </update>
  99. </mapper>