RoomMonitorViolationInfoMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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.room.RoomMonitorViolationInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.room.RoomMonitorViolationInfo" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="uid" property="uid" jdbcType="BIGINT" />
  7. <result column="room" property="room" jdbcType="BIGINT" />
  8. <result column="state" property="state" jdbcType="INTEGER" />
  9. <result column="request_id" property="requestId" jdbcType="VARCHAR" />
  10. <result column="score" property="score" jdbcType="INTEGER" />
  11. <result column="risk_level" property="riskLevel" jdbcType="VARCHAR" />
  12. <result column="audio_url" property="audioUrl" jdbcType="VARCHAR" />
  13. <result column="pre_audio_url" property="preAudioUrl" jdbcType="VARCHAR" />
  14. <result column="audio_endtime" property="audioEndtime" jdbcType="VARCHAR" />
  15. <result column="audio_starttime" property="audioStarttime" jdbcType="VARCHAR" />
  16. <result column="content" property="content" jdbcType="VARCHAR" />
  17. <result column="description" property="description" jdbcType="VARCHAR" />
  18. <result column="matched_detail" property="matchedDetail" jdbcType="VARCHAR" />
  19. <result column="matched_field" property="matchedField" jdbcType="VARCHAR" />
  20. <result column="matched_item" property="matchedItem" jdbcType="VARCHAR" />
  21. <result column="matched_list" property="matchedList" jdbcType="VARCHAR" />
  22. <result column="model" property="model" jdbcType="VARCHAR" />
  23. <result column="risk_type" property="riskType" jdbcType="INTEGER" />
  24. <result column="risk_type_desc" property="riskTypeDesc" jdbcType="VARCHAR" />
  25. <result column="user_id" property="userId" jdbcType="INTEGER" />
  26. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  27. <result column="erban_no" property="erBanNo" jdbcType="INTEGER" />
  28. </resultMap>
  29. <sql id="Base_Column_List" >
  30. r.id, r.uid, r.room, r.state, r.request_id, r.score, r.risk_level, r.audio_url, r.pre_audio_url, r.audio_endtime,
  31. r.audio_starttime, r.content, r.description, r.matched_detail, r.matched_field, r.matched_item,
  32. r.matched_list, r.model, r.risk_type, r.risk_type_desc, r.user_id, r.create_time
  33. </sql>
  34. <select id="listByQuery" resultMap="BaseResultMap" >
  35. select
  36. <include refid="Base_Column_List" />,u.erban_no,u.nick
  37. from room_monitor_violation_info r
  38. left join users u on r.uid=u.uid
  39. <where>
  40. <if test="uid != null ">
  41. and r.uid = #{uid}
  42. </if>
  43. <if test="state != null">
  44. and r.state = #{state}
  45. </if>
  46. <if test="erBanNo != null ">
  47. and u.erban_no = #{erBanNo}
  48. </if>
  49. <if test="beginDate != null and beginDate!='' ">
  50. and r.create_time >= #{beginDate}
  51. </if>
  52. <if test="endDate != null and endDate!='' ">
  53. and r.create_time <![CDATA[ <= ]]> #{endDate}
  54. </if>
  55. </where>
  56. order by r.create_time desc
  57. </select>
  58. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  59. select
  60. <include refid="Base_Column_List" />
  61. from room_monitor_violation_info r
  62. where id = #{id,jdbcType=INTEGER}
  63. </select>
  64. <select id="selectByRequestId" resultMap="BaseResultMap" >
  65. select
  66. <include refid="Base_Column_List" />
  67. from room_monitor_violation_info r
  68. where request_id = #{requestId,jdbcType=VARCHAR}
  69. </select>
  70. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  71. delete from room_monitor_violation_info
  72. where id = #{id,jdbcType=INTEGER}
  73. </delete>
  74. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomMonitorViolationInfo" >
  75. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  76. SELECT LAST_INSERT_ID()
  77. </selectKey>
  78. insert into room_monitor_violation_info (uid, room, state,
  79. request_id, score, risk_level,
  80. audio_url, pre_audio_url, audio_endtime,
  81. audio_starttime, content, description,
  82. matched_detail, matched_field, matched_item,
  83. matched_list, model, risk_type,
  84. risk_type_desc, user_id, create_time
  85. )
  86. values (#{uid,jdbcType=BIGINT}, #{room,jdbcType=BIGINT}, #{state,jdbcType=INTEGER},
  87. #{requestId,jdbcType=VARCHAR}, #{score,jdbcType=INTEGER}, #{riskLevel,jdbcType=VARCHAR},
  88. #{audioUrl,jdbcType=VARCHAR}, #{preAudioUrl,jdbcType=VARCHAR}, #{audioEndtime,jdbcType=VARCHAR},
  89. #{audioStarttime,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
  90. #{matchedDetail,jdbcType=VARCHAR}, #{matchedField,jdbcType=VARCHAR}, #{matchedItem,jdbcType=VARCHAR},
  91. #{matchedList,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, #{riskType,jdbcType=INTEGER},
  92. #{riskTypeDesc,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
  93. )
  94. </insert>
  95. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomMonitorViolationInfo" >
  96. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  97. SELECT LAST_INSERT_ID()
  98. </selectKey>
  99. insert into room_monitor_violation_info
  100. <trim prefix="(" suffix=")" suffixOverrides="," >
  101. <if test="uid != null" >
  102. uid,
  103. </if>
  104. <if test="room != null" >
  105. room,
  106. </if>
  107. <if test="state != null" >
  108. state,
  109. </if>
  110. <if test="requestId != null" >
  111. request_id,
  112. </if>
  113. <if test="score != null" >
  114. score,
  115. </if>
  116. <if test="riskLevel != null" >
  117. risk_level,
  118. </if>
  119. <if test="audioUrl != null" >
  120. audio_url,
  121. </if>
  122. <if test="preAudioUrl != null" >
  123. pre_audio_url,
  124. </if>
  125. <if test="audioEndtime != null" >
  126. audio_endtime,
  127. </if>
  128. <if test="audioStarttime != null" >
  129. audio_starttime,
  130. </if>
  131. <if test="content != null" >
  132. content,
  133. </if>
  134. <if test="description != null" >
  135. description,
  136. </if>
  137. <if test="matchedDetail != null" >
  138. matched_detail,
  139. </if>
  140. <if test="matchedField != null" >
  141. matched_field,
  142. </if>
  143. <if test="matchedItem != null" >
  144. matched_item,
  145. </if>
  146. <if test="matchedList != null" >
  147. matched_list,
  148. </if>
  149. <if test="model != null" >
  150. model,
  151. </if>
  152. <if test="riskType != null" >
  153. risk_type,
  154. </if>
  155. <if test="riskTypeDesc != null" >
  156. risk_type_desc,
  157. </if>
  158. <if test="userId != null" >
  159. user_id,
  160. </if>
  161. <if test="createTime != null" >
  162. create_time,
  163. </if>
  164. </trim>
  165. <trim prefix="values (" suffix=")" suffixOverrides="," >
  166. <if test="uid != null" >
  167. #{uid,jdbcType=BIGINT},
  168. </if>
  169. <if test="room != null" >
  170. #{room,jdbcType=BIGINT},
  171. </if>
  172. <if test="state != null" >
  173. #{state,jdbcType=INTEGER},
  174. </if>
  175. <if test="requestId != null" >
  176. #{requestId,jdbcType=VARCHAR},
  177. </if>
  178. <if test="score != null" >
  179. #{score,jdbcType=INTEGER},
  180. </if>
  181. <if test="riskLevel != null" >
  182. #{riskLevel,jdbcType=VARCHAR},
  183. </if>
  184. <if test="audioUrl != null" >
  185. #{audioUrl,jdbcType=VARCHAR},
  186. </if>
  187. <if test="preAudioUrl != null" >
  188. #{preAudioUrl,jdbcType=VARCHAR},
  189. </if>
  190. <if test="audioEndtime != null" >
  191. #{audioEndtime,jdbcType=VARCHAR},
  192. </if>
  193. <if test="audioStarttime != null" >
  194. #{audioStarttime,jdbcType=VARCHAR},
  195. </if>
  196. <if test="content != null" >
  197. #{content,jdbcType=VARCHAR},
  198. </if>
  199. <if test="description != null" >
  200. #{description,jdbcType=VARCHAR},
  201. </if>
  202. <if test="matchedDetail != null" >
  203. #{matchedDetail,jdbcType=VARCHAR},
  204. </if>
  205. <if test="matchedField != null" >
  206. #{matchedField,jdbcType=VARCHAR},
  207. </if>
  208. <if test="matchedItem != null" >
  209. #{matchedItem,jdbcType=VARCHAR},
  210. </if>
  211. <if test="matchedList != null" >
  212. #{matchedList,jdbcType=VARCHAR},
  213. </if>
  214. <if test="model != null" >
  215. #{model,jdbcType=VARCHAR},
  216. </if>
  217. <if test="riskType != null" >
  218. #{riskType,jdbcType=INTEGER},
  219. </if>
  220. <if test="riskTypeDesc != null" >
  221. #{riskTypeDesc,jdbcType=VARCHAR},
  222. </if>
  223. <if test="userId != null" >
  224. #{userId,jdbcType=INTEGER},
  225. </if>
  226. <if test="createTime != null" >
  227. #{createTime,jdbcType=TIMESTAMP},
  228. </if>
  229. </trim>
  230. </insert>
  231. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomMonitorViolationInfo" >
  232. update room_monitor_violation_info
  233. <set >
  234. <if test="uid != null" >
  235. uid = #{uid,jdbcType=BIGINT},
  236. </if>
  237. <if test="room != null" >
  238. room = #{room,jdbcType=BIGINT},
  239. </if>
  240. <if test="state != null" >
  241. state = #{state,jdbcType=INTEGER},
  242. </if>
  243. <if test="requestId != null" >
  244. request_id = #{requestId,jdbcType=VARCHAR},
  245. </if>
  246. <if test="score != null" >
  247. score = #{score,jdbcType=INTEGER},
  248. </if>
  249. <if test="riskLevel != null" >
  250. risk_level = #{riskLevel,jdbcType=VARCHAR},
  251. </if>
  252. <if test="audioUrl != null" >
  253. audio_url = #{audioUrl,jdbcType=VARCHAR},
  254. </if>
  255. <if test="preAudioUrl != null" >
  256. pre_audio_url = #{preAudioUrl,jdbcType=VARCHAR},
  257. </if>
  258. <if test="audioEndtime != null" >
  259. audio_endtime = #{audioEndtime,jdbcType=VARCHAR},
  260. </if>
  261. <if test="audioStarttime != null" >
  262. audio_starttime = #{audioStarttime,jdbcType=VARCHAR},
  263. </if>
  264. <if test="content != null" >
  265. content = #{content,jdbcType=VARCHAR},
  266. </if>
  267. <if test="description != null" >
  268. description = #{description,jdbcType=VARCHAR},
  269. </if>
  270. <if test="matchedDetail != null" >
  271. matched_detail = #{matchedDetail,jdbcType=VARCHAR},
  272. </if>
  273. <if test="matchedField != null" >
  274. matched_field = #{matchedField,jdbcType=VARCHAR},
  275. </if>
  276. <if test="matchedItem != null" >
  277. matched_item = #{matchedItem,jdbcType=VARCHAR},
  278. </if>
  279. <if test="matchedList != null" >
  280. matched_list = #{matchedList,jdbcType=VARCHAR},
  281. </if>
  282. <if test="model != null" >
  283. model = #{model,jdbcType=VARCHAR},
  284. </if>
  285. <if test="riskType != null" >
  286. risk_type = #{riskType,jdbcType=INTEGER},
  287. </if>
  288. <if test="riskTypeDesc != null" >
  289. risk_type_desc = #{riskTypeDesc,jdbcType=VARCHAR},
  290. </if>
  291. <if test="userId != null" >
  292. user_id = #{userId,jdbcType=INTEGER},
  293. </if>
  294. <if test="createTime != null" >
  295. create_time = #{createTime,jdbcType=TIMESTAMP},
  296. </if>
  297. <if test="adminId != null" >
  298. admin_id = #{adminId,jdbcType=INTEGER},
  299. </if>
  300. </set>
  301. where id = #{id,jdbcType=INTEGER}
  302. </update>
  303. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomMonitorViolationInfo" >
  304. update room_monitor_violation_info
  305. set uid = #{uid,jdbcType=BIGINT},
  306. room = #{room,jdbcType=BIGINT},
  307. state = #{state,jdbcType=INTEGER},
  308. request_id = #{requestId,jdbcType=VARCHAR},
  309. score = #{score,jdbcType=INTEGER},
  310. risk_level = #{riskLevel,jdbcType=VARCHAR},
  311. audio_url = #{audioUrl,jdbcType=VARCHAR},
  312. pre_audio_url = #{preAudioUrl,jdbcType=VARCHAR},
  313. audio_endtime = #{audioEndtime,jdbcType=VARCHAR},
  314. audio_starttime = #{audioStarttime,jdbcType=VARCHAR},
  315. content = #{content,jdbcType=VARCHAR},
  316. description = #{description,jdbcType=VARCHAR},
  317. matched_detail = #{matchedDetail,jdbcType=VARCHAR},
  318. matched_field = #{matchedField,jdbcType=VARCHAR},
  319. matched_item = #{matchedItem,jdbcType=VARCHAR},
  320. matched_list = #{matchedList,jdbcType=VARCHAR},
  321. model = #{model,jdbcType=VARCHAR},
  322. risk_type = #{riskType,jdbcType=INTEGER},
  323. risk_type_desc = #{riskTypeDesc,jdbcType=VARCHAR},
  324. user_id = #{userId,jdbcType=INTEGER},
  325. create_time = #{createTime,jdbcType=TIMESTAMP}
  326. where id = #{id,jdbcType=INTEGER}
  327. </update>
  328. </mapper>