您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

147 行
3.9 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. </resultMap>
  24. <sql id="allColumns">
  25. `id`,`tenant_id`,`cover_img`,`title`,`sub_title`,`use_price`,`discount_price`,`detail`,`valid_start_date`,`valid_end_date`,`img_detail`,`type`,`coupon_ids`,`mechant_id`,`sort_num`,`status`,`create_time`,`update_time`
  26. </sql>
  27. <sql id="dynamicWhereConditions">
  28. where 1 = 1
  29. <if test=" null != id ">
  30. and `id` = #{id}
  31. </if>
  32. <if test=" null != tenantId ">
  33. and `tenant_id` = #{tenantId}
  34. </if>
  35. <if test=" null != coverImg ">
  36. and `cover_img` like concat('%', #{coverImg},'%')
  37. </if>
  38. <if test=" null != title ">
  39. and `title` like concat('%', #{title},'%')
  40. </if>
  41. <if test=" null != subTitle ">
  42. and `sub_title` like concat('%', #{subTitle},'%')
  43. </if>
  44. <if test=" null != usePrice ">
  45. and `use_price` = #{usePrice}
  46. </if>
  47. <if test=" null != discountPrice ">
  48. and `discount_price` = #{discountPrice}
  49. </if>
  50. <if test=" null != detail ">
  51. and `detail` like concat('%', #{detail},'%')
  52. </if>
  53. <if test=" null != validStartDate ">
  54. and `valid_start_date` = #{validStartDate}
  55. </if>
  56. <if test=" null != validEndDate ">
  57. and `valid_end_date` = #{validEndDate}
  58. </if>
  59. <if test=" null != imgDetail ">
  60. and `img_detail` like concat('%', #{imgDetail},'%')
  61. </if>
  62. <if test=" null != type ">
  63. and `type` = #{type}
  64. </if>
  65. <if test=" null != couponIds ">
  66. and `coupon_ids` like concat('%', #{couponIds},'%')
  67. </if>
  68. <if test=" null != mechantId ">
  69. and `mechant_id` = #{mechantId}
  70. </if>
  71. <if test=" null != sortNum ">
  72. and `sort_num` = #{sortNum}
  73. </if>
  74. <if test=" null != status ">
  75. and `status` = #{status}
  76. </if>
  77. <if test=" null != createTime ">
  78. and `create_time` = #{createTime}
  79. </if>
  80. <if test=" null != updateTime ">
  81. and `update_time` = #{updateTime}
  82. </if>
  83. <if test=" null != ids ">
  84. and id in
  85. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  86. #{idItem}
  87. </foreach>
  88. </if>
  89. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  90. </sql>
  91. <select id="findList" parameterType="com.iformall.domain.po.WxCampaign" resultMap="BaseResultMap">
  92. select <include refid="allColumns" /> from wx_campaign
  93. <include refid="dynamicWhereConditions" />
  94. </select>
  95. <select id="getMaxSortNum" parameterType="java.lang.String" resultType="java.lang.Integer">
  96. select max(sort_num) from wx_campaign where `tenant_id` = #{tenantId}
  97. </select>
  98. </mapper>