后台服务
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

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