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

161 строка
7.0 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.TtCouponMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.tt.TtCoupon">
  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="type" jdbcType="INTEGER" property="type"/>
  9. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  10. <result column="cover_picture" jdbcType="VARCHAR" property="coverPicture"/>
  11. <result column="detail_picture" jdbcType="VARCHAR" property="detailPicture"/>
  12. <result column="title" jdbcType="VARCHAR" property="title"/>
  13. <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
  14. <result column="video_id" jdbcType="VARCHAR" property="videoId"/>
  15. <result column="video_time" jdbcType="VARCHAR" property="videoTime"/>
  16. <result column="html" jdbcType="VARCHAR" property="html"/>
  17. <result column="is_landscape" jdbcType="INTEGER" property="isLandscape"/>
  18. <result column="is_payment" jdbcType="INTEGER" property="isPayment"/>
  19. <result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
  20. <result column="orig_price" jdbcType="INTEGER" property="origPrice"/>
  21. <result column="is_preview" jdbcType="INTEGER" property="isPreview"/>
  22. <result column="preview_duration" jdbcType="INTEGER" property="previewDuration"/>
  23. <result column="detail" jdbcType="VARCHAR" property="detail"/>
  24. <result column="false_sell_count" jdbcType="INTEGER" property="falseSellCount"/>
  25. <result column="dy_title" jdbcType="VARCHAR" property="dyTitle"/>
  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="see_count" jdbcType="INTEGER" property="seeCount"/>
  32. <result column="sell_count" jdbcType="INTEGER" property="sellCount"/>
  33. <result column="assess_count" jdbcType="INTEGER" property="assessCount"/>
  34. <result column="collect_count" jdbcType="INTEGER" property="collectCount"/>
  35. <result column="is_del" jdbcType="INTEGER" property="isDel"/>
  36. <result column="column_id" jdbcType="BIGINT" property="columnId"/>
  37. <result column="popularity" jdbcType="INTEGER" property="popularity"/>
  38. <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
  39. <result column="business_id" jdbcType="BIGINT" property="businessId"/>
  40. <result column="business_name" jdbcType="VARCHAR" property="businessName"/>
  41. </resultMap>
  42. <sql id="allColumns">
  43. `id`, `tenant_id`, `parent_tenant_id`, `type`, `cover_img`, `cover_picture`, `detail_picture`,
  44. `title`, `sub_title`, `video_id`, `video_time`, `html`, `is_landscape`, `is_payment`,
  45. `sale_price`, `orig_price`, `is_preview`, `preview_duration`, `detail`, `false_sell_count`,
  46. `dy_title`, `inventory`, `remark`, `status`, `create_date`, `update_date`,
  47. `see_count`, `sell_count`, `assess_count`, `collect_count`, `is_del`,
  48. `column_id`, `popularity`, `merchant_id`, `business_id`, `business_name`
  49. </sql>
  50. <sql id="dynamicWhereConditions">
  51. where `is_del` = 0
  52. <if test=" null != id ">
  53. and `id` = #{id}
  54. </if>
  55. <if test=" null != tenantId and '' != tenantId">
  56. and `tenant_id` = #{tenantId}
  57. </if>
  58. <if test=" null != parentTenantId and '' != parentTenantId">
  59. and `parent_tenant_id` = #{parentTenantId}
  60. </if>
  61. <if test=" null != type ">
  62. and `type` = #{type}
  63. </if>
  64. <if test=" null != title and ''!=title">
  65. and `title` like concat('%', #{title},'%')
  66. </if>
  67. <if test=" null != isLandscape ">
  68. and `is_landscape` = #{isLandscape}
  69. </if>
  70. <if test=" null != isPayment ">
  71. and `is_payment` = #{isPayment}
  72. </if>
  73. <if test=" null != isPreview ">
  74. and `is_preview` = #{isPreview}
  75. </if>
  76. <if test=" null != status">
  77. and `status` = #{status}
  78. </if>
  79. <if test="startdate != null">
  80. and `create_date` &gt;= #{startdate}
  81. </if>
  82. <if test="enddate != null">
  83. and `create_date` &lt;= #{enddate}
  84. </if>
  85. <if test=" null != businessId ">
  86. and `business_id` = #{businessId}
  87. </if>
  88. <if test=" null != merchantId ">
  89. and `merchant_id` = #{merchantId}
  90. </if>
  91. <if test=" null != ids ">
  92. and id in
  93. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  94. #{idItem}
  95. </foreach>
  96. </if>
  97. <if test=" null != sortColumns">order by ${sortColumns}</if>
  98. </sql>
  99. <select id="findList" parameterType="com.iformall.domain.po.tt.TtCoupon" resultMap="BaseResultMap">
  100. select
  101. <include refid="allColumns"/>
  102. from tt_coupon
  103. <include refid="dynamicWhereConditions"/>
  104. </select>
  105. <select id="selectById" parameterType="Long" resultMap="BaseResultMap">
  106. select <include refid="allColumns"/> from tt_coupon where id = #{id}
  107. </select>
  108. <delete id="deleteById" parameterType="Long">
  109. update tt_coupon set is_del = 1, update_date=now() where id = #{id}
  110. </delete>
  111. <update id="addSeeCount" parameterType="Long">
  112. update tt_coupon SET see_count = see_count+1, update_date=now() where id = #{id}
  113. </update>
  114. <update id="addSellCount" parameterType="Long">
  115. update tt_coupon SET sell_count = sell_count+1, false_sell_count = false_sell_count+1, update_date=now() where id = #{id}
  116. </update>
  117. <update id="reduceSellCount" parameterType="Long">
  118. update tt_coupon SET sell_count = sell_count-1, false_sell_count = false_sell_count-1, update_date=now() where id = #{id}
  119. </update>
  120. <update id="addAssessCount" parameterType="Long">
  121. update tt_coupon SET assess_count = assess_count+1, update_date=now() where id = #{id}
  122. </update>
  123. <update id="addCollectCount" parameterType="Long">
  124. update tt_coupon SET collect_count = collect_count+1, update_date=now() where id = #{id}
  125. </update>
  126. <update id="reduceCollectCount" parameterType="Long">
  127. update tt_coupon SET collect_count = collect_count-1, update_date=now() where id = #{id}
  128. </update>
  129. <update id="addPopularity" parameterType="java.util.HashMap">
  130. update tt_coupon SET popularity = popularity+#{popularity}, update_date=now() where id = #{id}
  131. </update>
  132. </mapper>