AccountBannedMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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.AccountBannedMapper">
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.AccountBanned">
  5. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="uid" jdbcType="BIGINT" property="uid" />
  7. <result column="erban_no" jdbcType="BIGINT" property="erbanNo" />
  8. <result column="phone" jdbcType="VARCHAR" property="phone" />
  9. <result column="device_id" jdbcType="VARCHAR" property="deviceId" />
  10. <result column="banned_type" jdbcType="VARCHAR" property="bannedType" />
  11. <result column="banned_ip" jdbcType="VARCHAR" property="bannedIp" />
  12. <result column="banned_status" jdbcType="TINYINT" property="bannedStatus" />
  13. <result column="banned_minute" jdbcType="INTEGER" property="bannedMinute" />
  14. <result column="banned_start_time" jdbcType="TIMESTAMP" property="bannedStartTime" />
  15. <result column="banned_end_time" jdbcType="TIMESTAMP" property="bannedEndTime" />
  16. <result column="banned_desc" jdbcType="VARCHAR" property="bannedDesc" />
  17. <result column="admin_id" jdbcType="INTEGER" property="adminId" />
  18. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  19. </resultMap>
  20. <resultMap id="BaseVOResultMap" type="com.juxiao.xchat.module.xbd.vo.AccountBannedVO">
  21. <id column="id" jdbcType="INTEGER" property="id" />
  22. <result column="uid" jdbcType="BIGINT" property="uid" />
  23. <result column="erban_no" jdbcType="BIGINT" property="erbanNo" />
  24. <result column="phone" jdbcType="VARCHAR" property="phone" />
  25. <result column="device_id" jdbcType="VARCHAR" property="deviceId" />
  26. <result column="banned_type" jdbcType="VARCHAR" property="bannedType" />
  27. <result column="banned_ip" jdbcType="VARCHAR" property="bannedIp" />
  28. <result column="banned_status" jdbcType="TINYINT" property="bannedStatus" />
  29. <result column="banned_minute" jdbcType="INTEGER" property="bannedMinute" />
  30. <result column="banned_start_time" jdbcType="TIMESTAMP" property="bannedStartTime" />
  31. <result column="banned_end_time" jdbcType="TIMESTAMP" property="bannedEndTime" />
  32. <result column="banned_desc" jdbcType="VARCHAR" property="bannedDesc" />
  33. <result column="admin_id" jdbcType="INTEGER" property="adminId" />
  34. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  35. <result column="user_name" jdbcType="VARCHAR" property="adminName" />
  36. <result column="block_time" jdbcType="VARCHAR" property="blockTime"/>
  37. </resultMap>
  38. <sql id="Base_Column_List">
  39. id, uid, erban_no, phone, device_id, banned_type, banned_ip, banned_status, banned_minute,
  40. banned_start_time, banned_end_time, banned_desc, admin_id, create_time
  41. </sql>
  42. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  43. select
  44. <include refid="Base_Column_List" />
  45. from account_banned
  46. where id = #{id,jdbcType=INTEGER}
  47. </select>
  48. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  49. delete from account_banned
  50. where id = #{id,jdbcType=INTEGER}
  51. </delete>
  52. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.AccountBanned">
  53. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
  54. SELECT LAST_INSERT_ID()
  55. </selectKey>
  56. insert into account_banned (uid, erban_no, phone,
  57. device_id, banned_type, banned_ip,
  58. banned_status, banned_minute, banned_start_time,
  59. banned_end_time, banned_desc, admin_id,
  60. create_time,block_time)
  61. values (#{uid,jdbcType=BIGINT}, #{erbanNo,jdbcType=BIGINT}, #{phone,jdbcType=VARCHAR},
  62. #{deviceId,jdbcType=VARCHAR}, #{bannedType,jdbcType=VARCHAR}, #{bannedIp,jdbcType=VARCHAR},
  63. #{bannedStatus,jdbcType=TINYINT}, #{bannedMinute,jdbcType=INTEGER}, #{bannedStartTime,jdbcType=TIMESTAMP},
  64. #{bannedEndTime,jdbcType=TIMESTAMP}, #{bannedDesc,jdbcType=VARCHAR}, #{adminId,jdbcType=INTEGER},
  65. #{createTime,jdbcType=TIMESTAMP},#{blockTime,jdbcType=VARCHAR})
  66. </insert>
  67. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.AccountBanned">
  68. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
  69. SELECT LAST_INSERT_ID()
  70. </selectKey>
  71. insert into account_banned
  72. <trim prefix="(" suffix=")" suffixOverrides=",">
  73. <if test="uid != null">
  74. uid,
  75. </if>
  76. <if test="erbanNo != null">
  77. erban_no,
  78. </if>
  79. <if test="phone != null">
  80. phone,
  81. </if>
  82. <if test="deviceId != null">
  83. device_id,
  84. </if>
  85. <if test="bannedType != null">
  86. banned_type,
  87. </if>
  88. <if test="bannedIp != null">
  89. banned_ip,
  90. </if>
  91. <if test="bannedStatus != null">
  92. banned_status,
  93. </if>
  94. <if test="bannedMinute != null">
  95. banned_minute,
  96. </if>
  97. <if test="bannedStartTime != null">
  98. banned_start_time,
  99. </if>
  100. <if test="bannedEndTime != null">
  101. banned_end_time,
  102. </if>
  103. <if test="bannedDesc != null">
  104. banned_desc,
  105. </if>
  106. <if test="adminId != null">
  107. admin_id,
  108. </if>
  109. <if test="createTime != null">
  110. create_time,
  111. </if>
  112. <if test="blockTime != null">
  113. block_time,
  114. </if>
  115. </trim>
  116. <trim prefix="values (" suffix=")" suffixOverrides=",">
  117. <if test="uid != null">
  118. #{uid,jdbcType=BIGINT},
  119. </if>
  120. <if test="erbanNo != null">
  121. #{erbanNo,jdbcType=BIGINT},
  122. </if>
  123. <if test="phone != null">
  124. #{phone,jdbcType=VARCHAR},
  125. </if>
  126. <if test="deviceId != null">
  127. #{deviceId,jdbcType=VARCHAR},
  128. </if>
  129. <if test="bannedType != null">
  130. #{bannedType,jdbcType=VARCHAR},
  131. </if>
  132. <if test="bannedIp != null">
  133. #{bannedIp,jdbcType=VARCHAR},
  134. </if>
  135. <if test="bannedStatus != null">
  136. #{bannedStatus,jdbcType=TINYINT},
  137. </if>
  138. <if test="bannedMinute != null">
  139. #{bannedMinute,jdbcType=INTEGER},
  140. </if>
  141. <if test="bannedStartTime != null">
  142. #{bannedStartTime,jdbcType=TIMESTAMP},
  143. </if>
  144. <if test="bannedEndTime != null">
  145. #{bannedEndTime,jdbcType=TIMESTAMP},
  146. </if>
  147. <if test="bannedDesc != null">
  148. #{bannedDesc,jdbcType=VARCHAR},
  149. </if>
  150. <if test="adminId != null">
  151. #{adminId,jdbcType=INTEGER},
  152. </if>
  153. <if test="createTime != null">
  154. #{createTime,jdbcType=TIMESTAMP},
  155. </if>
  156. <if test="blockTime != null" >
  157. #{blockTime,jdbcType=VARCHAR},
  158. </if>
  159. </trim>
  160. </insert>
  161. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.AccountBanned">
  162. update account_banned
  163. <set>
  164. <if test="uid != null">
  165. uid = #{uid,jdbcType=BIGINT},
  166. </if>
  167. <if test="erbanNo != null">
  168. erban_no = #{erbanNo,jdbcType=BIGINT},
  169. </if>
  170. <if test="phone != null">
  171. phone = #{phone,jdbcType=VARCHAR},
  172. </if>
  173. <if test="deviceId != null">
  174. device_id = #{deviceId,jdbcType=VARCHAR},
  175. </if>
  176. <if test="bannedType != null">
  177. banned_type = #{bannedType,jdbcType=VARCHAR},
  178. </if>
  179. <if test="bannedIp != null">
  180. banned_ip = #{bannedIp,jdbcType=VARCHAR},
  181. </if>
  182. <if test="bannedStatus != null">
  183. banned_status = #{bannedStatus,jdbcType=TINYINT},
  184. </if>
  185. <if test="bannedMinute != null">
  186. banned_minute = #{bannedMinute,jdbcType=INTEGER},
  187. </if>
  188. <if test="bannedStartTime != null">
  189. banned_start_time = #{bannedStartTime,jdbcType=TIMESTAMP},
  190. </if>
  191. <if test="bannedEndTime != null">
  192. banned_end_time = #{bannedEndTime,jdbcType=TIMESTAMP},
  193. </if>
  194. <if test="bannedDesc != null">
  195. banned_desc = #{bannedDesc,jdbcType=VARCHAR},
  196. </if>
  197. <if test="adminId != null">
  198. admin_id = #{adminId,jdbcType=INTEGER},
  199. </if>
  200. <if test="createTime != null">
  201. create_time = #{createTime,jdbcType=TIMESTAMP},
  202. </if>
  203. <if test="blockTime != null" >
  204. block_time = #{blockTime,jdbcType=VARCHAR},
  205. </if>
  206. </set>
  207. where id = #{id,jdbcType=INTEGER}
  208. </update>
  209. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.AccountBanned">
  210. update account_banned
  211. set uid = #{uid,jdbcType=BIGINT},
  212. erban_no = #{erbanNo,jdbcType=BIGINT},
  213. phone = #{phone,jdbcType=VARCHAR},
  214. device_id = #{deviceId,jdbcType=VARCHAR},
  215. banned_type = #{bannedType,jdbcType=VARCHAR},
  216. banned_ip = #{bannedIp,jdbcType=VARCHAR},
  217. banned_status = #{bannedStatus,jdbcType=TINYINT},
  218. banned_minute = #{bannedMinute,jdbcType=INTEGER},
  219. banned_start_time = #{bannedStartTime,jdbcType=TIMESTAMP},
  220. banned_end_time = #{bannedEndTime,jdbcType=TIMESTAMP},
  221. banned_desc = #{bannedDesc,jdbcType=VARCHAR},
  222. admin_id = #{adminId,jdbcType=INTEGER},
  223. create_time = #{createTime,jdbcType=TIMESTAMP},
  224. block_time = #{blockType,jdbcType=VARCHAR}
  225. where id = #{id,jdbcType=INTEGER}
  226. </update>
  227. <select id="selectAccountBannedByList" resultMap="BaseVOResultMap">
  228. select ab.id, ab.uid, ab.erban_no, ab.phone, ab.device_id, ab.banned_type, ab.banned_ip,ab.banned_status,
  229. ab.banned_minute,ab.banned_start_time, ab.banned_end_time, ab.banned_desc, ab.admin_id, ab.create_time,
  230. su.user_name,ab.block_time
  231. from account_banned ab
  232. left join sys_user su on ab.admin_id = su.user_id
  233. where
  234. 1 = 1
  235. <if test="erbanNo != null and erbanNo != ''">
  236. and ab.erban_no = #{erbanNo}
  237. </if>
  238. <if test="deviceId != null and deviceId != ''">
  239. and ab.device_id = #{deviceId}
  240. </if>
  241. <if test="type != null">
  242. and ab.banned_type = #{type}
  243. </if>
  244. <if test="adminName != null and adminName != ''">
  245. and su.user_name = #{adminName}
  246. </if>
  247. order by ab.create_time desc
  248. </select>
  249. <select id="selectByUid" resultMap="BaseResultMap">
  250. select
  251. <include refid="Base_Column_List" />
  252. from account_banned
  253. where uid = #{uid}
  254. </select>
  255. </mapper>