Mall2PointsRulesDao.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.kmall.admin.dao.vip.Mall2PointsRulesDao">
  4. <resultMap type="com.kmall.admin.entity.vip.Mall2PointsRulesEntity" id="mall2PointsRulesMap">
  5. <result property="mprId" column="mpr_id"/>
  6. <result property="pointsType" column="points_type"/>
  7. <result property="pointsBeginTime" column="points_begin_time"/>
  8. <result property="pointsEndTime" column="points_end_time"/>
  9. <result property="isValid" column="is_valid"/>
  10. <result property="createrSn" column="creater_sn"/>
  11. <result property="createTime" column="create_time"/>
  12. <result property="moderSn" column="moder_sn"/>
  13. <result property="modTime" column="mod_time"/>
  14. <result property="tstm" column="tstm"/>
  15. </resultMap>
  16. <select id="queryObject" resultType="com.kmall.admin.entity.vip.Mall2PointsRulesEntity">
  17. select
  18. `mpr_id`,
  19. `points_type`,
  20. `points_begin_time`,
  21. `points_end_time`,
  22. `is_valid`,
  23. `creater_sn`,
  24. `create_time`,
  25. `moder_sn`,
  26. `mod_time`,
  27. `tstm`
  28. from mall2_points_rules
  29. where mpr_id = #{id}
  30. </select>
  31. <select id="queryList" resultType="com.kmall.admin.entity.vip.Mall2PointsRulesEntity">
  32. select
  33. `mpr_id`,
  34. `points_type`,
  35. `points_begin_time`,
  36. `points_end_time`,
  37. `is_valid`,
  38. `creater_sn`,
  39. `create_time`,
  40. `moder_sn`,
  41. `mod_time`,
  42. `tstm`
  43. from mall2_points_rules
  44. WHERE 1=1
  45. <if test="name != null and name.trim() != ''">
  46. AND name LIKE concat('%',#{name},'%')
  47. </if>
  48. <choose>
  49. <when test="sidx != null and sidx.trim() != ''">
  50. order by ${sidx} ${order}
  51. </when>
  52. <otherwise>
  53. order by mpr_id desc
  54. </otherwise>
  55. </choose>
  56. <if test="offset != null and limit != null">
  57. limit #{offset}, #{limit}
  58. </if>
  59. </select>
  60. <select id="queryTotal" resultType="int">
  61. select count(*) from mall2_points_rules
  62. WHERE 1=1
  63. <if test="name != null and name.trim() != ''">
  64. AND name LIKE concat('%',#{name},'%')
  65. </if>
  66. </select>
  67. <insert id="save" parameterType="com.kmall.admin.entity.vip.Mall2PointsRulesEntity">
  68. insert into mall2_points_rules(
  69. `mpr_id`,
  70. `points_type`,
  71. `points_begin_time`,
  72. `points_end_time`,
  73. `is_valid`,
  74. `creater_sn`,
  75. `create_time`,
  76. `moder_sn`,
  77. `mod_time`,
  78. `tstm`)
  79. values(
  80. #{mprId},
  81. #{pointsType},
  82. #{pointsBeginTime},
  83. #{pointsEndTime},
  84. #{isValid},
  85. #{createrSn},
  86. #{createTime},
  87. #{moderSn},
  88. #{modTime},
  89. #{tstm})
  90. </insert>
  91. <update id="update" parameterType="com.kmall.admin.entity.vip.Mall2PointsRulesEntity">
  92. update mall2_points_rules
  93. <set>
  94. <if test="pointsType != null">`points_type` = #{pointsType}, </if>
  95. <if test="pointsBeginTime != null">`points_begin_time` = #{pointsBeginTime}, </if>
  96. <if test="pointsEndTime != null">`points_end_time` = #{pointsEndTime}, </if>
  97. <if test="isValid != null">`is_valid` = #{isValid}, </if>
  98. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  99. <if test="createTime != null">`create_time` = #{createTime}, </if>
  100. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  101. <if test="modTime != null">`mod_time` = #{modTime}, </if>
  102. <if test="tstm != null">`tstm` = #{tstm}</if>
  103. </set>
  104. where mpr_id = #{mprId}
  105. </update>
  106. <delete id="delete">
  107. delete from mall2_points_rules where mpr_id = #{value}
  108. </delete>
  109. <delete id="deleteBatch">
  110. delete from mall2_points_rules where mpr_id in
  111. <foreach item="mprId" collection="array" open="(" separator="," close=")">
  112. #{mprId}
  113. </foreach>
  114. </delete>
  115. </mapper>