RoomMapper.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.juxiao.xchat.module.xbd.mapper.room.RoomMapper">
  6. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.room.Room">
  7. <id column="uid" jdbcType="BIGINT" property="uid" />
  8. <result column="room_id" jdbcType="BIGINT" property="roomId" />
  9. <result column="room_pwd" jdbcType="VARCHAR" property="roomPwd" />
  10. <result column="tag_id" jdbcType="INTEGER" property="tagId" />
  11. <result column="tag_pict" jdbcType="VARCHAR" property="tagPict" />
  12. <result column="room_tag" jdbcType="VARCHAR" property="roomTag" />
  13. <result column="badge" jdbcType="VARCHAR" property="badge" />
  14. <result column="meeting_name" jdbcType="VARCHAR" property="meetingName" />
  15. <result column="title" jdbcType="VARCHAR" property="title" />
  16. <result column="valid" jdbcType="BIT" property="valid" />
  17. <result column="type" jdbcType="TINYINT" property="type" />
  18. <result column="official_room" jdbcType="TINYINT" property="officialRoom" />
  19. <result column="ab_channel_type" jdbcType="TINYINT" property="abChannelType" />
  20. <result column="reward_id" jdbcType="BIGINT" property="rewardId" />
  21. <result column="reward_money" jdbcType="BIGINT" property="rewardMoney" />
  22. <result column="serv_dura" jdbcType="INTEGER" property="servDura" />
  23. <result column="operator_status" jdbcType="TINYINT" property="operatorStatus" />
  24. <result column="avatar" jdbcType="VARCHAR" property="avatar" />
  25. <result column="room_desc" jdbcType="VARCHAR" property="roomDesc" />
  26. <result column="room_notice" jdbcType="VARCHAR" property="roomNotice" />
  27. <result column="back_pic" jdbcType="VARCHAR" property="backPic" />
  28. <result column="open_time" jdbcType="TIMESTAMP" property="openTime" />
  29. <result column="is_permit_room" jdbcType="TINYINT" property="isPermitRoom" />
  30. <result column="online_num" jdbcType="INTEGER" property="onlineNum" />
  31. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  32. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  33. <result column="is_exception_close" jdbcType="BIT" property="isExceptionClose" />
  34. <result column="exception_close_time" jdbcType="TIMESTAMP" property="exceptionCloseTime" />
  35. <result column="recom_seq" jdbcType="BIGINT" property="recomSeq" />
  36. <result column="can_show" jdbcType="TINYINT" property="canShow" />
  37. <result column="def_backpic" jdbcType="VARCHAR" property="defBackpic" />
  38. <result column="audio_level" jdbcType="INTEGER" property="audioLevel" />
  39. <result column="charm_open" property="charmOpen" jdbcType="INTEGER" />
  40. </resultMap>
  41. <sql id="Base_Column_List">
  42. uid, room_id, room_pwd, tag_id, tag_pict, room_tag, badge, meeting_name, title, valid,
  43. type, official_room, ab_channel_type, reward_id, reward_money, serv_dura, operator_status,
  44. avatar, room_desc, room_notice, back_pic, open_time, is_permit_room, online_num,
  45. create_time, update_time, is_exception_close, exception_close_time, recom_seq, can_show,
  46. def_backpic, audio_level, charm_open,face_type
  47. </sql>
  48. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  49. select
  50. <include refid="Base_Column_List" />
  51. from room
  52. where uid = #{uid,jdbcType=BIGINT}
  53. </select>
  54. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.room.Room">
  55. insert into room (uid, room_id, room_pwd,
  56. tag_id, tag_pict, room_tag,
  57. badge, meeting_name, title,
  58. valid, type, official_room,
  59. ab_channel_type, reward_id, reward_money,
  60. serv_dura, operator_status, avatar,
  61. room_desc, room_notice, back_pic,
  62. open_time, is_permit_room, online_num,
  63. create_time, update_time, is_exception_close,
  64. exception_close_time, recom_seq, can_show,
  65. def_backpic, audio_level, charm_open)
  66. values (#{uid,jdbcType=BIGINT}, #{roomId,jdbcType=BIGINT}, #{roomPwd,jdbcType=VARCHAR},
  67. #{tagId,jdbcType=INTEGER}, #{tagPict,jdbcType=VARCHAR}, #{roomTag,jdbcType=VARCHAR},
  68. #{badge,jdbcType=VARCHAR}, #{meetingName,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
  69. #{valid,jdbcType=BIT}, #{type,jdbcType=TINYINT}, #{officialRoom,jdbcType=TINYINT},
  70. #{abChannelType,jdbcType=TINYINT}, #{rewardId,jdbcType=BIGINT}, #{rewardMoney,jdbcType=BIGINT},
  71. #{servDura,jdbcType=INTEGER}, #{operatorStatus,jdbcType=TINYINT}, #{avatar,jdbcType=VARCHAR},
  72. #{roomDesc,jdbcType=VARCHAR}, #{roomNotice,jdbcType=VARCHAR}, #{backPic,jdbcType=VARCHAR},
  73. #{openTime,jdbcType=TIMESTAMP}, #{isPermitRoom,jdbcType=TINYINT}, #{onlineNum,jdbcType=INTEGER},
  74. #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isExceptionClose,jdbcType=BIT},
  75. #{exceptionCloseTime,jdbcType=TIMESTAMP}, #{recomSeq,jdbcType=BIGINT}, #{canShow,jdbcType=TINYINT},
  76. #{defBackpic,jdbcType=VARCHAR}, #{audioLevel,jdbcType=INTEGER})
  77. </insert>
  78. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.room.Room">
  79. insert into room
  80. <trim prefix="(" suffix=")" suffixOverrides=",">
  81. <if test="uid != null">
  82. uid,
  83. </if>
  84. <if test="roomId != null">
  85. room_id,
  86. </if>
  87. <if test="roomPwd != null">
  88. room_pwd,
  89. </if>
  90. <if test="tagId != null">
  91. tag_id,
  92. </if>
  93. <if test="tagPict != null">
  94. tag_pict,
  95. </if>
  96. <if test="roomTag != null">
  97. room_tag,
  98. </if>
  99. <if test="badge != null">
  100. badge,
  101. </if>
  102. <if test="meetingName != null">
  103. meeting_name,
  104. </if>
  105. <if test="title != null">
  106. title,
  107. </if>
  108. <if test="valid != null">
  109. valid,
  110. </if>
  111. <if test="type != null">
  112. type,
  113. </if>
  114. <if test="officialRoom != null">
  115. official_room,
  116. </if>
  117. <if test="abChannelType != null">
  118. ab_channel_type,
  119. </if>
  120. <if test="rewardId != null">
  121. reward_id,
  122. </if>
  123. <if test="rewardMoney != null">
  124. reward_money,
  125. </if>
  126. <if test="servDura != null">
  127. serv_dura,
  128. </if>
  129. <if test="operatorStatus != null">
  130. operator_status,
  131. </if>
  132. <if test="avatar != null">
  133. avatar,
  134. </if>
  135. <if test="roomDesc != null">
  136. room_desc,
  137. </if>
  138. <if test="roomNotice != null">
  139. room_notice,
  140. </if>
  141. <if test="backPic != null">
  142. back_pic,
  143. </if>
  144. <if test="openTime != null">
  145. open_time,
  146. </if>
  147. <if test="isPermitRoom != null">
  148. is_permit_room,
  149. </if>
  150. <if test="onlineNum != null">
  151. online_num,
  152. </if>
  153. <if test="createTime != null">
  154. create_time,
  155. </if>
  156. <if test="updateTime != null">
  157. update_time,
  158. </if>
  159. <if test="isExceptionClose != null">
  160. is_exception_close,
  161. </if>
  162. <if test="exceptionCloseTime != null">
  163. exception_close_time,
  164. </if>
  165. <if test="recomSeq != null">
  166. recom_seq,
  167. </if>
  168. <if test="canShow != null">
  169. can_show,
  170. </if>
  171. <if test="defBackpic != null">
  172. def_backpic,
  173. </if>
  174. <if test="audioLevel != null">
  175. audio_level,
  176. </if>
  177. <if test="charmOpen != null">
  178. charm_open,
  179. </if>
  180. </trim>
  181. <trim prefix="values (" suffix=")" suffixOverrides=",">
  182. <if test="uid != null">
  183. #{uid,jdbcType=BIGINT},
  184. </if>
  185. <if test="roomId != null">
  186. #{roomId,jdbcType=BIGINT},
  187. </if>
  188. <if test="roomPwd != null">
  189. #{roomPwd,jdbcType=VARCHAR},
  190. </if>
  191. <if test="tagId != null">
  192. #{tagId,jdbcType=INTEGER},
  193. </if>
  194. <if test="tagPict != null">
  195. #{tagPict,jdbcType=VARCHAR},
  196. </if>
  197. <if test="roomTag != null">
  198. #{roomTag,jdbcType=VARCHAR},
  199. </if>
  200. <if test="badge != null">
  201. #{badge,jdbcType=VARCHAR},
  202. </if>
  203. <if test="meetingName != null">
  204. #{meetingName,jdbcType=VARCHAR},
  205. </if>
  206. <if test="title != null">
  207. #{title,jdbcType=VARCHAR},
  208. </if>
  209. <if test="valid != null">
  210. #{valid,jdbcType=BIT},
  211. </if>
  212. <if test="type != null">
  213. #{type,jdbcType=TINYINT},
  214. </if>
  215. <if test="officialRoom != null">
  216. #{officialRoom,jdbcType=TINYINT},
  217. </if>
  218. <if test="abChannelType != null">
  219. #{abChannelType,jdbcType=TINYINT},
  220. </if>
  221. <if test="rewardId != null">
  222. #{rewardId,jdbcType=BIGINT},
  223. </if>
  224. <if test="rewardMoney != null">
  225. #{rewardMoney,jdbcType=BIGINT},
  226. </if>
  227. <if test="servDura != null">
  228. #{servDura,jdbcType=INTEGER},
  229. </if>
  230. <if test="operatorStatus != null">
  231. #{operatorStatus,jdbcType=TINYINT},
  232. </if>
  233. <if test="avatar != null">
  234. #{avatar,jdbcType=VARCHAR},
  235. </if>
  236. <if test="roomDesc != null">
  237. #{roomDesc,jdbcType=VARCHAR},
  238. </if>
  239. <if test="roomNotice != null">
  240. #{roomNotice,jdbcType=VARCHAR},
  241. </if>
  242. <if test="backPic != null">
  243. #{backPic,jdbcType=VARCHAR},
  244. </if>
  245. <if test="openTime != null">
  246. #{openTime,jdbcType=TIMESTAMP},
  247. </if>
  248. <if test="isPermitRoom != null">
  249. #{isPermitRoom,jdbcType=TINYINT},
  250. </if>
  251. <if test="onlineNum != null">
  252. #{onlineNum,jdbcType=INTEGER},
  253. </if>
  254. <if test="createTime != null">
  255. #{createTime,jdbcType=TIMESTAMP},
  256. </if>
  257. <if test="updateTime != null">
  258. #{updateTime,jdbcType=TIMESTAMP},
  259. </if>
  260. <if test="isExceptionClose != null">
  261. #{isExceptionClose,jdbcType=BIT},
  262. </if>
  263. <if test="exceptionCloseTime != null">
  264. #{exceptionCloseTime,jdbcType=TIMESTAMP},
  265. </if>
  266. <if test="recomSeq != null">
  267. #{recomSeq,jdbcType=BIGINT},
  268. </if>
  269. <if test="canShow != null">
  270. #{canShow,jdbcType=TINYINT},
  271. </if>
  272. <if test="defBackpic != null">
  273. #{defBackpic,jdbcType=VARCHAR},
  274. </if>
  275. <if test="audioLevel != null">
  276. #{audioLevel,jdbcType=INTEGER},
  277. </if>
  278. </trim>
  279. </insert>
  280. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.room.Room">
  281. update room
  282. <set>
  283. <if test="roomId != null">
  284. room_id = #{roomId,jdbcType=BIGINT},
  285. </if>
  286. <if test="roomPwd != null">
  287. room_pwd = #{roomPwd,jdbcType=VARCHAR},
  288. </if>
  289. <if test="tagId != null">
  290. tag_id = #{tagId,jdbcType=INTEGER},
  291. </if>
  292. <if test="tagPict != null">
  293. tag_pict = #{tagPict,jdbcType=VARCHAR},
  294. </if>
  295. <if test="roomTag != null">
  296. room_tag = #{roomTag,jdbcType=VARCHAR},
  297. </if>
  298. <if test="badge != null">
  299. badge = #{badge,jdbcType=VARCHAR},
  300. </if>
  301. <if test="meetingName != null">
  302. meeting_name = #{meetingName,jdbcType=VARCHAR},
  303. </if>
  304. <if test="title != null">
  305. title = #{title,jdbcType=VARCHAR},
  306. </if>
  307. <if test="valid != null">
  308. valid = #{valid,jdbcType=BIT},
  309. </if>
  310. <if test="type != null">
  311. type = #{type,jdbcType=TINYINT},
  312. </if>
  313. <if test="officialRoom != null">
  314. official_room = #{officialRoom,jdbcType=TINYINT},
  315. </if>
  316. <if test="abChannelType != null">
  317. ab_channel_type = #{abChannelType,jdbcType=TINYINT},
  318. </if>
  319. <if test="rewardId != null">
  320. reward_id = #{rewardId,jdbcType=BIGINT},
  321. </if>
  322. <if test="rewardMoney != null">
  323. reward_money = #{rewardMoney,jdbcType=BIGINT},
  324. </if>
  325. <if test="servDura != null">
  326. serv_dura = #{servDura,jdbcType=INTEGER},
  327. </if>
  328. <if test="operatorStatus != null">
  329. operator_status = #{operatorStatus,jdbcType=TINYINT},
  330. </if>
  331. <if test="avatar != null">
  332. avatar = #{avatar,jdbcType=VARCHAR},
  333. </if>
  334. <if test="roomDesc != null">
  335. room_desc = #{roomDesc,jdbcType=VARCHAR},
  336. </if>
  337. <if test="roomNotice != null">
  338. room_notice = #{roomNotice,jdbcType=VARCHAR},
  339. </if>
  340. <if test="backPic != null">
  341. back_pic = #{backPic,jdbcType=VARCHAR},
  342. </if>
  343. <if test="openTime != null">
  344. open_time = #{openTime,jdbcType=TIMESTAMP},
  345. </if>
  346. <if test="isPermitRoom != null">
  347. is_permit_room = #{isPermitRoom,jdbcType=TINYINT},
  348. </if>
  349. <if test="onlineNum != null">
  350. online_num = #{onlineNum,jdbcType=INTEGER},
  351. </if>
  352. <if test="createTime != null">
  353. create_time = #{createTime,jdbcType=TIMESTAMP},
  354. </if>
  355. <if test="updateTime != null">
  356. update_time = #{updateTime,jdbcType=TIMESTAMP},
  357. </if>
  358. <if test="isExceptionClose != null">
  359. is_exception_close = #{isExceptionClose,jdbcType=BIT},
  360. </if>
  361. <if test="exceptionCloseTime != null">
  362. exception_close_time = #{exceptionCloseTime,jdbcType=TIMESTAMP},
  363. </if>
  364. <if test="recomSeq != null">
  365. recom_seq = #{recomSeq,jdbcType=BIGINT},
  366. </if>
  367. <if test="canShow != null">
  368. can_show = #{canShow,jdbcType=TINYINT},
  369. </if>
  370. <if test="defBackpic != null">
  371. def_backpic = #{defBackpic,jdbcType=VARCHAR},
  372. </if>
  373. <if test="audioLevel != null">
  374. audio_level = #{audioLevel,jdbcType=INTEGER},
  375. </if>
  376. <if test="charmOpen != null" >
  377. charm_open = #{charmOpen,jdbcType=INTEGER},
  378. </if>
  379. <if test="faceType != null" >
  380. face_type = #{faceType,jdbcType=INTEGER},
  381. </if>
  382. </set>
  383. where uid = #{uid,jdbcType=BIGINT}
  384. </update>
  385. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.room.Room">
  386. update room
  387. set room_id = #{roomId,jdbcType=BIGINT},
  388. room_pwd = #{roomPwd,jdbcType=VARCHAR},
  389. tag_id = #{tagId,jdbcType=INTEGER},
  390. tag_pict = #{tagPict,jdbcType=VARCHAR},
  391. room_tag = #{roomTag,jdbcType=VARCHAR},
  392. badge = #{badge,jdbcType=VARCHAR},
  393. meeting_name = #{meetingName,jdbcType=VARCHAR},
  394. title = #{title,jdbcType=VARCHAR},
  395. valid = #{valid,jdbcType=BIT},
  396. type = #{type,jdbcType=TINYINT},
  397. official_room = #{officialRoom,jdbcType=TINYINT},
  398. ab_channel_type = #{abChannelType,jdbcType=TINYINT},
  399. reward_id = #{rewardId,jdbcType=BIGINT},
  400. reward_money = #{rewardMoney,jdbcType=BIGINT},
  401. serv_dura = #{servDura,jdbcType=INTEGER},
  402. operator_status = #{operatorStatus,jdbcType=TINYINT},
  403. avatar = #{avatar,jdbcType=VARCHAR},
  404. room_desc = #{roomDesc,jdbcType=VARCHAR},
  405. room_notice = #{roomNotice,jdbcType=VARCHAR},
  406. back_pic = #{backPic,jdbcType=VARCHAR},
  407. open_time = #{openTime,jdbcType=TIMESTAMP},
  408. is_permit_room = #{isPermitRoom,jdbcType=TINYINT},
  409. online_num = #{onlineNum,jdbcType=INTEGER},
  410. create_time = #{createTime,jdbcType=TIMESTAMP},
  411. update_time = #{updateTime,jdbcType=TIMESTAMP},
  412. is_exception_close = #{isExceptionClose,jdbcType=BIT},
  413. exception_close_time = #{exceptionCloseTime,jdbcType=TIMESTAMP},
  414. recom_seq = #{recomSeq,jdbcType=BIGINT},
  415. can_show = #{canShow,jdbcType=TINYINT},
  416. def_backpic = #{defBackpic,jdbcType=VARCHAR},
  417. audio_level = #{audioLevel,jdbcType=INTEGER},
  418. charm_open = #{charmOpen,jdbcType=INTEGER}
  419. where uid = #{uid,jdbcType=BIGINT}
  420. </update>
  421. <select id="selectUserRoom" resultType="com.juxiao.xchat.module.xbd.dto.RoomDTO">
  422. <![CDATA[
  423. SELECT
  424. uid,
  425. room_id,
  426. room_pwd,
  427. tag_id,
  428. tag_pict,
  429. room_tag,
  430. badge,
  431. meeting_name,
  432. title,
  433. valid,
  434. `type`,
  435. official_room,
  436. ab_channel_type,
  437. reward_id,
  438. reward_money,
  439. serv_dura,
  440. operator_status,
  441. avatar,
  442. room_desc,
  443. room_notice,
  444. back_pic,
  445. open_time,
  446. is_permit_room,
  447. online_num,
  448. create_time,
  449. update_time,
  450. is_exception_close,
  451. exception_close_time,
  452. recom_seq,
  453. can_show,
  454. def_backpic,
  455. `gift_effect_switch`,
  456. `public_chat_switch`,
  457. ri.play_info AS playInfo,
  458. audio_level AS audioLevel,
  459. face_type,
  460. gift_card_switch
  461. FROM
  462. room r
  463. LEFT JOIN room_info ri ON ri.room_uid = r.uid
  464. ]]>
  465. <where> r.uid = #{uid}</where>
  466. </select>
  467. <select id="selectByRoomId" resultType="com.juxiao.xchat.module.xbd.dto.UsersRoomDTO">
  468. select r.uid,r.room_id as roomId,u.erban_no as erBanNo,u.nick,r.title
  469. from room r
  470. left join users u on u.uid = r.uid
  471. where r.room_id = #{roomId}
  472. </select>
  473. </mapper>