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

100 строки
3.2 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.WxScreenAdMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxScreenAd">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="title" jdbcType="VARCHAR" property="title"/>
  8. <result column="type" jdbcType="INTEGER" property="type"/>
  9. <result column="sub_type" jdbcType="INTEGER" property="subType"/>
  10. <result column="status" jdbcType="INTEGER" property="status"/>
  11. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  12. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  13. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  14. <result column="target_id" jdbcType="BIGINT" property="targetId"/>
  15. </resultMap>
  16. <sql id="allColumns">
  17. `id`, `tenant_id`, `title`, `type`, `sub_type`, `status`, `create_date`, `update_date`, `cover_img`, `target_id`
  18. </sql>
  19. <sql id="dynamicWhereConditions">
  20. where 1 = 1
  21. <if test=" null != id ">
  22. and `id` = #{id}
  23. </if>
  24. <if test=" null != tenantId ">
  25. and `tenant_id` = #{tenantId}
  26. </if>
  27. <if test=" null != title and ''!=title">
  28. and `title` like concat('%', #{title},'%')
  29. </if>
  30. <if test=" null != type ">
  31. and `type` = #{type}
  32. </if>
  33. <if test=" null != subType ">
  34. and `sub_type` = #{subType}
  35. </if>
  36. <if test=" null != status ">
  37. and `status` = #{status}
  38. </if>
  39. <if test=" null != createDate ">
  40. and `create_date` = #{createDate}
  41. </if>
  42. <if test=" null != updateDate ">
  43. and `update_date` = #{updateDate}
  44. </if>
  45. <if test=" null != coverImg ">
  46. and `cover_img` = #{coverImg}
  47. </if>
  48. <if test=" null != targetId ">
  49. and `target_id` = #{targetId}
  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.WxScreenAd" resultMap="BaseResultMap">
  60. select
  61. <include refid="allColumns"/>
  62. from wx_screen_ad
  63. <include refid="dynamicWhereConditions"/>
  64. </select>
  65. <update id="updateStatusByCouponChannelId" parameterType="com.iformall.domain.po.WxScreenAd">
  66. update wx_screen_ad sa
  67. set sa.status = #{status}, sa.update_date = #{updateDate}
  68. where sa.target_id = #{targetId}
  69. <if test=" null != tenantId ">
  70. and tenant_id = #{tenantId}
  71. </if>
  72. </update>
  73. <update id="offScreeAdByCouponChannelStatus">
  74. update wx_screen_ad sa, wx_coupon_channel cc
  75. SET sa.status = 1, sa.update_date = now()
  76. where sa.status = 0
  77. and sa.target_id = cc.id
  78. and cc.status = 1
  79. </update>
  80. </mapper>