MomentMsgRecordMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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.circle.MomentMsgRecordMapper">
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.circle.MomentMsgRecord" >
  5. <id column="id" property="id" jdbcType="BIGINT" />
  6. <result column="uid" property="uid" jdbcType="BIGINT" />
  7. <result column="moment_id" property="momentId" jdbcType="BIGINT" />
  8. <result column="player_id" property="playerId" jdbcType="BIGINT" />
  9. <result column="moment_uid" property="momentUid" jdbcType="BIGINT" />
  10. <result column="from_uid" property="fromUid" jdbcType="BIGINT" />
  11. <result column="type" property="type" jdbcType="BIT" />
  12. <result column="read_status" property="readStatus" jdbcType="BIT" />
  13. <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
  14. <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
  15. <result column="context" property="context" jdbcType="VARCHAR" />
  16. </resultMap>
  17. <sql id="Base_Column_List" >
  18. id, uid, moment_id, player_id, moment_uid, from_uid, type, read_status, create_date,
  19. update_date, context
  20. </sql>
  21. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
  22. select
  23. <include refid="Base_Column_List" />
  24. from moment_msg_record
  25. where id = #{id,jdbcType=BIGINT}
  26. </select>
  27. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
  28. delete from moment_msg_record
  29. where id = #{id,jdbcType=BIGINT}
  30. </delete>
  31. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentMsgRecord" >
  32. <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
  33. SELECT LAST_INSERT_ID()
  34. </selectKey>
  35. insert into moment_msg_record (uid, moment_id, player_id,
  36. moment_uid, from_uid, type,
  37. read_status, create_date, update_date,
  38. context)
  39. values (#{uid,jdbcType=BIGINT}, #{momentId,jdbcType=BIGINT}, #{playerId,jdbcType=BIGINT},
  40. #{momentUid,jdbcType=BIGINT}, #{fromUid,jdbcType=BIGINT}, #{type,jdbcType=BIT},
  41. #{readStatus,jdbcType=BIT}, #{createDate,jdbcType=TIMESTAMP}, #{updateDate,jdbcType=TIMESTAMP},
  42. #{context,jdbcType=VARCHAR})
  43. </insert>
  44. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentMsgRecord" >
  45. <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
  46. SELECT LAST_INSERT_ID()
  47. </selectKey>
  48. insert into moment_msg_record
  49. <trim prefix="(" suffix=")" suffixOverrides="," >
  50. <if test="uid != null" >
  51. uid,
  52. </if>
  53. <if test="momentId != null" >
  54. moment_id,
  55. </if>
  56. <if test="playerId != null" >
  57. player_id,
  58. </if>
  59. <if test="momentUid != null" >
  60. moment_uid,
  61. </if>
  62. <if test="fromUid != null" >
  63. from_uid,
  64. </if>
  65. <if test="type != null" >
  66. type,
  67. </if>
  68. <if test="readStatus != null" >
  69. read_status,
  70. </if>
  71. <if test="createDate != null" >
  72. create_date,
  73. </if>
  74. <if test="updateDate != null" >
  75. update_date,
  76. </if>
  77. <if test="context != null" >
  78. context,
  79. </if>
  80. </trim>
  81. <trim prefix="values (" suffix=")" suffixOverrides="," >
  82. <if test="uid != null" >
  83. #{uid,jdbcType=BIGINT},
  84. </if>
  85. <if test="momentId != null" >
  86. #{momentId,jdbcType=BIGINT},
  87. </if>
  88. <if test="playerId != null" >
  89. #{playerId,jdbcType=BIGINT},
  90. </if>
  91. <if test="momentUid != null" >
  92. #{momentUid,jdbcType=BIGINT},
  93. </if>
  94. <if test="fromUid != null" >
  95. #{fromUid,jdbcType=BIGINT},
  96. </if>
  97. <if test="type != null" >
  98. #{type,jdbcType=BIT},
  99. </if>
  100. <if test="readStatus != null" >
  101. #{readStatus,jdbcType=BIT},
  102. </if>
  103. <if test="createDate != null" >
  104. #{createDate,jdbcType=TIMESTAMP},
  105. </if>
  106. <if test="updateDate != null" >
  107. #{updateDate,jdbcType=TIMESTAMP},
  108. </if>
  109. <if test="context != null" >
  110. #{context,jdbcType=VARCHAR},
  111. </if>
  112. </trim>
  113. </insert>
  114. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentMsgRecord" >
  115. update moment_msg_record
  116. <set >
  117. <if test="uid != null" >
  118. uid = #{uid,jdbcType=BIGINT},
  119. </if>
  120. <if test="momentId != null" >
  121. moment_id = #{momentId,jdbcType=BIGINT},
  122. </if>
  123. <if test="playerId != null" >
  124. player_id = #{playerId,jdbcType=BIGINT},
  125. </if>
  126. <if test="momentUid != null" >
  127. moment_uid = #{momentUid,jdbcType=BIGINT},
  128. </if>
  129. <if test="fromUid != null" >
  130. from_uid = #{fromUid,jdbcType=BIGINT},
  131. </if>
  132. <if test="type != null" >
  133. type = #{type,jdbcType=BIT},
  134. </if>
  135. <if test="readStatus != null" >
  136. read_status = #{readStatus,jdbcType=BIT},
  137. </if>
  138. <if test="createDate != null" >
  139. create_date = #{createDate,jdbcType=TIMESTAMP},
  140. </if>
  141. <if test="updateDate != null" >
  142. update_date = #{updateDate,jdbcType=TIMESTAMP},
  143. </if>
  144. <if test="context != null" >
  145. context = #{context,jdbcType=VARCHAR},
  146. </if>
  147. </set>
  148. where id = #{id,jdbcType=BIGINT}
  149. </update>
  150. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentMsgRecord" >
  151. update moment_msg_record
  152. set uid = #{uid,jdbcType=BIGINT},
  153. moment_id = #{momentId,jdbcType=BIGINT},
  154. player_id = #{playerId,jdbcType=BIGINT},
  155. moment_uid = #{momentUid,jdbcType=BIGINT},
  156. from_uid = #{fromUid,jdbcType=BIGINT},
  157. type = #{type,jdbcType=BIT},
  158. read_status = #{readStatus,jdbcType=BIT},
  159. create_date = #{createDate,jdbcType=TIMESTAMP},
  160. update_date = #{updateDate,jdbcType=TIMESTAMP},
  161. context = #{context,jdbcType=VARCHAR}
  162. where id = #{id,jdbcType=BIGINT}
  163. </update>
  164. </mapper>