Mall2PointsRulesDao.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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_rules_money as pointsRulesMoney,
  21. points_rules_num as pointsRulesNum,
  22. `points_begin_time`,
  23. `points_end_time`,
  24. `is_valid`,
  25. `creater_sn`,
  26. `create_time`,
  27. `moder_sn`,
  28. `mod_time`,
  29. `tstm`
  30. from mall2_points_rules
  31. where mpr_id = #{id}
  32. </select>
  33. <select id="queryList" resultType="com.kmall.admin.entity.vip.Mall2PointsRulesEntity">
  34. select
  35. `mpr_id`,
  36. `points_type`,
  37. points_rules_money as pointsRulesMoney,
  38. points_rules_num as pointsRulesNum,
  39. `points_begin_time`,
  40. `points_end_time`,
  41. `is_valid`,
  42. `creater_sn`,
  43. `create_time`,
  44. `moder_sn`,
  45. `mod_time`,
  46. `tstm`
  47. from mall2_points_rules
  48. WHERE 1=1
  49. <if test="name != null and name.trim() != ''">
  50. AND name LIKE concat('%',#{name},'%')
  51. </if>
  52. <choose>
  53. <when test="sidx != null and sidx.trim() != ''">
  54. order by ${sidx} ${order}
  55. </when>
  56. <otherwise>
  57. order by mpr_id desc
  58. </otherwise>
  59. </choose>
  60. <if test="offset != null and limit != null">
  61. limit #{offset}, #{limit}
  62. </if>
  63. </select>
  64. <select id="queryTotal" resultType="int">
  65. select count(*) from mall2_points_rules
  66. WHERE 1=1
  67. <if test="name != null and name.trim() != ''">
  68. AND name LIKE concat('%',#{name},'%')
  69. </if>
  70. </select>
  71. <insert id="save" parameterType="com.kmall.admin.entity.vip.Mall2PointsRulesEntity" useGeneratedKeys="true" keyProperty="id">
  72. insert into mall2_points_rules(
  73. `mpr_id`,
  74. `points_type`,
  75. points_rules_money,
  76. points_rules_num,
  77. `points_begin_time`,
  78. `points_end_time`,
  79. `is_valid`,
  80. `creater_sn`,
  81. `create_time`,
  82. `moder_sn`,
  83. `mod_time`,
  84. `tstm`)
  85. values(
  86. #{mprId},
  87. #{pointsType},
  88. #{pointsRulesMoney},
  89. #{pointsRulesNum},
  90. #{pointsBeginTime},
  91. #{pointsEndTime},
  92. #{isValid},
  93. #{createrSn},
  94. #{createTime},
  95. #{moderSn},
  96. #{modTime},
  97. #{tstm})
  98. </insert>
  99. <update id="update" parameterType="com.kmall.admin.entity.vip.Mall2PointsRulesEntity">
  100. update mall2_points_rules
  101. <set>
  102. <if test="pointsType != null">`points_type` = #{pointsType}, </if>
  103. <if test="pointsRulesMoney != null">`points_rules_money` = #{pointsRulesMoney}, </if>
  104. <if test="pointsRulesNum != null">`points_rules_num` = #{pointsRulesNum}, </if>
  105. <if test="pointsBeginTime != null">`points_begin_time` = #{pointsBeginTime}, </if>
  106. <if test="pointsEndTime != null">`points_end_time` = #{pointsEndTime}, </if>
  107. <if test="isValid != null">`is_valid` = #{isValid}, </if>
  108. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  109. <if test="createTime != null">`create_time` = #{createTime}, </if>
  110. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  111. <if test="modTime != null">`mod_time` = #{modTime}, </if>
  112. <if test="tstm != null">`tstm` = #{tstm}</if>
  113. </set>
  114. where mpr_id = #{mprId}
  115. </update>
  116. <delete id="delete">
  117. delete from mall2_points_rules where mpr_id = #{value}
  118. </delete>
  119. <delete id="deleteBatch">
  120. delete from mall2_points_rules where mpr_id in
  121. <foreach item="mprId" collection="array" open="(" separator="," close=")">
  122. #{mprId}
  123. </foreach>
  124. </delete>
  125. <select id="queryRulesDetilId" parameterType="java.lang.Long" resultType="java.lang.Integer">
  126. select points_type from mall2_points_rules where mpr_id=#{mkaId}
  127. </select>
  128. </mapper>