No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 

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