1
0

GoodsGroupOpenDetailDao.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.GoodsGroupOpenDetailDao">
  4. <resultMap type="com.kmall.admin.entity.GoodsGroupOpenDetailEntity" id="goodsGroupOpenDetailMap">
  5. <result property="id" column="id"/>
  6. <result property="openId" column="open_id"/>
  7. <result property="userId" column="user_id"/>
  8. <result property="attendTime" column="attend_time"/>
  9. <result property="attendStatus" column="attend_status"/>
  10. <result property="formId" column="form_id"/>
  11. </resultMap>
  12. <select id="queryObject" resultMap="goodsGroupOpenDetailMap">
  13. select
  14. `id`,
  15. `open_id`,
  16. `user_id`,
  17. `attend_time`,
  18. `attend_status`,
  19. `form_id`
  20. from mall_goods_group_open_detail
  21. where id = #{id}
  22. </select>
  23. <select id="queryList" resultMap="goodsGroupOpenDetailMap">
  24. select
  25. `id`,
  26. `open_id`,
  27. `user_id`,
  28. `attend_time`,
  29. `attend_status`,
  30. `form_id`
  31. from mall_goods_group_open_detail
  32. WHERE 1=1
  33. <if test="openId != null">
  34. AND open_id = #{openId}
  35. </if>
  36. <choose>
  37. <when test="sidx != null and sidx.trim() != ''">
  38. order by ${sidx} ${order}
  39. </when>
  40. <otherwise>
  41. order by id desc
  42. </otherwise>
  43. </choose>
  44. <if test="offset != null and limit != null">
  45. limit #{offset}, #{limit}
  46. </if>
  47. </select>
  48. <select id="queryTotal" resultType="int">
  49. select count(*) from mall_goods_group_open_detail
  50. WHERE 1=1
  51. <if test="open_id != null">
  52. AND open_id = #{openId}
  53. </if>
  54. </select>
  55. <insert id="save" parameterType="com.kmall.admin.entity.GoodsGroupOpenDetailEntity" useGeneratedKeys="true"
  56. keyProperty="id">
  57. insert into mall_goods_group_open_detail(
  58. `open_id`,
  59. `user_id`,
  60. `attend_time`,
  61. `attend_status`,
  62. `form_id`)
  63. values(
  64. #{openId},
  65. #{userId},
  66. #{attendTime},
  67. #{attendStatus},
  68. #{formId})
  69. </insert>
  70. <update id="update" parameterType="com.kmall.admin.entity.GoodsGroupOpenDetailEntity">
  71. update mall_goods_group_open_detail
  72. <set>
  73. <if test="openId != null">`open_id` = #{openId},</if>
  74. <if test="userId != null">`user_id` = #{userId},</if>
  75. <if test="attendTime != null">`attend_time` = #{attendTime},</if>
  76. <if test="attendStatus != null">`attend_status` = #{attendStatus},</if>
  77. <if test="formId != null">`form_id` = #{formId}</if>
  78. </set>
  79. where id = #{id}
  80. </update>
  81. <delete id="delete">
  82. delete from mall_goods_group_open_detail where id = #{value}
  83. </delete>
  84. <delete id="deleteBatch">
  85. delete from mall_goods_group_open_detail where id in
  86. <foreach item="id" collection="array" open="(" separator="," close=")">
  87. #{id}
  88. </foreach>
  89. </delete>
  90. </mapper>