UserAvatarReportRecordMapper.xml 8.2 KB

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