后台服务
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

WxScreenAdMapper.xml 3.7 KiB

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