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

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