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

100 строки
3.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.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. <result column="ext_info" jdbcType="VARCHAR" property="extInfo"/>
  16. </resultMap>
  17. <sql id="allColumns">
  18. `id`, `tenant_id`, `title`, `type`, `sub_type`, `status`, `create_date`, `update_date`, `cover_img`, `target_id`, `ext_info`
  19. </sql>
  20. <sql id="dynamicWhereConditions">
  21. where 1 = 1
  22. <if test=" null != id ">
  23. and `id` = #{id}
  24. </if>
  25. <if test=" null != tenantId ">
  26. and `tenant_id` = #{tenantId}
  27. </if>
  28. <if test=" null != title and ''!=title">
  29. and `title` like concat('%', #{title},'%')
  30. </if>
  31. <if test=" null != type ">
  32. and `type` = #{type}
  33. </if>
  34. <if test=" null != subType ">
  35. and `sub_type` = #{subType}
  36. </if>
  37. <if test=" null != status ">
  38. and `status` = #{status}
  39. </if>
  40. <if test=" null != createDate ">
  41. and `create_date` = #{createDate}
  42. </if>
  43. <if test=" null != updateDate ">
  44. and `update_date` = #{updateDate}
  45. </if>
  46. <if test=" null != coverImg ">
  47. and `cover_img` = #{coverImg}
  48. </if>
  49. <if test=" null != targetId ">
  50. and `target_id` = #{targetId}
  51. </if>
  52. <if test=" null != ids ">
  53. and id in
  54. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  55. #{idItem}
  56. </foreach>
  57. </if>
  58. <if test=" null != sortColumns">order by ${sortColumns}</if>
  59. </sql>
  60. <select id="findList" parameterType="com.iformall.domain.po.WxScreenAd" resultMap="BaseResultMap">
  61. select
  62. <include refid="allColumns"/>
  63. from wx_screen_ad
  64. <include refid="dynamicWhereConditions"/>
  65. </select>
  66. <update id="updateStatusByCouponChannelId" parameterType="com.iformall.domain.po.WxScreenAd">
  67. update wx_screen_ad sa
  68. set sa.status = #{status}, sa.update_date = #{updateDate}
  69. where sa.target_id = #{targetId}
  70. <if test=" null != tenantId ">
  71. and tenant_id = #{tenantId}
  72. </if>
  73. </update>
  74. <update id="offScreeAdByCouponChannelStatus">
  75. update wx_screen_ad sa, wx_coupon_channel cc
  76. SET sa.status = 1, sa.update_date = now()
  77. where sa.status = 0
  78. and sa.target_id = cc.id
  79. and cc.status = 1
  80. </update>
  81. </mapper>