MomentReportMapper.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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.MomentReportMapper">
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.circle.MomentReport" >
  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="reason" property="reason" jdbcType="VARCHAR" />
  10. <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
  11. <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
  12. <result column="status" property="status" jdbcType="TINYINT" />
  13. <result column="type" property="type" jdbcType="TINYINT" />
  14. </resultMap>
  15. <sql id="Base_Column_List" >
  16. id, uid, moment_id, player_id, reason, create_date, update_date, status, type
  17. </sql>
  18. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
  19. select
  20. <include refid="Base_Column_List" />
  21. from moment_report
  22. where id = #{id,jdbcType=BIGINT}
  23. </select>
  24. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentReport" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  25. <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
  26. SELECT LAST_INSERT_ID()
  27. </selectKey>
  28. insert into moment_report (uid, moment_id, player_id,
  29. reason, create_date, update_date,
  30. status, type)
  31. values (#{uid,jdbcType=BIGINT}, #{momentId,jdbcType=BIGINT}, #{playerId,jdbcType=BIGINT},
  32. #{reason,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{updateDate,jdbcType=TIMESTAMP},
  33. #{status,jdbcType=TINYINT}, #{type,jdbcType=TINYINT})
  34. </insert>
  35. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentReport" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  36. <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
  37. SELECT LAST_INSERT_ID()
  38. </selectKey>
  39. insert into moment_report
  40. <trim prefix="(" suffix=")" suffixOverrides="," >
  41. <if test="uid != null" >
  42. uid,
  43. </if>
  44. <if test="momentId != null" >
  45. moment_id,
  46. </if>
  47. <if test="playerId != null" >
  48. player_id,
  49. </if>
  50. <if test="reason != null" >
  51. reason,
  52. </if>
  53. <if test="createDate != null" >
  54. create_date,
  55. </if>
  56. <if test="updateDate != null" >
  57. update_date,
  58. </if>
  59. <if test="status != null" >
  60. status,
  61. </if>
  62. <if test="type != null" >
  63. type,
  64. </if>
  65. <if test="adminId != null" >
  66. admin_id,
  67. </if>
  68. </trim>
  69. <trim prefix="values (" suffix=")" suffixOverrides="," >
  70. <if test="uid != null" >
  71. #{uid,jdbcType=BIGINT},
  72. </if>
  73. <if test="momentId != null" >
  74. #{momentId,jdbcType=BIGINT},
  75. </if>
  76. <if test="playerId != null" >
  77. #{playerId,jdbcType=BIGINT},
  78. </if>
  79. <if test="reason != null" >
  80. #{reason,jdbcType=VARCHAR},
  81. </if>
  82. <if test="createDate != null" >
  83. #{createDate,jdbcType=TIMESTAMP},
  84. </if>
  85. <if test="updateDate != null" >
  86. #{updateDate,jdbcType=TIMESTAMP},
  87. </if>
  88. <if test="status != null" >
  89. #{status,jdbcType=TINYINT},
  90. </if>
  91. <if test="type != null" >
  92. #{type,jdbcType=TINYINT},
  93. </if>
  94. <if test="adminId != null" >
  95. #{adminId},
  96. </if>
  97. </trim>
  98. </insert>
  99. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentReport" >
  100. update moment_report
  101. <set >
  102. <if test="uid != null" >
  103. uid = #{uid,jdbcType=BIGINT},
  104. </if>
  105. <if test="momentId != null" >
  106. moment_id = #{momentId,jdbcType=BIGINT},
  107. </if>
  108. <if test="playerId != null" >
  109. player_id = #{playerId,jdbcType=BIGINT},
  110. </if>
  111. <if test="reason != null" >
  112. reason = #{reason,jdbcType=VARCHAR},
  113. </if>
  114. <if test="createDate != null" >
  115. create_date = #{createDate,jdbcType=TIMESTAMP},
  116. </if>
  117. <if test="updateDate != null" >
  118. update_date = #{updateDate,jdbcType=TIMESTAMP},
  119. </if>
  120. <if test="status != null" >
  121. status = #{status,jdbcType=TINYINT},
  122. </if>
  123. <if test="type != null" >
  124. type = #{type,jdbcType=TINYINT},
  125. </if>
  126. <if test="adminId != null" >
  127. admin_id = #{adminId},
  128. </if>
  129. </set>
  130. where id = #{id,jdbcType=BIGINT}
  131. </update>
  132. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentReport" >
  133. update moment_report
  134. set uid = #{uid,jdbcType=BIGINT},
  135. moment_id = #{momentId,jdbcType=BIGINT},
  136. player_id = #{playerId,jdbcType=BIGINT},
  137. reason = #{reason,jdbcType=VARCHAR},
  138. create_date = #{createDate,jdbcType=TIMESTAMP},
  139. update_date = #{updateDate,jdbcType=TIMESTAMP},
  140. status = #{status,jdbcType=TINYINT},
  141. type = #{type,jdbcType=TINYINT}
  142. where id = #{id,jdbcType=BIGINT}
  143. </update>
  144. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
  145. delete from moment_report
  146. where id = #{id,jdbcType=BIGINT}
  147. </delete>
  148. <select id="selectByPage" resultType="com.juxiao.xchat.module.xbd.vo.MomentReportVO">
  149. select mr.id,mr.uid,mr.player_id as playerId,mr.moment_id as momentId,mr.type,mr.reason,mr.create_date as createDate,
  150. mr.update_date as updateDate,mr.status,u.erban_no as erBanNo,u.nick,su.user_name as adminName
  151. from moment_report mr
  152. left join users u on u.uid = mr.uid
  153. left join sys_user su on mr.admin_id = su.user_id
  154. where 1 = 1
  155. <if test="erBanNo != null">
  156. and u.erban_no = #{erBanNo}
  157. </if>
  158. <if test="type != null">
  159. and mr.type = #{type}
  160. </if>
  161. <if test="status != null">
  162. and mr.status = #{status}
  163. </if>
  164. <if test="adminName != null and adminName != ''">
  165. and su.user_name = #{adminName}
  166. </if>
  167. <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
  168. and mr.create_date between #{beginTime} and #{endTime}
  169. </if>
  170. order by mr.status asc,mr.create_date desc
  171. </select>
  172. </mapper>