AccountMapper.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  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.users.AccountMapper">
  6. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.Account">
  7. <id column="uid" property="uid" jdbcType="BIGINT"/>
  8. <result column="phone" property="phone" jdbcType="VARCHAR"/>
  9. <result column="erban_no" property="erbanNo" jdbcType="BIGINT"/>
  10. <result column="password" property="password" jdbcType="VARCHAR"/>
  11. <result column="netease_token" property="neteaseToken" jdbcType="VARCHAR"/>
  12. <result column="state" property="state" jdbcType="VARCHAR"/>
  13. <result column="last_login_time" property="lastLoginTime" jdbcType="TIMESTAMP"/>
  14. <result column="last_login_ip" property="lastLoginIp" jdbcType="VARCHAR"/>
  15. <result column="register_ip" property="registerIp" jdbcType="VARCHAR"/>
  16. <result column="weixin_openid" property="weixinOpenid" jdbcType="VARCHAR"/>
  17. <result column="weixin_unionid" property="weixinUnionid" jdbcType="VARCHAR"/>
  18. <result column="qq_openid" property="qqOpenid" jdbcType="VARCHAR"/>
  19. <result column="qq_unionid" property="qqUnionid" jdbcType="VARCHAR"/>
  20. <result column="os" property="os" jdbcType="VARCHAR"/>
  21. <result column="osVersion" property="osversion" jdbcType="VARCHAR"/>
  22. <result column="app" property="app" jdbcType="VARCHAR"/>
  23. <result column="imei" property="imei" jdbcType="VARCHAR"/>
  24. <result column="channel" property="channel" jdbcType="VARCHAR"/>
  25. <result column="linkedme_channel" property="linkedmeChannel" jdbcType="VARCHAR"/>
  26. <result column="isp_type" property="ispType" jdbcType="VARCHAR"/>
  27. <result column="net_type" property="netType" jdbcType="VARCHAR"/>
  28. <result column="model" property="model" jdbcType="VARCHAR"/>
  29. <result column="device_id" property="deviceId" jdbcType="VARCHAR"/>
  30. <result column="app_version" property="appVersion" jdbcType="VARCHAR"/>
  31. <result column="acc_block_start_time" property="accBlockStartTime" jdbcType="TIMESTAMP"/>
  32. <result column="acc_block_end_time" property="accBlockEndTime" jdbcType="TIMESTAMP"/>
  33. <result column="device_block_start_time" property="deviceBlockStartTime" jdbcType="TIMESTAMP"/>
  34. <result column="device_block_end_time" property="deviceBlockEndTime" jdbcType="TIMESTAMP"/>
  35. <result column="sign_time" property="signTime" jdbcType="TIMESTAMP"/>
  36. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  37. </resultMap>
  38. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.Account">
  39. <selectKey resultType="java.lang.Long" keyProperty="uid" order="AFTER">
  40. SELECT LAST_INSERT_ID()
  41. </selectKey>
  42. insert into account (phone, erban_no, password,
  43. netease_token, state, last_login_time,
  44. last_login_ip, register_ip, weixin_openid,
  45. weixin_unionid, qq_openid, qq_unionid,
  46. os, osVersion, app,
  47. imei, channel, linkedme_channel,
  48. isp_type, net_type, model,
  49. device_id, app_version, acc_block_start_time,
  50. acc_block_end_time, device_block_start_time,
  51. device_block_end_time, sign_time, update_time
  52. )
  53. values (#{phone,jdbcType=VARCHAR}, #{erbanNo,jdbcType=BIGINT}, #{password,jdbcType=VARCHAR},
  54. #{neteaseToken,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=TIMESTAMP},
  55. #{lastLoginIp,jdbcType=VARCHAR}, #{registerIp,jdbcType=VARCHAR}, #{weixinOpenid,jdbcType=VARCHAR},
  56. #{weixinUnionid,jdbcType=VARCHAR}, #{qqOpenid,jdbcType=VARCHAR}, #{qqUnionid,jdbcType=VARCHAR},
  57. #{os,jdbcType=VARCHAR}, #{osversion,jdbcType=VARCHAR}, #{app,jdbcType=VARCHAR},
  58. #{imei,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}, #{linkedmeChannel,jdbcType=VARCHAR},
  59. #{ispType,jdbcType=VARCHAR}, #{netType,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR},
  60. #{deviceId,jdbcType=VARCHAR}, #{appVersion,jdbcType=VARCHAR}, #{accBlockStartTime,jdbcType=TIMESTAMP},
  61. #{accBlockEndTime,jdbcType=TIMESTAMP}, #{deviceBlockStartTime,jdbcType=TIMESTAMP},
  62. #{deviceBlockEndTime,jdbcType=TIMESTAMP}, #{signTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
  63. )
  64. </insert>
  65. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.Account">
  66. <selectKey resultType="java.lang.Long" keyProperty="uid" order="AFTER">
  67. SELECT LAST_INSERT_ID()
  68. </selectKey>
  69. insert into account
  70. <trim prefix="(" suffix=")" suffixOverrides=",">
  71. <if test="phone != null">
  72. phone,
  73. </if>
  74. <if test="erbanNo != null">
  75. erban_no,
  76. </if>
  77. <if test="password != null">
  78. password,
  79. </if>
  80. <if test="neteaseToken != null">
  81. netease_token,
  82. </if>
  83. <if test="state != null">
  84. state,
  85. </if>
  86. <if test="lastLoginTime != null">
  87. last_login_time,
  88. </if>
  89. <if test="lastLoginIp != null">
  90. last_login_ip,
  91. </if>
  92. <if test="registerIp != null">
  93. register_ip,
  94. </if>
  95. <if test="weixinOpenid != null">
  96. weixin_openid,
  97. </if>
  98. <if test="weixinUnionid != null">
  99. weixin_unionid,
  100. </if>
  101. <if test="qqOpenid != null">
  102. qq_openid,
  103. </if>
  104. <if test="qqUnionid != null">
  105. qq_unionid,
  106. </if>
  107. <if test="os != null">
  108. os,
  109. </if>
  110. <if test="osversion != null">
  111. osVersion,
  112. </if>
  113. <if test="app != null">
  114. app,
  115. </if>
  116. <if test="imei != null">
  117. imei,
  118. </if>
  119. <if test="channel != null">
  120. channel,
  121. </if>
  122. <if test="linkedmeChannel != null">
  123. linkedme_channel,
  124. </if>
  125. <if test="ispType != null">
  126. isp_type,
  127. </if>
  128. <if test="netType != null">
  129. net_type,
  130. </if>
  131. <if test="model != null">
  132. model,
  133. </if>
  134. <if test="deviceId != null">
  135. device_id,
  136. </if>
  137. <if test="appVersion != null">
  138. app_version,
  139. </if>
  140. <if test="accBlockStartTime != null">
  141. acc_block_start_time,
  142. </if>
  143. <if test="accBlockEndTime != null">
  144. acc_block_end_time,
  145. </if>
  146. <if test="deviceBlockStartTime != null">
  147. device_block_start_time,
  148. </if>
  149. <if test="deviceBlockEndTime != null">
  150. device_block_end_time,
  151. </if>
  152. <if test="signTime != null">
  153. sign_time,
  154. </if>
  155. <if test="updateTime != null">
  156. update_time,
  157. </if>
  158. </trim>
  159. <trim prefix="values (" suffix=")" suffixOverrides=",">
  160. <if test="phone != null">
  161. #{phone,jdbcType=VARCHAR},
  162. </if>
  163. <if test="erbanNo != null">
  164. #{erbanNo,jdbcType=BIGINT},
  165. </if>
  166. <if test="password != null">
  167. #{password,jdbcType=VARCHAR},
  168. </if>
  169. <if test="neteaseToken != null">
  170. #{neteaseToken,jdbcType=VARCHAR},
  171. </if>
  172. <if test="state != null">
  173. #{state,jdbcType=VARCHAR},
  174. </if>
  175. <if test="lastLoginTime != null">
  176. #{lastLoginTime,jdbcType=TIMESTAMP},
  177. </if>
  178. <if test="lastLoginIp != null">
  179. #{lastLoginIp,jdbcType=VARCHAR},
  180. </if>
  181. <if test="registerIp != null">
  182. #{registerIp,jdbcType=VARCHAR},
  183. </if>
  184. <if test="weixinOpenid != null">
  185. #{weixinOpenid,jdbcType=VARCHAR},
  186. </if>
  187. <if test="weixinUnionid != null">
  188. #{weixinUnionid,jdbcType=VARCHAR},
  189. </if>
  190. <if test="qqOpenid != null">
  191. #{qqOpenid,jdbcType=VARCHAR},
  192. </if>
  193. <if test="qqUnionid != null">
  194. #{qqUnionid,jdbcType=VARCHAR},
  195. </if>
  196. <if test="os != null">
  197. #{os,jdbcType=VARCHAR},
  198. </if>
  199. <if test="osversion != null">
  200. #{osversion,jdbcType=VARCHAR},
  201. </if>
  202. <if test="app != null">
  203. #{app,jdbcType=VARCHAR},
  204. </if>
  205. <if test="imei != null">
  206. #{imei,jdbcType=VARCHAR},
  207. </if>
  208. <if test="channel != null">
  209. #{channel,jdbcType=VARCHAR},
  210. </if>
  211. <if test="linkedmeChannel != null">
  212. #{linkedmeChannel,jdbcType=VARCHAR},
  213. </if>
  214. <if test="ispType != null">
  215. #{ispType,jdbcType=VARCHAR},
  216. </if>
  217. <if test="netType != null">
  218. #{netType,jdbcType=VARCHAR},
  219. </if>
  220. <if test="model != null">
  221. #{model,jdbcType=VARCHAR},
  222. </if>
  223. <if test="deviceId != null">
  224. #{deviceId,jdbcType=VARCHAR},
  225. </if>
  226. <if test="appVersion != null">
  227. #{appVersion,jdbcType=VARCHAR},
  228. </if>
  229. <if test="accBlockStartTime != null">
  230. #{accBlockStartTime,jdbcType=TIMESTAMP},
  231. </if>
  232. <if test="accBlockEndTime != null">
  233. #{accBlockEndTime,jdbcType=TIMESTAMP},
  234. </if>
  235. <if test="deviceBlockStartTime != null">
  236. #{deviceBlockStartTime,jdbcType=TIMESTAMP},
  237. </if>
  238. <if test="deviceBlockEndTime != null">
  239. #{deviceBlockEndTime,jdbcType=TIMESTAMP},
  240. </if>
  241. <if test="signTime != null">
  242. #{signTime,jdbcType=TIMESTAMP},
  243. </if>
  244. <if test="updateTime != null">
  245. #{updateTime,jdbcType=TIMESTAMP},
  246. </if>
  247. </trim>
  248. </insert>
  249. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.Account">
  250. update account
  251. <set>
  252. <if test="phone != null">
  253. phone = #{phone,jdbcType=VARCHAR},
  254. </if>
  255. <if test="erbanNo != null">
  256. erban_no = #{erbanNo,jdbcType=BIGINT},
  257. </if>
  258. <if test="password != null">
  259. password = #{password,jdbcType=VARCHAR},
  260. </if>
  261. <if test="neteaseToken != null">
  262. netease_token = #{neteaseToken,jdbcType=VARCHAR},
  263. </if>
  264. <if test="state != null">
  265. state = #{state,jdbcType=VARCHAR},
  266. </if>
  267. <if test="lastLoginTime != null">
  268. last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
  269. </if>
  270. <if test="lastLoginIp != null">
  271. last_login_ip = #{lastLoginIp,jdbcType=VARCHAR},
  272. </if>
  273. <if test="registerIp != null">
  274. register_ip = #{registerIp,jdbcType=VARCHAR},
  275. </if>
  276. <if test="weixinOpenid != null">
  277. weixin_openid = #{weixinOpenid,jdbcType=VARCHAR},
  278. </if>
  279. <if test="weixinUnionid != null">
  280. weixin_unionid = #{weixinUnionid,jdbcType=VARCHAR},
  281. </if>
  282. <if test="qqOpenid != null">
  283. qq_openid = #{qqOpenid,jdbcType=VARCHAR},
  284. </if>
  285. <if test="qqUnionid != null">
  286. qq_unionid = #{qqUnionid,jdbcType=VARCHAR},
  287. </if>
  288. <if test="os != null">
  289. os = #{os,jdbcType=VARCHAR},
  290. </if>
  291. <if test="osversion != null">
  292. osVersion = #{osversion,jdbcType=VARCHAR},
  293. </if>
  294. <if test="app != null">
  295. app = #{app,jdbcType=VARCHAR},
  296. </if>
  297. <if test="imei != null">
  298. imei = #{imei,jdbcType=VARCHAR},
  299. </if>
  300. <if test="channel != null">
  301. channel = #{channel,jdbcType=VARCHAR},
  302. </if>
  303. <if test="linkedmeChannel != null">
  304. linkedme_channel = #{linkedmeChannel,jdbcType=VARCHAR},
  305. </if>
  306. <if test="ispType != null">
  307. isp_type = #{ispType,jdbcType=VARCHAR},
  308. </if>
  309. <if test="netType != null">
  310. net_type = #{netType,jdbcType=VARCHAR},
  311. </if>
  312. <if test="model != null">
  313. model = #{model,jdbcType=VARCHAR},
  314. </if>
  315. <if test="deviceId != null">
  316. device_id = #{deviceId,jdbcType=VARCHAR},
  317. </if>
  318. <if test="appVersion != null">
  319. app_version = #{appVersion,jdbcType=VARCHAR},
  320. </if>
  321. <if test="accBlockStartTime != null">
  322. acc_block_start_time = #{accBlockStartTime,jdbcType=TIMESTAMP},
  323. </if>
  324. <if test="accBlockEndTime != null">
  325. acc_block_end_time = #{accBlockEndTime,jdbcType=TIMESTAMP},
  326. </if>
  327. <if test="deviceBlockStartTime != null">
  328. device_block_start_time = #{deviceBlockStartTime,jdbcType=TIMESTAMP},
  329. </if>
  330. <if test="deviceBlockEndTime != null">
  331. device_block_end_time = #{deviceBlockEndTime,jdbcType=TIMESTAMP},
  332. </if>
  333. <if test="signTime != null">
  334. sign_time = #{signTime,jdbcType=TIMESTAMP},
  335. </if>
  336. <if test="updateTime != null">
  337. update_time = #{updateTime,jdbcType=TIMESTAMP},
  338. </if>
  339. </set>
  340. where uid = #{uid,jdbcType=BIGINT}
  341. </update>
  342. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.Account">
  343. update account
  344. set phone = #{phone,jdbcType=VARCHAR},
  345. erban_no = #{erbanNo,jdbcType=BIGINT},
  346. password = #{password,jdbcType=VARCHAR},
  347. netease_token = #{neteaseToken,jdbcType=VARCHAR},
  348. state = #{state,jdbcType=VARCHAR},
  349. last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
  350. last_login_ip = #{lastLoginIp,jdbcType=VARCHAR},
  351. register_ip = #{registerIp,jdbcType=VARCHAR},
  352. weixin_openid = #{weixinOpenid,jdbcType=VARCHAR},
  353. weixin_unionid = #{weixinUnionid,jdbcType=VARCHAR},
  354. qq_openid = #{qqOpenid,jdbcType=VARCHAR},
  355. qq_unionid = #{qqUnionid,jdbcType=VARCHAR},
  356. os = #{os,jdbcType=VARCHAR},
  357. osVersion = #{osversion,jdbcType=VARCHAR},
  358. app = #{app,jdbcType=VARCHAR},
  359. imei = #{imei,jdbcType=VARCHAR},
  360. channel = #{channel,jdbcType=VARCHAR},
  361. linkedme_channel = #{linkedmeChannel,jdbcType=VARCHAR},
  362. isp_type = #{ispType,jdbcType=VARCHAR},
  363. net_type = #{netType,jdbcType=VARCHAR},
  364. model = #{model,jdbcType=VARCHAR},
  365. device_id = #{deviceId,jdbcType=VARCHAR},
  366. app_version = #{appVersion,jdbcType=VARCHAR},
  367. acc_block_start_time = #{accBlockStartTime,jdbcType=TIMESTAMP},
  368. acc_block_end_time = #{accBlockEndTime,jdbcType=TIMESTAMP},
  369. device_block_start_time = #{deviceBlockStartTime,jdbcType=TIMESTAMP},
  370. device_block_end_time = #{deviceBlockEndTime,jdbcType=TIMESTAMP},
  371. sign_time = #{signTime,jdbcType=TIMESTAMP},
  372. update_time = #{updateTime,jdbcType=TIMESTAMP}
  373. where uid = #{uid,jdbcType=BIGINT}
  374. </update>
  375. <sql id="Base_Column_List">
  376. uid, phone, erban_no, password, netease_token, state, last_login_time, last_login_ip,
  377. register_ip, weixin_openid, weixin_unionid, qq_openid, qq_unionid, os, osVersion,
  378. app, imei, channel, linkedme_channel, isp_type, net_type, model, device_id, app_version,
  379. acc_block_start_time, acc_block_end_time, device_block_start_time, device_block_end_time,
  380. sign_time, update_time
  381. </sql>
  382. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
  383. select
  384. <include refid="Base_Column_List"/>
  385. from account
  386. where uid = #{uid,jdbcType=BIGINT}
  387. </select>
  388. <select id="getAccountByErBanNo" resultMap="BaseResultMap" parameterType="java.lang.Long">
  389. select
  390. <include refid="Base_Column_List"/>
  391. from account
  392. where erban_no = #{erBanNo}
  393. </select>
  394. </mapper>