UsersMapper.xml 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843
  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.UsersMapper">
  6. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.Users" >
  7. <id column="uid" property="uid" jdbcType="BIGINT" />
  8. <result column="erban_no" property="erbanNo" jdbcType="BIGINT" />
  9. <result column="has_pretty_erban_no" property="hasPrettyErbanNo" jdbcType="BIT" />
  10. <result column="phone" property="phone" jdbcType="VARCHAR" />
  11. <result column="birth" property="birth" jdbcType="DATE" />
  12. <result column="star" property="star" jdbcType="TINYINT" />
  13. <result column="nick" property="nick" jdbcType="VARCHAR" />
  14. <result column="email" property="email" jdbcType="VARCHAR" />
  15. <result column="signture" property="signture" jdbcType="VARCHAR" />
  16. <result column="user_voice" property="userVoice" jdbcType="VARCHAR" />
  17. <result column="voice_dura" property="voiceDura" jdbcType="INTEGER" />
  18. <result column="follow_num" property="followNum" jdbcType="INTEGER" />
  19. <result column="fans_num" property="fansNum" jdbcType="INTEGER" />
  20. <result column="def_user" property="defUser" jdbcType="TINYINT" />
  21. <result column="fortune" property="fortune" jdbcType="BIGINT" />
  22. <result column="channel_type" property="channelType" jdbcType="TINYINT" />
  23. <result column="last_login_time" property="lastLoginTime" jdbcType="TIMESTAMP" />
  24. <result column="last_login_ip" property="lastLoginIp" jdbcType="VARCHAR" />
  25. <result column="gender" property="gender" jdbcType="TINYINT" />
  26. <result column="avatar" property="avatar" jdbcType="VARCHAR" />
  27. <result column="region" property="region" jdbcType="VARCHAR" />
  28. <result column="user_desc" property="userDesc" jdbcType="VARCHAR" />
  29. <result column="alipay_account" property="alipayAccount" jdbcType="VARCHAR" />
  30. <result column="alipay_account_name" property="alipayAccountName" jdbcType="VARCHAR" />
  31. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  32. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  33. <result column="wx_pub_fans_openid" property="wxPubFansOpenid" jdbcType="VARCHAR" />
  34. <result column="wx_pub_fans_gender" property="wxPubFansGender" jdbcType="TINYINT" />
  35. <result column="room_uid" property="roomUid" jdbcType="BIGINT" />
  36. <result column="share_uid" property="shareUid" jdbcType="BIGINT" />
  37. <result column="share_channel" property="shareChannel" jdbcType="TINYINT" />
  38. <result column="wx_openId" property="wxOpenId" jdbcType="VARCHAR" />
  39. <result column="os" property="os" jdbcType="VARCHAR" />
  40. <result column="osVersion" property="osVersion" jdbcType="VARCHAR" />
  41. <result column="app" property="app" jdbcType="VARCHAR" />
  42. <result column="imei" property="imei" jdbcType="VARCHAR" />
  43. <result column="channel" property="channel" jdbcType="VARCHAR" />
  44. <result column="linkedme_channel" property="linkedmeChannel" jdbcType="VARCHAR" />
  45. <result column="isp_type" property="ispType" jdbcType="VARCHAR" />
  46. <result column="net_type" property="netType" jdbcType="VARCHAR" />
  47. <result column="model" property="model" jdbcType="VARCHAR" />
  48. <result column="device_id" property="deviceId" jdbcType="VARCHAR" />
  49. <result column="app_version" property="appVersion" jdbcType="VARCHAR" />
  50. <result column="noble_id" property="nobleId" jdbcType="INTEGER" />
  51. <result column="noble_name" property="nobleName" jdbcType="VARCHAR" />
  52. <result column="withdraw_status" property="withdrawStatus" jdbcType="TINYINT" />
  53. </resultMap>
  54. <resultMap id="UsersGoldResultMap" type="com.juxiao.xchat.module.xbd.vo.UsersGoldVO" >
  55. <id column="uid" property="uid" jdbcType="BIGINT" />
  56. <result column="erban_no" property="erbanNo" jdbcType="BIGINT" />
  57. <result column="phone" property="phone" jdbcType="VARCHAR" />
  58. <result column="birth" property="birth" jdbcType="DATE" />
  59. <result column="star" property="star" jdbcType="TINYINT" />
  60. <result column="nick" property="nick" jdbcType="VARCHAR" />
  61. <result column="email" property="email" jdbcType="VARCHAR" />
  62. <result column="signture" property="signture" jdbcType="VARCHAR" />
  63. <result column="user_voice" property="userVoice" jdbcType="VARCHAR" />
  64. <result column="voice_dura" property="voiceDura" jdbcType="INTEGER" />
  65. <result column="follow_num" property="followNum" jdbcType="INTEGER" />
  66. <result column="fans_num" property="fansNum" jdbcType="INTEGER" />
  67. <result column="def_user" property="defUser" jdbcType="TINYINT" />
  68. <result column="fortune" property="fortune" jdbcType="BIGINT" />
  69. <result column="channel_type" property="channelType" jdbcType="TINYINT" />
  70. <result column="last_login_time" property="lastLoginTime" jdbcType="TIMESTAMP" />
  71. <result column="last_login_ip" property="lastLoginIp" jdbcType="VARCHAR" />
  72. <result column="gender" property="gender" jdbcType="TINYINT" />
  73. <result column="avatar" property="avatar" jdbcType="VARCHAR" />
  74. <result column="region" property="region" jdbcType="VARCHAR" />
  75. <result column="user_desc" property="userDesc" jdbcType="VARCHAR" />
  76. <result column="alipay_account" property="alipayAccount" jdbcType="VARCHAR" />
  77. <result column="alipay_account_name" property="alipayAccountName" jdbcType="VARCHAR" />
  78. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  79. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  80. <result column="wx_pub_fans_openid" property="wxPubFansOpenid" jdbcType="VARCHAR" />
  81. <result column="wx_pub_fans_gender" property="wxPubFansGender" jdbcType="TINYINT" />
  82. <result column="room_uid" property="roomUid" jdbcType="BIGINT" />
  83. <result column="share_uid" property="shareUid" jdbcType="BIGINT" />
  84. <result column="share_channel" property="shareChannel" jdbcType="TINYINT" />
  85. <result column="wx_openId" property="wxOpenId" jdbcType="VARCHAR" />
  86. <result column="os" property="os" jdbcType="VARCHAR" />
  87. <result column="osVersion" property="osVersion" jdbcType="VARCHAR" />
  88. <result column="app" property="app" jdbcType="VARCHAR" />
  89. <result column="imei" property="imei" jdbcType="VARCHAR" />
  90. <result column="channel" property="channel" jdbcType="VARCHAR" />
  91. <result column="linkedme_channel" property="linkedmeChannel" jdbcType="VARCHAR" />
  92. <result column="isp_type" property="ispType" jdbcType="VARCHAR" />
  93. <result column="net_type" property="netType" jdbcType="VARCHAR" />
  94. <result column="model" property="model" jdbcType="VARCHAR" />
  95. <result column="device_id" property="deviceId" jdbcType="VARCHAR" />
  96. <result column="app_version" property="appVersion" jdbcType="VARCHAR" />
  97. <result column="gold_num" property="goldNum" jdbcType="BIGINT" />
  98. </resultMap>
  99. <select id="listUsers" resultType="com.juxiao.xchat.module.xbd.dto.UserDTO">
  100. SELECT
  101. acn.erban_no AS erbanNo,
  102. usrs.avatar AS avatar,
  103. acn.uid AS uid,
  104. usrs.nick AS nick,
  105. up.diamond_num AS diamondNum,
  106. up.gold_num AS goldNum,
  107. acn.phone AS phone,
  108. usrs.birth AS birth,
  109. usrs.gender AS gender,
  110. usrs.def_user AS defUser,
  111. usrs.create_time AS createTime,
  112. usrs.app_version AS appVersion
  113. FROM
  114. `account` acn
  115. LEFT JOIN
  116. users usrs
  117. ON
  118. acn.uid = usrs.uid
  119. LEFT JOIN
  120. user_purse up
  121. ON
  122. acn.uid = up.uid
  123. <where>
  124. 1 = 1
  125. <choose>
  126. <when test="uidList != null and erBanNoList != null">
  127. and (acn.erban_no IN
  128. <foreach collection="erBanNoList" item="item" open="(" separator="," close=")">
  129. #{item}
  130. </foreach>
  131. OR acn.uid IN
  132. <foreach collection="uidList" item="item" open="(" separator="," close=")">
  133. #{item}
  134. </foreach>
  135. )
  136. </when>
  137. <otherwise>
  138. <if test="erBanNoList != null">
  139. and acn.erban_no IN
  140. <foreach collection="erBanNoList" item="item" open="(" separator="," close=")">
  141. #{item}
  142. </foreach>
  143. </if>
  144. <if test="uidList != null">
  145. acn.uid IN
  146. <foreach collection="uidList" item="item" open="(" separator="," close=")">
  147. #{item}
  148. </foreach>
  149. </if>
  150. </otherwise>
  151. </choose>
  152. <if test="beginTime != null and beginTime != ''">
  153. <![CDATA[
  154. AND acn.sign_time >= #{beginTime}
  155. ]]>
  156. </if>
  157. <if test="endTime != null and endTime != ''">
  158. <![CDATA[AND acn.sign_time <= #{endTime}]]>
  159. </if>
  160. <if test="gender != null">
  161. AND usrs.gender = #{gender}
  162. </if>
  163. <if test="defUser != null">
  164. AND usrs.def_user = #{defUser}
  165. </if>
  166. </where>
  167. </select>
  168. <select id="getUsersByUId" resultType="com.juxiao.xchat.module.xbd.dto.UserDTO">
  169. SELECT
  170. acn.erban_no AS erbanNo,
  171. usrs.avatar AS avatar,
  172. acn.uid AS uid,
  173. usrs.nick AS nick,
  174. acn.phone AS phone,
  175. usrs.birth AS birth,
  176. usrs.gender AS gender,
  177. usrs.def_user AS defUser,
  178. usrs.create_time AS createTime,
  179. usrs.app_version AS appVersion
  180. FROM
  181. `account` acn
  182. LEFT JOIN
  183. users usrs
  184. ON
  185. acn.uid = usrs.uid
  186. WHERE acn.uid = #{uid}
  187. </select>
  188. <resultMap id="UsersDtoResultMap" type="com.juxiao.xchat.module.xbd.dto.UsersDTO">
  189. <id column="uid" property="uid" jdbcType="BIGINT"/>
  190. <result column="erban_no" property="erbanNo" jdbcType="BIGINT"/>
  191. <result column="has_pretty_erban_no" property="hasPrettyErbanNo" jdbcType="BIT"/>
  192. <result column="phone" property="phone" jdbcType="VARCHAR"/>
  193. <result column="birth" property="birth" jdbcType="DATE"/>
  194. <result column="star" property="star" jdbcType="TINYINT"/>
  195. <result column="nick" property="nick" jdbcType="VARCHAR"/>
  196. <result column="email" property="email" jdbcType="VARCHAR"/>
  197. <result column="signture" property="signture" jdbcType="VARCHAR"/>
  198. <result column="user_voice" property="userVoice" jdbcType="VARCHAR"/>
  199. <result column="voice_dura" property="voiceDura" jdbcType="INTEGER"/>
  200. <result column="follow_num" property="followNum" jdbcType="INTEGER"/>
  201. <result column="fans_num" property="fansNum" jdbcType="INTEGER"/>
  202. <result column="def_user" property="defUser" jdbcType="TINYINT"/>
  203. <result column="fortune" property="fortune" jdbcType="BIGINT"/>
  204. <result column="channel_type" property="channelType" jdbcType="TINYINT"/>
  205. <result column="last_login_time" property="lastLoginTime" jdbcType="TIMESTAMP"/>
  206. <result column="last_login_ip" property="lastLoginIp" jdbcType="VARCHAR"/>
  207. <result column="gender" property="gender" jdbcType="TINYINT"/>
  208. <result column="avatar" property="avatar" jdbcType="VARCHAR"/>
  209. <result column="region" property="region" jdbcType="VARCHAR"/>
  210. <result column="user_desc" property="userDesc" jdbcType="VARCHAR"/>
  211. <result column="alipay_account" property="alipayAccount" jdbcType="VARCHAR"/>
  212. <result column="alipay_account_name" property="alipayAccountName" jdbcType="VARCHAR"/>
  213. <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
  214. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  215. <result column="wx_pub_fans_openid" property="wxPubFansOpenid" jdbcType="VARCHAR"/>
  216. <result column="wx_pub_fans_gender" property="wxPubFansGender" jdbcType="TINYINT"/>
  217. <result column="room_uid" property="roomUid" jdbcType="BIGINT"/>
  218. <result column="share_uid" property="shareUid" jdbcType="BIGINT"/>
  219. <result column="share_channel" property="shareChannel" jdbcType="TINYINT"/>
  220. <result column="wx_openId" property="wxOpenid" jdbcType="VARCHAR"/>
  221. <result column="os" property="os" jdbcType="VARCHAR"/>
  222. <result column="osVersion" property="osversion" jdbcType="VARCHAR"/>
  223. <result column="app" property="app" jdbcType="VARCHAR"/>
  224. <result column="imei" property="imei" jdbcType="VARCHAR"/>
  225. <result column="channel" property="channel" jdbcType="VARCHAR"/>
  226. <result column="linkedme_channel" property="linkedmeChannel" jdbcType="VARCHAR"/>
  227. <result column="isp_type" property="ispType" jdbcType="VARCHAR"/>
  228. <result column="net_type" property="netType" jdbcType="VARCHAR"/>
  229. <result column="model" property="model" jdbcType="VARCHAR"/>
  230. <result column="device_id" property="deviceId" jdbcType="VARCHAR"/>
  231. <result column="app_version" property="appVersion" jdbcType="VARCHAR"/>
  232. <result column="noble_id" property="nobleId" jdbcType="INTEGER"/>
  233. <result column="noble_name" property="nobleName" jdbcType="VARCHAR"/>
  234. <result column="withdraw_status" property="withdrawStatus" jdbcType="TINYINT"/>
  235. <result column="share_code" property="shareCode" jdbcType="BIGINT"/>
  236. </resultMap>
  237. <select id="getUser" parameterType="java.lang.Long" resultMap="UsersDtoResultMap">
  238. <![CDATA[
  239. SELECT
  240. uid,
  241. erban_no,
  242. has_pretty_erban_no,
  243. phone,
  244. birth,
  245. star,
  246. nick,
  247. email,
  248. signture,
  249. user_voice,
  250. voice_dura,
  251. follow_num,
  252. fans_num,
  253. def_user,
  254. fortune,
  255. channel_type,
  256. last_login_time,
  257. last_login_ip,
  258. gender,
  259. avatar,
  260. region,
  261. user_desc,
  262. alipay_account,
  263. alipay_account_name,
  264. create_time,
  265. update_time,
  266. wx_pub_fans_openid,
  267. wx_pub_fans_gender,
  268. room_uid,
  269. share_uid,
  270. share_channel,
  271. wx_openId,
  272. os,
  273. osVersion,
  274. app,
  275. imei,
  276. channel,
  277. linkedme_channel,
  278. isp_type,
  279. net_type,
  280. model,
  281. device_id,
  282. app_version,
  283. noble_id,
  284. noble_name,
  285. withdraw_status,
  286. share_code
  287. FROM
  288. `users`
  289. WHERE
  290. `uid` = #{uid,jdbcType=BIGINT}
  291. ]]>
  292. </select>
  293. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.Users" >
  294. insert into users (uid, erban_no, has_pretty_erban_no,
  295. phone, birth, star, nick,
  296. email, signture, user_voice,
  297. voice_dura, follow_num, fans_num,
  298. def_user, fortune, channel_type,
  299. last_login_time, last_login_ip, gender,
  300. avatar, region, user_desc,
  301. alipay_account, alipay_account_name, create_time,
  302. update_time, wx_pub_fans_openid, wx_pub_fans_gender,
  303. room_uid, share_uid, share_channel,
  304. wx_openId, os, osVersion,
  305. app, imei, channel,
  306. linkedme_channel, isp_type, net_type,
  307. model, device_id, app_version,
  308. noble_id, noble_name, withdraw_status
  309. )
  310. values (#{uid,jdbcType=BIGINT}, #{erbanNo,jdbcType=BIGINT}, #{hasPrettyErbanNo,jdbcType=BIT},
  311. #{phone,jdbcType=VARCHAR}, #{birth,jdbcType=DATE}, #{star,jdbcType=TINYINT}, #{nick,jdbcType=VARCHAR},
  312. #{email,jdbcType=VARCHAR}, #{signture,jdbcType=VARCHAR}, #{userVoice,jdbcType=VARCHAR},
  313. #{voiceDura,jdbcType=INTEGER}, #{followNum,jdbcType=INTEGER}, #{fansNum,jdbcType=INTEGER},
  314. #{defUser,jdbcType=TINYINT}, #{fortune,jdbcType=BIGINT}, #{channelType,jdbcType=TINYINT},
  315. #{lastLoginTime,jdbcType=TIMESTAMP}, #{lastLoginIp,jdbcType=VARCHAR}, #{gender,jdbcType=TINYINT},
  316. #{avatar,jdbcType=VARCHAR}, #{region,jdbcType=VARCHAR}, #{userDesc,jdbcType=VARCHAR},
  317. #{alipayAccount,jdbcType=VARCHAR}, #{alipayAccountName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  318. #{updateTime,jdbcType=TIMESTAMP}, #{wxPubFansOpenid,jdbcType=VARCHAR}, #{wxPubFansGender,jdbcType=TINYINT},
  319. #{roomUid,jdbcType=BIGINT}, #{shareUid,jdbcType=BIGINT}, #{shareChannel,jdbcType=TINYINT},
  320. #{wxOpenId,jdbcType=VARCHAR}, #{os,jdbcType=VARCHAR}, #{osVersion,jdbcType=VARCHAR},
  321. #{app,jdbcType=VARCHAR}, #{imei,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR},
  322. #{linkedmeChannel,jdbcType=VARCHAR}, #{ispType,jdbcType=VARCHAR}, #{netType,jdbcType=VARCHAR},
  323. #{model,jdbcType=VARCHAR}, #{deviceId,jdbcType=VARCHAR}, #{appVersion,jdbcType=VARCHAR},
  324. #{nobleId,jdbcType=INTEGER}, #{nobleName,jdbcType=VARCHAR}, #{withdrawStatus,jdbcType=TINYINT}
  325. )
  326. </insert>
  327. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.Users" >
  328. insert into users
  329. <trim prefix="(" suffix=")" suffixOverrides="," >
  330. <if test="uid != null" >
  331. uid,
  332. </if>
  333. <if test="erbanNo != null" >
  334. erban_no,
  335. </if>
  336. <if test="hasPrettyErbanNo != null" >
  337. has_pretty_erban_no,
  338. </if>
  339. <if test="phone != null" >
  340. phone,
  341. </if>
  342. <if test="birth != null" >
  343. birth,
  344. </if>
  345. <if test="star != null" >
  346. star,
  347. </if>
  348. <if test="nick != null" >
  349. nick,
  350. </if>
  351. <if test="email != null" >
  352. email,
  353. </if>
  354. <if test="signture != null" >
  355. signture,
  356. </if>
  357. <if test="userVoice != null" >
  358. user_voice,
  359. </if>
  360. <if test="voiceDura != null" >
  361. voice_dura,
  362. </if>
  363. <if test="followNum != null" >
  364. follow_num,
  365. </if>
  366. <if test="fansNum != null" >
  367. fans_num,
  368. </if>
  369. <if test="defUser != null" >
  370. def_user,
  371. </if>
  372. <if test="fortune != null" >
  373. fortune,
  374. </if>
  375. <if test="channelType != null" >
  376. channel_type,
  377. </if>
  378. <if test="lastLoginTime != null" >
  379. last_login_time,
  380. </if>
  381. <if test="lastLoginIp != null" >
  382. last_login_ip,
  383. </if>
  384. <if test="gender != null" >
  385. gender,
  386. </if>
  387. <if test="avatar != null" >
  388. avatar,
  389. </if>
  390. <if test="region != null" >
  391. region,
  392. </if>
  393. <if test="userDesc != null" >
  394. user_desc,
  395. </if>
  396. <if test="alipayAccount != null" >
  397. alipay_account,
  398. </if>
  399. <if test="alipayAccountName != null" >
  400. alipay_account_name,
  401. </if>
  402. <if test="createTime != null" >
  403. create_time,
  404. </if>
  405. <if test="updateTime != null" >
  406. update_time,
  407. </if>
  408. <if test="wxPubFansOpenid != null" >
  409. wx_pub_fans_openid,
  410. </if>
  411. <if test="wxPubFansGender != null" >
  412. wx_pub_fans_gender,
  413. </if>
  414. <if test="roomUid != null" >
  415. room_uid,
  416. </if>
  417. <if test="shareUid != null" >
  418. share_uid,
  419. </if>
  420. <if test="shareChannel != null" >
  421. share_channel,
  422. </if>
  423. <if test="wxOpenId != null" >
  424. wx_openId,
  425. </if>
  426. <if test="os != null" >
  427. os,
  428. </if>
  429. <if test="osVersion != null" >
  430. osVersion,
  431. </if>
  432. <if test="app != null" >
  433. app,
  434. </if>
  435. <if test="imei != null" >
  436. imei,
  437. </if>
  438. <if test="channel != null" >
  439. channel,
  440. </if>
  441. <if test="linkedmeChannel != null" >
  442. linkedme_channel,
  443. </if>
  444. <if test="ispType != null" >
  445. isp_type,
  446. </if>
  447. <if test="netType != null" >
  448. net_type,
  449. </if>
  450. <if test="model != null" >
  451. model,
  452. </if>
  453. <if test="deviceId != null" >
  454. device_id,
  455. </if>
  456. <if test="appVersion != null" >
  457. app_version,
  458. </if>
  459. <if test="nobleId != null" >
  460. noble_id,
  461. </if>
  462. <if test="nobleName != null" >
  463. noble_name,
  464. </if>
  465. <if test="withdrawStatus != null" >
  466. withdraw_status,
  467. </if>
  468. </trim>
  469. <trim prefix="values (" suffix=")" suffixOverrides="," >
  470. <if test="uid != null" >
  471. #{uid,jdbcType=BIGINT},
  472. </if>
  473. <if test="erbanNo != null" >
  474. #{erbanNo,jdbcType=BIGINT},
  475. </if>
  476. <if test="hasPrettyErbanNo != null" >
  477. #{hasPrettyErbanNo,jdbcType=BIT},
  478. </if>
  479. <if test="phone != null" >
  480. #{phone,jdbcType=VARCHAR},
  481. </if>
  482. <if test="birth != null" >
  483. #{birth,jdbcType=DATE},
  484. </if>
  485. <if test="star != null" >
  486. #{star,jdbcType=TINYINT},
  487. </if>
  488. <if test="nick != null" >
  489. #{nick,jdbcType=VARCHAR},
  490. </if>
  491. <if test="email != null" >
  492. #{email,jdbcType=VARCHAR},
  493. </if>
  494. <if test="signture != null" >
  495. #{signture,jdbcType=VARCHAR},
  496. </if>
  497. <if test="userVoice != null" >
  498. #{userVoice,jdbcType=VARCHAR},
  499. </if>
  500. <if test="voiceDura != null" >
  501. #{voiceDura,jdbcType=INTEGER},
  502. </if>
  503. <if test="followNum != null" >
  504. #{followNum,jdbcType=INTEGER},
  505. </if>
  506. <if test="fansNum != null" >
  507. #{fansNum,jdbcType=INTEGER},
  508. </if>
  509. <if test="defUser != null" >
  510. #{defUser,jdbcType=TINYINT},
  511. </if>
  512. <if test="fortune != null" >
  513. #{fortune,jdbcType=BIGINT},
  514. </if>
  515. <if test="channelType != null" >
  516. #{channelType,jdbcType=TINYINT},
  517. </if>
  518. <if test="lastLoginTime != null" >
  519. #{lastLoginTime,jdbcType=TIMESTAMP},
  520. </if>
  521. <if test="lastLoginIp != null" >
  522. #{lastLoginIp,jdbcType=VARCHAR},
  523. </if>
  524. <if test="gender != null" >
  525. #{gender,jdbcType=TINYINT},
  526. </if>
  527. <if test="avatar != null" >
  528. #{avatar,jdbcType=VARCHAR},
  529. </if>
  530. <if test="region != null" >
  531. #{region,jdbcType=VARCHAR},
  532. </if>
  533. <if test="userDesc != null" >
  534. #{userDesc,jdbcType=VARCHAR},
  535. </if>
  536. <if test="alipayAccount != null" >
  537. #{alipayAccount,jdbcType=VARCHAR},
  538. </if>
  539. <if test="alipayAccountName != null" >
  540. #{alipayAccountName,jdbcType=VARCHAR},
  541. </if>
  542. <if test="createTime != null" >
  543. #{createTime,jdbcType=TIMESTAMP},
  544. </if>
  545. <if test="updateTime != null" >
  546. #{updateTime,jdbcType=TIMESTAMP},
  547. </if>
  548. <if test="wxPubFansOpenid != null" >
  549. #{wxPubFansOpenid,jdbcType=VARCHAR},
  550. </if>
  551. <if test="wxPubFansGender != null" >
  552. #{wxPubFansGender,jdbcType=TINYINT},
  553. </if>
  554. <if test="roomUid != null" >
  555. #{roomUid,jdbcType=BIGINT},
  556. </if>
  557. <if test="shareUid != null" >
  558. #{shareUid,jdbcType=BIGINT},
  559. </if>
  560. <if test="shareChannel != null" >
  561. #{shareChannel,jdbcType=TINYINT},
  562. </if>
  563. <if test="wxOpenId != null" >
  564. #{wxOpenId,jdbcType=VARCHAR},
  565. </if>
  566. <if test="os != null" >
  567. #{os,jdbcType=VARCHAR},
  568. </if>
  569. <if test="osVersion != null" >
  570. #{osVersion,jdbcType=VARCHAR},
  571. </if>
  572. <if test="app != null" >
  573. #{app,jdbcType=VARCHAR},
  574. </if>
  575. <if test="imei != null" >
  576. #{imei,jdbcType=VARCHAR},
  577. </if>
  578. <if test="channel != null" >
  579. #{channel,jdbcType=VARCHAR},
  580. </if>
  581. <if test="linkedmeChannel != null" >
  582. #{linkedmeChannel,jdbcType=VARCHAR},
  583. </if>
  584. <if test="ispType != null" >
  585. #{ispType,jdbcType=VARCHAR},
  586. </if>
  587. <if test="netType != null" >
  588. #{netType,jdbcType=VARCHAR},
  589. </if>
  590. <if test="model != null" >
  591. #{model,jdbcType=VARCHAR},
  592. </if>
  593. <if test="deviceId != null" >
  594. #{deviceId,jdbcType=VARCHAR},
  595. </if>
  596. <if test="appVersion != null" >
  597. #{appVersion,jdbcType=VARCHAR},
  598. </if>
  599. <if test="nobleId != null" >
  600. #{nobleId,jdbcType=INTEGER},
  601. </if>
  602. <if test="nobleName != null" >
  603. #{nobleName,jdbcType=VARCHAR},
  604. </if>
  605. <if test="withdrawStatus != null" >
  606. #{withdrawStatus,jdbcType=TINYINT},
  607. </if>
  608. </trim>
  609. </insert>
  610. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.Users" >
  611. update users
  612. <set >
  613. <if test="erbanNo != null" >
  614. erban_no = #{erbanNo,jdbcType=BIGINT},
  615. </if>
  616. <if test="hasPrettyErbanNo != null" >
  617. has_pretty_erban_no = #{hasPrettyErbanNo,jdbcType=BIT},
  618. </if>
  619. <if test="phone != null" >
  620. phone = #{phone,jdbcType=VARCHAR},
  621. </if>
  622. <if test="birth != null" >
  623. birth = #{birth,jdbcType=DATE},
  624. </if>
  625. <if test="star != null" >
  626. star = #{star,jdbcType=TINYINT},
  627. </if>
  628. <if test="nick != null" >
  629. nick = #{nick,jdbcType=VARCHAR},
  630. </if>
  631. <if test="email != null" >
  632. email = #{email,jdbcType=VARCHAR},
  633. </if>
  634. <if test="signture != null" >
  635. signture = #{signture,jdbcType=VARCHAR},
  636. </if>
  637. <if test="userVoice != null" >
  638. user_voice = #{userVoice,jdbcType=VARCHAR},
  639. </if>
  640. <if test="voiceDura != null" >
  641. voice_dura = #{voiceDura,jdbcType=INTEGER},
  642. </if>
  643. <if test="followNum != null" >
  644. follow_num = #{followNum,jdbcType=INTEGER},
  645. </if>
  646. <if test="fansNum != null" >
  647. fans_num = #{fansNum,jdbcType=INTEGER},
  648. </if>
  649. <if test="defUser != null" >
  650. def_user = #{defUser,jdbcType=TINYINT},
  651. </if>
  652. <if test="fortune != null" >
  653. fortune = #{fortune,jdbcType=BIGINT},
  654. </if>
  655. <if test="channelType != null" >
  656. channel_type = #{channelType,jdbcType=TINYINT},
  657. </if>
  658. <if test="lastLoginTime != null" >
  659. last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
  660. </if>
  661. <if test="lastLoginIp != null" >
  662. last_login_ip = #{lastLoginIp,jdbcType=VARCHAR},
  663. </if>
  664. <if test="gender != null" >
  665. gender = #{gender,jdbcType=TINYINT},
  666. </if>
  667. <if test="avatar != null" >
  668. avatar = #{avatar,jdbcType=VARCHAR},
  669. </if>
  670. <if test="region != null" >
  671. region = #{region,jdbcType=VARCHAR},
  672. </if>
  673. <if test="userDesc != null" >
  674. user_desc = #{userDesc,jdbcType=VARCHAR},
  675. </if>
  676. <if test="alipayAccount != null" >
  677. alipay_account = #{alipayAccount,jdbcType=VARCHAR},
  678. </if>
  679. <if test="alipayAccountName != null" >
  680. alipay_account_name = #{alipayAccountName,jdbcType=VARCHAR},
  681. </if>
  682. <if test="createTime != null" >
  683. create_time = #{createTime,jdbcType=TIMESTAMP},
  684. </if>
  685. <if test="updateTime != null" >
  686. update_time = #{updateTime,jdbcType=TIMESTAMP},
  687. </if>
  688. <if test="wxPubFansOpenid != null" >
  689. wx_pub_fans_openid = #{wxPubFansOpenid,jdbcType=VARCHAR},
  690. </if>
  691. <if test="wxPubFansGender != null" >
  692. wx_pub_fans_gender = #{wxPubFansGender,jdbcType=TINYINT},
  693. </if>
  694. <if test="roomUid != null" >
  695. room_uid = #{roomUid,jdbcType=BIGINT},
  696. </if>
  697. <if test="shareUid != null" >
  698. share_uid = #{shareUid,jdbcType=BIGINT},
  699. </if>
  700. <if test="shareChannel != null" >
  701. share_channel = #{shareChannel,jdbcType=TINYINT},
  702. </if>
  703. <if test="wxOpenId != null" >
  704. wx_openId = #{wxOpenId,jdbcType=VARCHAR},
  705. </if>
  706. <if test="os != null" >
  707. os = #{os,jdbcType=VARCHAR},
  708. </if>
  709. <if test="osVersion != null" >
  710. osVersion = #{osVersion,jdbcType=VARCHAR},
  711. </if>
  712. <if test="app != null" >
  713. app = #{app,jdbcType=VARCHAR},
  714. </if>
  715. <if test="imei != null" >
  716. imei = #{imei,jdbcType=VARCHAR},
  717. </if>
  718. <if test="channel != null" >
  719. channel = #{channel,jdbcType=VARCHAR},
  720. </if>
  721. <if test="linkedmeChannel != null" >
  722. linkedme_channel = #{linkedmeChannel,jdbcType=VARCHAR},
  723. </if>
  724. <if test="ispType != null" >
  725. isp_type = #{ispType,jdbcType=VARCHAR},
  726. </if>
  727. <if test="netType != null" >
  728. net_type = #{netType,jdbcType=VARCHAR},
  729. </if>
  730. <if test="model != null" >
  731. model = #{model,jdbcType=VARCHAR},
  732. </if>
  733. <if test="deviceId != null" >
  734. device_id = #{deviceId,jdbcType=VARCHAR},
  735. </if>
  736. <if test="appVersion != null" >
  737. app_version = #{appVersion,jdbcType=VARCHAR},
  738. </if>
  739. <if test="nobleId != null" >
  740. noble_id = #{nobleId,jdbcType=INTEGER},
  741. </if>
  742. <if test="nobleName != null" >
  743. noble_name = #{nobleName,jdbcType=VARCHAR},
  744. </if>
  745. <if test="withdrawStatus != null" >
  746. withdraw_status = #{withdrawStatus,jdbcType=TINYINT},
  747. </if>
  748. </set>
  749. where uid = #{uid,jdbcType=BIGINT}
  750. </update>
  751. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.Users" >
  752. update users
  753. set erban_no = #{erbanNo,jdbcType=BIGINT},
  754. has_pretty_erban_no = #{hasPrettyErbanNo,jdbcType=BIT},
  755. phone = #{phone,jdbcType=VARCHAR},
  756. birth = #{birth,jdbcType=DATE},
  757. star = #{star,jdbcType=TINYINT},
  758. nick = #{nick,jdbcType=VARCHAR},
  759. email = #{email,jdbcType=VARCHAR},
  760. signture = #{signture,jdbcType=VARCHAR},
  761. user_voice = #{userVoice,jdbcType=VARCHAR},
  762. voice_dura = #{voiceDura,jdbcType=INTEGER},
  763. follow_num = #{followNum,jdbcType=INTEGER},
  764. fans_num = #{fansNum,jdbcType=INTEGER},
  765. def_user = #{defUser,jdbcType=TINYINT},
  766. fortune = #{fortune,jdbcType=BIGINT},
  767. channel_type = #{channelType,jdbcType=TINYINT},
  768. last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
  769. last_login_ip = #{lastLoginIp,jdbcType=VARCHAR},
  770. gender = #{gender,jdbcType=TINYINT},
  771. avatar = #{avatar,jdbcType=VARCHAR},
  772. region = #{region,jdbcType=VARCHAR},
  773. user_desc = #{userDesc,jdbcType=VARCHAR},
  774. alipay_account = #{alipayAccount,jdbcType=VARCHAR},
  775. alipay_account_name = #{alipayAccountName,jdbcType=VARCHAR},
  776. create_time = #{createTime,jdbcType=TIMESTAMP},
  777. update_time = #{updateTime,jdbcType=TIMESTAMP},
  778. wx_pub_fans_openid = #{wxPubFansOpenid,jdbcType=VARCHAR},
  779. wx_pub_fans_gender = #{wxPubFansGender,jdbcType=TINYINT},
  780. room_uid = #{roomUid,jdbcType=BIGINT},
  781. share_uid = #{shareUid,jdbcType=BIGINT},
  782. share_channel = #{shareChannel,jdbcType=TINYINT},
  783. wx_openId = #{wxOpenId,jdbcType=VARCHAR},
  784. os = #{os,jdbcType=VARCHAR},
  785. osVersion = #{osVersion,jdbcType=VARCHAR},
  786. app = #{app,jdbcType=VARCHAR},
  787. imei = #{imei,jdbcType=VARCHAR},
  788. channel = #{channel,jdbcType=VARCHAR},
  789. linkedme_channel = #{linkedmeChannel,jdbcType=VARCHAR},
  790. isp_type = #{ispType,jdbcType=VARCHAR},
  791. net_type = #{netType,jdbcType=VARCHAR},
  792. model = #{model,jdbcType=VARCHAR},
  793. device_id = #{deviceId,jdbcType=VARCHAR},
  794. app_version = #{appVersion,jdbcType=VARCHAR},
  795. noble_id = #{nobleId,jdbcType=INTEGER},
  796. noble_name = #{nobleName,jdbcType=VARCHAR},
  797. withdraw_status = #{withdrawStatus,jdbcType=TINYINT}
  798. where uid = #{uid,jdbcType=BIGINT}
  799. </update>
  800. <sql id="Base_Column_List" >
  801. uid, erban_no, has_pretty_erban_no, phone, birth, star, nick, email, signture, user_voice,
  802. voice_dura, follow_num, fans_num, def_user, fortune, channel_type, last_login_time,
  803. last_login_ip, gender, avatar, region, user_desc, alipay_account, alipay_account_name,
  804. create_time, update_time, wx_pub_fans_openid, wx_pub_fans_gender, room_uid, share_uid,
  805. share_channel, wx_openId, os, osVersion, app, imei, channel, linkedme_channel, isp_type,
  806. net_type, model, device_id, app_version, noble_id, noble_name, withdraw_status
  807. </sql>
  808. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
  809. select
  810. <include refid="Base_Column_List" />
  811. from users
  812. where uid = #{uid,jdbcType=BIGINT}
  813. </select>
  814. <select id="selectUsers" resultMap="UsersGoldResultMap">
  815. select *
  816. ,(select t2.gold_num from user_purse t2 where t2.uid=t1.uid) as gold_num
  817. from users t1 where erban_no in
  818. <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
  819. #{item}
  820. </foreach>
  821. </select>
  822. <select id="selectByErBanNo" resultMap="BaseResultMap">
  823. select
  824. <include refid="Base_Column_List" />
  825. from users
  826. where erban_no = #{erBanNo}
  827. </select>
  828. </mapper>