1
0

Mall2PointsRulesDetilDao.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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.Mall2PointsRulesDetilDao">
  4. <resultMap type="com.kmall.admin.entity.vip.Mall2PointsRulesDetilEntity" id="mall2PointsRulesDetilMap">
  5. <result property="id" column="id"/>
  6. <result property="fatherId" column="father_id"/>
  7. <result property="pointsRulesType" column="points_rules_type"/>
  8. <result property="pointsDetilName" column="points_detil_name"/>
  9. <result property="pointsDetilNameId" column="points_detil_name_id"/>
  10. <result property="pointsStoreName" column="points_store_name"/>
  11. <result property="pointsStoreId" column="points_store_id"/>
  12. <result property="remark" column="remark"/>
  13. <result property="tstm" column="tstm"/>
  14. </resultMap>
  15. <select id="queryObject" resultType="com.kmall.admin.entity.vip.Mall2PointsRulesDetilEntity">
  16. select
  17. `id`,
  18. `father_id`,
  19. `points_rules_type`,
  20. `points_detil_name`,
  21. `points_detil_name_id`,
  22. `points_store_name`,
  23. `points_store_id`,
  24. `remark`,
  25. `tstm`
  26. from mall2_points_rules_detil
  27. where id = #{id}
  28. </select>
  29. <select id="queryList" resultType="com.kmall.admin.entity.vip.Mall2PointsRulesDetilEntity">
  30. select
  31. `id`,
  32. `father_id`,
  33. `points_rules_type`,
  34. `points_detil_name`,
  35. `points_detil_name_id`,
  36. `points_store_name`,
  37. `points_store_id`,
  38. `remark`,
  39. `tstm`
  40. from mall2_points_rules_detil
  41. WHERE 1=1
  42. <if test="name != null and name.trim() != ''">
  43. AND name LIKE concat('%',#{name},'%')
  44. </if>
  45. <choose>
  46. <when test="sidx != null and sidx.trim() != ''">
  47. order by ${sidx} ${order}
  48. </when>
  49. <otherwise>
  50. order by id desc
  51. </otherwise>
  52. </choose>
  53. <if test="offset != null and limit != null">
  54. limit #{offset}, #{limit}
  55. </if>
  56. </select>
  57. <select id="queryTotal" resultType="int">
  58. select count(*) from mall2_points_rules_detil
  59. WHERE 1=1
  60. <if test="name != null and name.trim() != ''">
  61. AND name LIKE concat('%',#{name},'%')
  62. </if>
  63. </select>
  64. <insert id="save" parameterType="com.kmall.admin.entity.vip.Mall2PointsRulesDetilEntity" useGeneratedKeys="true" keyProperty="id">
  65. insert into mall2_points_rules_detil(
  66. `father_id`,
  67. `points_rules_type`,
  68. `points_detil_name`,
  69. `points_detil_name_id`,
  70. `points_store_name`,
  71. `points_store_id`,
  72. `remark`,
  73. `tstm`)
  74. values(
  75. #{fatherId},
  76. #{pointsRulesType},
  77. #{pointsDetilName},
  78. #{pointsDetilNameId},
  79. #{pointsStoreName},
  80. #{pointsStoreId},
  81. #{remark},
  82. #{tstm})
  83. </insert>
  84. <update id="update" parameterType="com.kmall.admin.entity.vip.Mall2PointsRulesDetilEntity">
  85. update mall2_points_rules_detil
  86. <set>
  87. <if test="fatherId != null">`father_id` = #{fatherId}, </if>
  88. <if test="pointsRulesType != null">`points_rules_type` = #{pointsRulesType}, </if>
  89. <if test="pointsDetilName != null">`points_detil_name` = #{pointsDetilName}, </if>
  90. <if test="pointsDetilNameId != null">`points_detil_name_id` = #{pointsDetilNameId}, </if>
  91. <if test="pointsStoreName != null">`points_store_name` = #{pointsStoreName}, </if>
  92. <if test="pointsStoreId != null">`points_store_id` = #{pointsStoreId}, </if>
  93. <if test="remark != null">`remark` = #{remark}, </if>
  94. <if test="tstm != null">`tstm` = #{tstm}</if>
  95. </set>
  96. where id = #{id}
  97. </update>
  98. <delete id="delete">
  99. delete from mall2_points_rules_detil where id = #{value}
  100. </delete>
  101. <delete id="deleteBatch">
  102. delete from mall2_points_rules_detil where id in
  103. <foreach item="id" collection="array" open="(" separator="," close=")">
  104. #{id}
  105. </foreach>
  106. </delete>
  107. </mapper>