1
0

ApiUserCollectionMapper.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.api.dao.ApiUserCollectionMapper" >
  4. <resultMap id="BaseResultMap" type="com.kmall.api.entity.MallUserCollection" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="user_id" property="userId" jdbcType="INTEGER" />
  7. <result column="good_id" property="goodId" jdbcType="INTEGER" />
  8. <result column="creater_sn" property="createrSn" jdbcType="VARCHAR" />
  9. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  10. <result column="moder_sn" property="moderSn" jdbcType="VARCHAR" />
  11. <result column="mod_time" property="modTime" jdbcType="TIMESTAMP" />
  12. <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
  13. </resultMap>
  14. <sql id="Base_Column_List" >
  15. id, user_id, good_id, creater_sn, create_time, moder_sn, mod_time, tstm
  16. </sql>
  17. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  18. select
  19. <include refid="Base_Column_List" />
  20. from mall_user_collection
  21. where id = #{id,jdbcType=INTEGER}
  22. </select>
  23. <delete id="delete" parameterType="java.lang.Integer" >
  24. delete from mall_user_collection
  25. where id = #{id,jdbcType=INTEGER}
  26. </delete>
  27. <insert id="save" parameterType="com.kmall.api.entity.MallUserCollection" useGeneratedKeys="true" keyProperty="id">
  28. insert into mall_user_collection
  29. <trim prefix="(" suffix=")" suffixOverrides="," >
  30. <if test="id != null" >
  31. id,
  32. </if>
  33. <if test="userId != null" >
  34. user_id,
  35. </if>
  36. <if test="goodId != null" >
  37. good_id,
  38. </if>
  39. <if test="createrSn != null" >
  40. creater_sn,
  41. </if>
  42. <if test="createTime != null" >
  43. create_time,
  44. </if>
  45. <if test="moderSn != null" >
  46. moder_sn,
  47. </if>
  48. <if test="modTime != null" >
  49. mod_time,
  50. </if>
  51. <if test="tstm != null" >
  52. tstm,
  53. </if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides="," >
  56. <if test="id != null" >
  57. #{id,jdbcType=INTEGER},
  58. </if>
  59. <if test="userId != null" >
  60. #{userId,jdbcType=INTEGER},
  61. </if>
  62. <if test="goodId != null" >
  63. #{goodId,jdbcType=INTEGER},
  64. </if>
  65. <if test="createrSn != null" >
  66. #{createrSn,jdbcType=VARCHAR},
  67. </if>
  68. <if test="createTime != null" >
  69. #{createTime,jdbcType=TIMESTAMP},
  70. </if>
  71. <if test="moderSn != null" >
  72. #{moderSn,jdbcType=VARCHAR},
  73. </if>
  74. <if test="modTime != null" >
  75. #{modTime,jdbcType=TIMESTAMP},
  76. </if>
  77. <if test="tstm != null" >
  78. #{tstm,jdbcType=TIMESTAMP},
  79. </if>
  80. </trim>
  81. </insert>
  82. <update id="update" parameterType="com.kmall.api.entity.MallUserCollection" >
  83. update mall_user_collection
  84. <set >
  85. <if test="userId != null" >
  86. user_id = #{userId,jdbcType=INTEGER},
  87. </if>
  88. <if test="goodId != null" >
  89. good_id = #{goodId,jdbcType=INTEGER},
  90. </if>
  91. <if test="createrSn != null" >
  92. creater_sn = #{createrSn,jdbcType=VARCHAR},
  93. </if>
  94. <if test="createTime != null" >
  95. create_time = #{createTime,jdbcType=TIMESTAMP},
  96. </if>
  97. <if test="moderSn != null" >
  98. moder_sn = #{moderSn,jdbcType=VARCHAR},
  99. </if>
  100. <if test="modTime != null" >
  101. mod_time = #{modTime,jdbcType=TIMESTAMP},
  102. </if>
  103. <if test="tstm != null" >
  104. tstm = #{tstm,jdbcType=TIMESTAMP},
  105. </if>
  106. </set>
  107. where id = #{id,jdbcType=INTEGER}
  108. </update>
  109. </mapper>