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

144 строки
5.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.WxCampaignMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCampaign">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  8. <result column="cover_picture" jdbcType="VARCHAR" property="coverPicture"/>
  9. <result column="title" jdbcType="VARCHAR" property="title"/>
  10. <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
  11. <result column="use_price" jdbcType="INTEGER" property="usePrice"/>
  12. <result column="discount_price" jdbcType="INTEGER" property="discountPrice"/>
  13. <result column="detail" jdbcType="VARCHAR" property="detail"/>
  14. <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/>
  15. <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/>
  16. <result column="img_detail" jdbcType="VARCHAR" property="imgDetail"/>
  17. <result column="type" jdbcType="INTEGER" property="type"/>
  18. <result column="coupon_ids" jdbcType="VARCHAR" property="couponIds"/>
  19. <result column="mechant_id" jdbcType="BIGINT" property="mechantId"/>
  20. <result column="sort_num" jdbcType="INTEGER" property="sortNum"/>
  21. <result column="status" jdbcType="INTEGER" property="status"/>
  22. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  23. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  24. <result column="html" jdbcType="VARCHAR" property="html"/>
  25. </resultMap>
  26. <sql id="allColumns">
  27. `id`,`tenant_id`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`sub_title`,`use_price`,`discount_price`,`detail`,`valid_start_date`,`valid_end_date`,`img_detail`,`type`,`coupon_ids`,
  28. `mechant_id`,`sort_num`,`status`,`create_time`,`update_time`,`html`
  29. </sql>
  30. <sql id="allCHeadColumns">
  31. `id`,`tenant_id`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`type`,`sort_num`
  32. </sql>
  33. <sql id="allAHeadColumns">
  34. `id`,`tenant_id`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`sub_title`,`use_price`,`discount_price`,`detail`,`valid_start_date`,`valid_end_date`,`img_detail`,`type`,`coupon_ids`,
  35. `mechant_id`,`sort_num`,`status`,`create_time`,`update_time`
  36. </sql>
  37. <sql id="dynamicWhereConditions">
  38. where 1 = 1
  39. <if test=" null != id ">
  40. and `id` = #{id}
  41. </if>
  42. <if test=" null != tenantId ">
  43. and `tenant_id` = #{tenantId}
  44. </if>
  45. <if test=" null != coverImg ">
  46. and `cover_img` like concat('%', #{coverImg},'%')
  47. </if>
  48. <if test=" null != title ">
  49. and `title` like concat('%', #{title},'%')
  50. </if>
  51. <if test=" null != subTitle ">
  52. and `sub_title` like concat('%', #{subTitle},'%')
  53. </if>
  54. <if test=" null != usePrice ">
  55. and `use_price` = #{usePrice}
  56. </if>
  57. <if test=" null != discountPrice ">
  58. and `discount_price` = #{discountPrice}
  59. </if>
  60. <if test=" null != detail ">
  61. and `detail` like concat('%', #{detail},'%')
  62. </if>
  63. <if test=" null != validStartDate ">
  64. and `valid_start_date` = #{validStartDate}
  65. </if>
  66. <if test=" null != validEndDate ">
  67. and `valid_end_date` = #{validEndDate}
  68. </if>
  69. <if test=" null != imgDetail ">
  70. and `img_detail` like concat('%', #{imgDetail},'%')
  71. </if>
  72. <if test=" null != type ">
  73. and `type` = #{type}
  74. </if>
  75. <if test=" null != couponIds ">
  76. and `coupon_ids` like concat('%', #{couponIds},'%')
  77. </if>
  78. <if test=" null != mechantId ">
  79. and `mechant_id` = #{mechantId}
  80. </if>
  81. <if test=" null != sortNum ">
  82. and `sort_num` = #{sortNum}
  83. </if>
  84. <if test=" null != status ">
  85. and `status` = #{status}
  86. </if>
  87. <if test=" null != createTime ">
  88. and `create_time` = #{createTime}
  89. </if>
  90. <if test=" null != updateTime ">
  91. and `update_time` = #{updateTime}
  92. </if>
  93. <if test=" null != ids ">
  94. and id in
  95. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  96. #{idItem}
  97. </foreach>
  98. </if>
  99. <if test=" null != sortColumns">order by ${sortColumns}</if>
  100. </sql>
  101. <select id="findList" parameterType="com.iformall.domain.po.WxCampaign" resultMap="BaseResultMap">
  102. select
  103. <include refid="allAHeadColumns"/>
  104. from wx_campaign
  105. <include refid="dynamicWhereConditions"/>
  106. </select>
  107. <select id="findCList" parameterType="com.iformall.domain.po.WxCampaign" resultMap="BaseResultMap">
  108. select
  109. <include refid="allCHeadColumns"/>
  110. from wx_campaign
  111. <include refid="dynamicWhereConditions"/>
  112. </select>
  113. <select id="getMaxSortNum" parameterType="java.lang.String" resultType="java.lang.Integer">
  114. select max(sort_num) from wx_campaign where `tenant_id` = #{tenantId}
  115. </select>
  116. </mapper>