HeadwearGetRecordMapper.xml 4.5 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.juxiao.xchat.module.xbd.mapper.record.HeadwearGetRecordMapper">
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.record.HeadwearGetRecord" >
  5. <id column="record_id" property="recordId" jdbcType="BIGINT" />
  6. <result column="uid" property="uid" jdbcType="BIGINT" />
  7. <result column="headwear_id" property="headwearId" jdbcType="BIGINT" />
  8. <result column="headwear_date" property="headwearDate" 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, headwear_id, headwear_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 headwear_get_record
  19. where record_id = #{recordId,jdbcType=BIGINT}
  20. </select>
  21. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.record.HeadwearGetRecord" >
  22. <selectKey resultType="java.lang.Long" keyProperty="recordId" order="AFTER" >
  23. SELECT LAST_INSERT_ID()
  24. </selectKey>
  25. insert into headwear_get_record (uid, headwear_id, headwear_date,
  26. type, create_time)
  27. values (#{uid,jdbcType=BIGINT}, #{headwearId,jdbcType=BIGINT}, #{headwearDate,jdbcType=INTEGER},
  28. #{type,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP})
  29. </insert>
  30. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.record.HeadwearGetRecord" >
  31. <selectKey resultType="java.lang.Long" keyProperty="recordId" order="AFTER" >
  32. SELECT LAST_INSERT_ID()
  33. </selectKey>
  34. insert into headwear_get_record
  35. <trim prefix="(" suffix=")" suffixOverrides="," >
  36. <if test="uid != null" >
  37. uid,
  38. </if>
  39. <if test="headwearId != null" >
  40. headwear_id,
  41. </if>
  42. <if test="headwearDate != null" >
  43. headwear_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="headwearId != null" >
  57. #{headwearId,jdbcType=BIGINT},
  58. </if>
  59. <if test="headwearDate != null" >
  60. #{headwearDate,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.HeadwearGetRecord" >
  71. update headwear_get_record
  72. <set >
  73. <if test="uid != null" >
  74. uid = #{uid,jdbcType=BIGINT},
  75. </if>
  76. <if test="headwearId != null" >
  77. headwear_id = #{headwearId,jdbcType=BIGINT},
  78. </if>
  79. <if test="headwearDate != null" >
  80. headwear_date = #{headwearDate,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.HeadwearGetRecord" >
  92. update headwear_get_record
  93. set uid = #{uid,jdbcType=BIGINT},
  94. headwear_id = #{headwearId,jdbcType=BIGINT},
  95. headwear_date = #{headwearDate,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 headwear_get_record
  102. where record_id = #{recordId,jdbcType=BIGINT}
  103. </delete>
  104. </mapper>