GiftCarGetRecordMapper.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.juxiao.xchat.module.xbd.mapper.record.GiftCarGetRecordMapper">
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.record.GiftCarGetRecord" >
  5. <id column="record_id" property="recordId" jdbcType="BIGINT" />
  6. <result column="uid" property="uid" jdbcType="BIGINT" />
  7. <result column="car_id" property="carId" jdbcType="BIGINT" />
  8. <result column="car_date" property="carDate" jdbcType="INTEGER" />
  9. <result column="type" property="type" jdbcType="TINYINT" />
  10. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  11. </resultMap>
  12. <sql id="Base_Column_List" >
  13. record_id, uid, car_id, car_date, type, create_time
  14. </sql>
  15. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
  16. select
  17. <include refid="Base_Column_List" />
  18. from gift_car_get_record
  19. where record_id = #{recordId,jdbcType=BIGINT}
  20. </select>
  21. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.record.GiftCarGetRecord" >
  22. <selectKey resultType="java.lang.Long" keyProperty="recordId" order="AFTER" >
  23. SELECT LAST_INSERT_ID()
  24. </selectKey>
  25. insert into gift_car_get_record (uid, car_id, car_date,
  26. type, create_time)
  27. values (#{uid,jdbcType=BIGINT}, #{carId,jdbcType=BIGINT}, #{carDate,jdbcType=INTEGER},
  28. #{type,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP})
  29. </insert>
  30. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.record.GiftCarGetRecord" >
  31. <selectKey resultType="java.lang.Long" keyProperty="recordId" order="AFTER" >
  32. SELECT LAST_INSERT_ID()
  33. </selectKey>
  34. insert into gift_car_get_record
  35. <trim prefix="(" suffix=")" suffixOverrides="," >
  36. <if test="uid != null" >
  37. uid,
  38. </if>
  39. <if test="carId != null" >
  40. car_id,
  41. </if>
  42. <if test="carDate != null" >
  43. car_date,
  44. </if>
  45. <if test="type != null" >
  46. type,
  47. </if>
  48. <if test="createTime != null" >
  49. create_time,
  50. </if>
  51. </trim>
  52. <trim prefix="values (" suffix=")" suffixOverrides="," >
  53. <if test="uid != null" >
  54. #{uid,jdbcType=BIGINT},
  55. </if>
  56. <if test="carId != null" >
  57. #{carId,jdbcType=BIGINT},
  58. </if>
  59. <if test="carDate != null" >
  60. #{carDate,jdbcType=INTEGER},
  61. </if>
  62. <if test="type != null" >
  63. #{type,jdbcType=TINYINT},
  64. </if>
  65. <if test="createTime != null" >
  66. #{createTime,jdbcType=TIMESTAMP},
  67. </if>
  68. </trim>
  69. </insert>
  70. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.record.GiftCarGetRecord" >
  71. update gift_car_get_record
  72. <set >
  73. <if test="uid != null" >
  74. uid = #{uid,jdbcType=BIGINT},
  75. </if>
  76. <if test="carId != null" >
  77. car_id = #{carId,jdbcType=BIGINT},
  78. </if>
  79. <if test="carDate != null" >
  80. car_date = #{carDate,jdbcType=INTEGER},
  81. </if>
  82. <if test="type != null" >
  83. type = #{type,jdbcType=TINYINT},
  84. </if>
  85. <if test="createTime != null" >
  86. create_time = #{createTime,jdbcType=TIMESTAMP},
  87. </if>
  88. </set>
  89. where record_id = #{recordId,jdbcType=BIGINT}
  90. </update>
  91. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.record.GiftCarGetRecord" >
  92. update gift_car_get_record
  93. set uid = #{uid,jdbcType=BIGINT},
  94. car_id = #{carId,jdbcType=BIGINT},
  95. car_date = #{carDate,jdbcType=INTEGER},
  96. type = #{type,jdbcType=TINYINT},
  97. create_time = #{createTime,jdbcType=TIMESTAMP}
  98. where record_id = #{recordId,jdbcType=BIGINT}
  99. </update>
  100. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
  101. delete from gift_car_get_record
  102. where record_id = #{recordId,jdbcType=BIGINT}
  103. </delete>
  104. </mapper>