UserMapper.xml 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255
  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.goafanti.common.dao.UserMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.User">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Thu May 31 15:33:56 CST 2018.
  9. -->
  10. <id column="id" jdbcType="VARCHAR" property="id" />
  11. <result column="mobile" jdbcType="VARCHAR" property="mobile" />
  12. <result column="password" jdbcType="VARCHAR" property="password" />
  13. <result column="nickname" jdbcType="VARCHAR" property="nickname" />
  14. <result column="email" jdbcType="VARCHAR" property="email" />
  15. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  16. <result column="number" jdbcType="BIGINT" property="number" />
  17. <result column="lvl" jdbcType="INTEGER" property="lvl" />
  18. <result column="type" jdbcType="INTEGER" property="type" />
  19. <result column="mid" jdbcType="VARCHAR" property="mid" />
  20. <result column="status" jdbcType="INTEGER" property="status" />
  21. <result column="source" jdbcType="INTEGER" property="source" />
  22. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  23. <result column="company_logo_url" jdbcType="VARCHAR" property="companyLogoUrl" />
  24. <result column="head_portrait_url" jdbcType="VARCHAR" property="headPortraitUrl" />
  25. <result column="society_tag" jdbcType="VARCHAR" property="societyTag" />
  26. <result column="introduction" jdbcType="VARCHAR" property="introduction" />
  27. <result column="value_added_tag" jdbcType="VARCHAR" property="valueAddedTag" />
  28. <result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
  29. <result column="identify_name" jdbcType="VARCHAR" property="identifyName" />
  30. <result column="background_url" jdbcType="VARCHAR" property="backgroundUrl" />
  31. <result column="audit_opinion" jdbcType="VARCHAR" property="auditOpinion" />
  32. <result column="audit_status" jdbcType="INTEGER" property="auditStatus" />
  33. <result column="share_type" jdbcType="INTEGER" property="shareType" />
  34. <result column="aid" jdbcType="VARCHAR" property="aid" />
  35. <result column="transfer_time" jdbcType="TIMESTAMP" property="transferTime" />
  36. <result column="username" jdbcType="VARCHAR" property="username" />
  37. <result column="authentication" jdbcType="INTEGER" property="authentication" />
  38. <result column="introduction" jdbcType="VARCHAR" property="introduction" />
  39. </resultMap>
  40. <sql id="Example_Where_Clause">
  41. <!--
  42. WARNING - @mbg.generated
  43. This element is automatically generated by MyBatis Generator, do not modify.
  44. This element was generated on Thu May 31 15:33:56 CST 2018.
  45. -->
  46. <where>
  47. <foreach collection="oredCriteria" item="criteria" separator="or">
  48. <if test="criteria.valid">
  49. <trim prefix="(" prefixOverrides="and" suffix=")">
  50. <foreach collection="criteria.criteria" item="criterion">
  51. <choose>
  52. <when test="criterion.noValue">
  53. and ${criterion.condition}
  54. </when>
  55. <when test="criterion.singleValue">
  56. and ${criterion.condition} #{criterion.value}
  57. </when>
  58. <when test="criterion.betweenValue">
  59. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  60. </when>
  61. <when test="criterion.listValue">
  62. and ${criterion.condition}
  63. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  64. #{listItem}
  65. </foreach>
  66. </when>
  67. </choose>
  68. </foreach>
  69. </trim>
  70. </if>
  71. </foreach>
  72. </where>
  73. </sql>
  74. <sql id="Update_By_Example_Where_Clause">
  75. <!--
  76. WARNING - @mbg.generated
  77. This element is automatically generated by MyBatis Generator, do not modify.
  78. This element was generated on Thu May 31 15:33:56 CST 2018.
  79. -->
  80. <where>
  81. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  82. <if test="criteria.valid">
  83. <trim prefix="(" prefixOverrides="and" suffix=")">
  84. <foreach collection="criteria.criteria" item="criterion">
  85. <choose>
  86. <when test="criterion.noValue">
  87. and ${criterion.condition}
  88. </when>
  89. <when test="criterion.singleValue">
  90. and ${criterion.condition} #{criterion.value}
  91. </when>
  92. <when test="criterion.betweenValue">
  93. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  94. </when>
  95. <when test="criterion.listValue">
  96. and ${criterion.condition}
  97. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  98. #{listItem}
  99. </foreach>
  100. </when>
  101. </choose>
  102. </foreach>
  103. </trim>
  104. </if>
  105. </foreach>
  106. </where>
  107. </sql>
  108. <sql id="Base_Column_List">
  109. <!--
  110. WARNING - @mbg.generated
  111. This element is automatically generated by MyBatis Generator, do not modify.
  112. This element was generated on Thu May 31 15:33:56 CST 2018.
  113. -->
  114. id, mobile, password, nickname, email, create_time, number, lvl, type, mid, status,
  115. source, update_time, company_logo_url, head_portrait_url, society_tag, introduction,
  116. value_added_tag, organization_id, identify_name, background_url, audit_opinion, audit_status,
  117. share_type, aid, transfer_time, username, authentication
  118. </sql>
  119. <select id="selectByExample" parameterType="com.goafanti.common.model.UserExample" resultMap="BaseResultMap">
  120. <!--
  121. WARNING - @mbg.generated
  122. This element is automatically generated by MyBatis Generator, do not modify.
  123. This element was generated on Thu May 31 15:33:56 CST 2018.
  124. -->
  125. select
  126. <if test="distinct">
  127. distinct
  128. </if>
  129. <include refid="Base_Column_List" />
  130. from user
  131. <if test="_parameter != null">
  132. <include refid="Example_Where_Clause" />
  133. </if>
  134. <if test="orderByClause != null">
  135. order by ${orderByClause}
  136. </if>
  137. </select>
  138. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  139. <!--
  140. WARNING - @mbg.generated
  141. This element is automatically generated by MyBatis Generator, do not modify.
  142. This element was generated on Thu May 31 15:33:56 CST 2018.
  143. -->
  144. select
  145. <include refid="Base_Column_List" />
  146. from user
  147. where id = #{id,jdbcType=VARCHAR}
  148. </select>
  149. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  150. <!--
  151. WARNING - @mbg.generated
  152. This element is automatically generated by MyBatis Generator, do not modify.
  153. This element was generated on Thu May 31 15:33:56 CST 2018.
  154. -->
  155. delete from user
  156. where id = #{id,jdbcType=VARCHAR}
  157. </delete>
  158. <delete id="deleteByExample" parameterType="com.goafanti.common.model.UserExample">
  159. <!--
  160. WARNING - @mbg.generated
  161. This element is automatically generated by MyBatis Generator, do not modify.
  162. This element was generated on Thu May 31 15:33:56 CST 2018.
  163. -->
  164. delete from user
  165. <if test="_parameter != null">
  166. <include refid="Example_Where_Clause" />
  167. </if>
  168. </delete>
  169. <insert id="insert" parameterType="com.goafanti.common.model.User">
  170. <!--
  171. WARNING - @mbg.generated
  172. This element is automatically generated by MyBatis Generator, do not modify.
  173. This element was generated on Thu May 31 15:33:56 CST 2018.
  174. -->
  175. insert into user (id, mobile, password,
  176. nickname, email, create_time,
  177. number, lvl, type, mid,
  178. status, source, update_time,
  179. company_logo_url, head_portrait_url, society_tag,
  180. introduction, value_added_tag, organization_id,
  181. identify_name, background_url, audit_opinion,
  182. audit_status, share_type, aid,
  183. transfer_time, username, authentication
  184. )
  185. values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
  186. #{nickname,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  187. #{number,jdbcType=BIGINT}, #{lvl,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{mid,jdbcType=VARCHAR},
  188. #{status,jdbcType=INTEGER}, #{source,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
  189. #{companyLogoUrl,jdbcType=VARCHAR}, #{headPortraitUrl,jdbcType=VARCHAR}, #{societyTag,jdbcType=VARCHAR},
  190. #{introduction,jdbcType=VARCHAR}, #{valueAddedTag,jdbcType=VARCHAR}, #{organizationId,jdbcType=VARCHAR},
  191. #{identifyName,jdbcType=VARCHAR}, #{backgroundUrl,jdbcType=VARCHAR}, #{auditOpinion,jdbcType=VARCHAR},
  192. #{auditStatus,jdbcType=INTEGER}, #{shareType,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR},
  193. #{transferTime,jdbcType=TIMESTAMP}, #{username,jdbcType=VARCHAR}, #{authentication,jdbcType=INTEGER}
  194. )
  195. </insert>
  196. <insert id="insertSelective" parameterType="com.goafanti.common.model.User">
  197. <!--
  198. WARNING - @mbg.generated
  199. This element is automatically generated by MyBatis Generator, do not modify.
  200. This element was generated on Thu May 31 15:33:56 CST 2018.
  201. -->
  202. insert into user
  203. <trim prefix="(" suffix=")" suffixOverrides=",">
  204. <if test="id != null">
  205. id,
  206. </if>
  207. <if test="mobile != null">
  208. mobile,
  209. </if>
  210. <if test="password != null">
  211. password,
  212. </if>
  213. <if test="nickname != null">
  214. nickname,
  215. </if>
  216. <if test="email != null">
  217. email,
  218. </if>
  219. <if test="createTime != null">
  220. create_time,
  221. </if>
  222. <if test="number != null">
  223. number,
  224. </if>
  225. <if test="lvl != null">
  226. lvl,
  227. </if>
  228. <if test="type != null">
  229. type,
  230. </if>
  231. <if test="mid != null">
  232. mid,
  233. </if>
  234. <if test="status != null">
  235. status,
  236. </if>
  237. <if test="source != null">
  238. source,
  239. </if>
  240. <if test="updateTime != null">
  241. update_time,
  242. </if>
  243. <if test="companyLogoUrl != null">
  244. company_logo_url,
  245. </if>
  246. <if test="headPortraitUrl != null">
  247. head_portrait_url,
  248. </if>
  249. <if test="societyTag != null">
  250. society_tag,
  251. </if>
  252. <if test="introduction != null">
  253. introduction,
  254. </if>
  255. <if test="valueAddedTag != null">
  256. value_added_tag,
  257. </if>
  258. <if test="organizationId != null">
  259. organization_id,
  260. </if>
  261. <if test="identifyName != null">
  262. identify_name,
  263. </if>
  264. <if test="backgroundUrl != null">
  265. background_url,
  266. </if>
  267. <if test="auditOpinion != null">
  268. audit_opinion,
  269. </if>
  270. <if test="auditStatus != null">
  271. audit_status,
  272. </if>
  273. <if test="shareType != null">
  274. share_type,
  275. </if>
  276. <if test="aid != null">
  277. aid,
  278. </if>
  279. <if test="transferTime != null">
  280. transfer_time,
  281. </if>
  282. <if test="username != null">
  283. username,
  284. </if>
  285. <if test="authentication != null">
  286. authentication,
  287. </if>
  288. </trim>
  289. <trim prefix="values (" suffix=")" suffixOverrides=",">
  290. <if test="id != null">
  291. #{id,jdbcType=VARCHAR},
  292. </if>
  293. <if test="mobile != null">
  294. #{mobile,jdbcType=VARCHAR},
  295. </if>
  296. <if test="password != null">
  297. #{password,jdbcType=VARCHAR},
  298. </if>
  299. <if test="nickname != null">
  300. #{nickname,jdbcType=VARCHAR},
  301. </if>
  302. <if test="email != null">
  303. #{email,jdbcType=VARCHAR},
  304. </if>
  305. <if test="createTime != null">
  306. #{createTime,jdbcType=TIMESTAMP},
  307. </if>
  308. <if test="number != null">
  309. #{number,jdbcType=BIGINT},
  310. </if>
  311. <if test="lvl != null">
  312. #{lvl,jdbcType=INTEGER},
  313. </if>
  314. <if test="type != null">
  315. #{type,jdbcType=INTEGER},
  316. </if>
  317. <if test="mid != null">
  318. #{mid,jdbcType=VARCHAR},
  319. </if>
  320. <if test="status != null">
  321. #{status,jdbcType=INTEGER},
  322. </if>
  323. <if test="source != null">
  324. #{source,jdbcType=INTEGER},
  325. </if>
  326. <if test="updateTime != null">
  327. #{updateTime,jdbcType=TIMESTAMP},
  328. </if>
  329. <if test="companyLogoUrl != null">
  330. #{companyLogoUrl,jdbcType=VARCHAR},
  331. </if>
  332. <if test="headPortraitUrl != null">
  333. #{headPortraitUrl,jdbcType=VARCHAR},
  334. </if>
  335. <if test="societyTag != null">
  336. #{societyTag,jdbcType=VARCHAR},
  337. </if>
  338. <if test="introduction != null">
  339. #{introduction,jdbcType=VARCHAR},
  340. </if>
  341. <if test="valueAddedTag != null">
  342. #{valueAddedTag,jdbcType=VARCHAR},
  343. </if>
  344. <if test="organizationId != null">
  345. #{organizationId,jdbcType=VARCHAR},
  346. </if>
  347. <if test="identifyName != null">
  348. #{identifyName,jdbcType=VARCHAR},
  349. </if>
  350. <if test="backgroundUrl != null">
  351. #{backgroundUrl,jdbcType=VARCHAR},
  352. </if>
  353. <if test="auditOpinion != null">
  354. #{auditOpinion,jdbcType=VARCHAR},
  355. </if>
  356. <if test="auditStatus != null">
  357. #{auditStatus,jdbcType=INTEGER},
  358. </if>
  359. <if test="shareType != null">
  360. #{shareType,jdbcType=INTEGER},
  361. </if>
  362. <if test="aid != null">
  363. #{aid,jdbcType=VARCHAR},
  364. </if>
  365. <if test="transferTime != null">
  366. #{transferTime,jdbcType=TIMESTAMP},
  367. </if>
  368. <if test="username != null">
  369. #{username,jdbcType=VARCHAR},
  370. </if>
  371. <if test="authentication != null">
  372. #{authentication,jdbcType=INTEGER},
  373. </if>
  374. </trim>
  375. </insert>
  376. <select id="countByExample" parameterType="com.goafanti.common.model.UserExample" resultType="java.lang.Long">
  377. <!--
  378. WARNING - @mbg.generated
  379. This element is automatically generated by MyBatis Generator, do not modify.
  380. This element was generated on Thu May 31 15:33:56 CST 2018.
  381. -->
  382. select count(*) from user
  383. <if test="_parameter != null">
  384. <include refid="Example_Where_Clause" />
  385. </if>
  386. </select>
  387. <update id="updateByExampleSelective" parameterType="map">
  388. <!--
  389. WARNING - @mbg.generated
  390. This element is automatically generated by MyBatis Generator, do not modify.
  391. This element was generated on Thu May 31 15:33:56 CST 2018.
  392. -->
  393. update user
  394. <set>
  395. <if test="record.id != null">
  396. id = #{record.id,jdbcType=VARCHAR},
  397. </if>
  398. <if test="record.mobile != null">
  399. mobile = #{record.mobile,jdbcType=VARCHAR},
  400. </if>
  401. <if test="record.password != null">
  402. password = #{record.password,jdbcType=VARCHAR},
  403. </if>
  404. <if test="record.nickname != null">
  405. nickname = #{record.nickname,jdbcType=VARCHAR},
  406. </if>
  407. <if test="record.email != null">
  408. email = #{record.email,jdbcType=VARCHAR},
  409. </if>
  410. <if test="record.createTime != null">
  411. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  412. </if>
  413. <if test="record.number != null">
  414. number = #{record.number,jdbcType=BIGINT},
  415. </if>
  416. <if test="record.lvl != null">
  417. lvl = #{record.lvl,jdbcType=INTEGER},
  418. </if>
  419. <if test="record.type != null">
  420. type = #{record.type,jdbcType=INTEGER},
  421. </if>
  422. <if test="record.mid != null">
  423. mid = #{record.mid,jdbcType=VARCHAR},
  424. </if>
  425. <if test="record.status != null">
  426. status = #{record.status,jdbcType=INTEGER},
  427. </if>
  428. <if test="record.source != null">
  429. source = #{record.source,jdbcType=INTEGER},
  430. </if>
  431. <if test="record.updateTime != null">
  432. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  433. </if>
  434. <if test="record.companyLogoUrl != null">
  435. company_logo_url = #{record.companyLogoUrl,jdbcType=VARCHAR},
  436. </if>
  437. <if test="record.headPortraitUrl != null">
  438. head_portrait_url = #{record.headPortraitUrl,jdbcType=VARCHAR},
  439. </if>
  440. <if test="record.societyTag != null">
  441. society_tag = #{record.societyTag,jdbcType=VARCHAR},
  442. </if>
  443. <if test="record.introduction != null">
  444. introduction = #{record.introduction,jdbcType=VARCHAR},
  445. </if>
  446. <if test="record.valueAddedTag != null">
  447. value_added_tag = #{record.valueAddedTag,jdbcType=VARCHAR},
  448. </if>
  449. <if test="record.organizationId != null">
  450. organization_id = #{record.organizationId,jdbcType=VARCHAR},
  451. </if>
  452. <if test="record.identifyName != null">
  453. identify_name = #{record.identifyName,jdbcType=VARCHAR},
  454. </if>
  455. <if test="record.backgroundUrl != null">
  456. background_url = #{record.backgroundUrl,jdbcType=VARCHAR},
  457. </if>
  458. <if test="record.auditOpinion != null">
  459. audit_opinion = #{record.auditOpinion,jdbcType=VARCHAR},
  460. </if>
  461. <if test="record.auditStatus != null">
  462. audit_status = #{record.auditStatus,jdbcType=INTEGER},
  463. </if>
  464. <if test="record.shareType != null">
  465. share_type = #{record.shareType,jdbcType=INTEGER},
  466. </if>
  467. <if test="record.aid != null">
  468. aid = #{record.aid,jdbcType=VARCHAR},
  469. </if>
  470. <if test="record.transferTime != null">
  471. transfer_time = #{record.transferTime,jdbcType=TIMESTAMP},
  472. </if>
  473. <if test="record.username != null">
  474. username = #{record.username,jdbcType=VARCHAR},
  475. </if>
  476. <if test="record.authentication != null">
  477. authentication = #{record.authentication,jdbcType=INTEGER},
  478. </if>
  479. </set>
  480. <if test="_parameter != null">
  481. <include refid="Update_By_Example_Where_Clause" />
  482. </if>
  483. </update>
  484. <update id="updateByExample" parameterType="map">
  485. <!--
  486. WARNING - @mbg.generated
  487. This element is automatically generated by MyBatis Generator, do not modify.
  488. This element was generated on Thu May 31 15:33:56 CST 2018.
  489. -->
  490. update user
  491. set id = #{record.id,jdbcType=VARCHAR},
  492. mobile = #{record.mobile,jdbcType=VARCHAR},
  493. password = #{record.password,jdbcType=VARCHAR},
  494. nickname = #{record.nickname,jdbcType=VARCHAR},
  495. email = #{record.email,jdbcType=VARCHAR},
  496. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  497. number = #{record.number,jdbcType=BIGINT},
  498. lvl = #{record.lvl,jdbcType=INTEGER},
  499. type = #{record.type,jdbcType=INTEGER},
  500. mid = #{record.mid,jdbcType=VARCHAR},
  501. status = #{record.status,jdbcType=INTEGER},
  502. source = #{record.source,jdbcType=INTEGER},
  503. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  504. company_logo_url = #{record.companyLogoUrl,jdbcType=VARCHAR},
  505. head_portrait_url = #{record.headPortraitUrl,jdbcType=VARCHAR},
  506. society_tag = #{record.societyTag,jdbcType=VARCHAR},
  507. introduction = #{record.introduction,jdbcType=VARCHAR},
  508. value_added_tag = #{record.valueAddedTag,jdbcType=VARCHAR},
  509. organization_id = #{record.organizationId,jdbcType=VARCHAR},
  510. identify_name = #{record.identifyName,jdbcType=VARCHAR},
  511. background_url = #{record.backgroundUrl,jdbcType=VARCHAR},
  512. audit_opinion = #{record.auditOpinion,jdbcType=VARCHAR},
  513. audit_status = #{record.auditStatus,jdbcType=INTEGER},
  514. share_type = #{record.shareType,jdbcType=INTEGER},
  515. aid = #{record.aid,jdbcType=VARCHAR},
  516. transfer_time = #{record.transferTime,jdbcType=TIMESTAMP},
  517. username = #{record.username,jdbcType=VARCHAR},
  518. authentication = #{record.authentication,jdbcType=INTEGER}
  519. <if test="_parameter != null">
  520. <include refid="Update_By_Example_Where_Clause" />
  521. </if>
  522. </update>
  523. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.User">
  524. <!--
  525. WARNING - @mbg.generated
  526. This element is automatically generated by MyBatis Generator, do not modify.
  527. This element was generated on Thu May 31 15:33:56 CST 2018.
  528. -->
  529. update user
  530. <set>
  531. <if test="mobile != null">
  532. mobile = #{mobile,jdbcType=VARCHAR},
  533. </if>
  534. <if test="password != null">
  535. password = #{password,jdbcType=VARCHAR},
  536. </if>
  537. <if test="nickname != null">
  538. nickname = #{nickname,jdbcType=VARCHAR},
  539. </if>
  540. <if test="email != null">
  541. email = #{email,jdbcType=VARCHAR},
  542. </if>
  543. <if test="createTime != null">
  544. create_time = #{createTime,jdbcType=TIMESTAMP},
  545. </if>
  546. <if test="number != null">
  547. number = #{number,jdbcType=BIGINT},
  548. </if>
  549. <if test="lvl != null">
  550. lvl = #{lvl,jdbcType=INTEGER},
  551. </if>
  552. <if test="type != null">
  553. type = #{type,jdbcType=INTEGER},
  554. </if>
  555. <if test="mid != null">
  556. mid = #{mid,jdbcType=VARCHAR},
  557. </if>
  558. <if test="status != null">
  559. status = #{status,jdbcType=INTEGER},
  560. </if>
  561. <if test="source != null">
  562. source = #{source,jdbcType=INTEGER},
  563. </if>
  564. <if test="updateTime != null">
  565. update_time = #{updateTime,jdbcType=TIMESTAMP},
  566. </if>
  567. <if test="companyLogoUrl != null">
  568. company_logo_url = #{companyLogoUrl,jdbcType=VARCHAR},
  569. </if>
  570. <if test="headPortraitUrl != null">
  571. head_portrait_url = #{headPortraitUrl,jdbcType=VARCHAR},
  572. </if>
  573. <if test="societyTag != null">
  574. society_tag = #{societyTag,jdbcType=VARCHAR},
  575. </if>
  576. <if test="introduction != null">
  577. introduction = #{introduction,jdbcType=VARCHAR},
  578. </if>
  579. <if test="valueAddedTag != null">
  580. value_added_tag = #{valueAddedTag,jdbcType=VARCHAR},
  581. </if>
  582. <if test="organizationId != null">
  583. organization_id = #{organizationId,jdbcType=VARCHAR},
  584. </if>
  585. <if test="identifyName != null">
  586. identify_name = #{identifyName,jdbcType=VARCHAR},
  587. </if>
  588. <if test="backgroundUrl != null">
  589. background_url = #{backgroundUrl,jdbcType=VARCHAR},
  590. </if>
  591. <if test="auditOpinion != null">
  592. audit_opinion = #{auditOpinion,jdbcType=VARCHAR},
  593. </if>
  594. <if test="auditStatus != null">
  595. audit_status = #{auditStatus,jdbcType=INTEGER},
  596. </if>
  597. <if test="shareType != null">
  598. share_type = #{shareType,jdbcType=INTEGER},
  599. </if>
  600. <if test="aid != null">
  601. aid = #{aid,jdbcType=VARCHAR},
  602. </if>
  603. <if test="transferTime != null">
  604. transfer_time = #{transferTime,jdbcType=TIMESTAMP},
  605. </if>
  606. <if test="username != null">
  607. username = #{username,jdbcType=VARCHAR},
  608. </if>
  609. <if test="authentication != null">
  610. authentication = #{authentication,jdbcType=INTEGER},
  611. </if>
  612. </set>
  613. where id = #{id,jdbcType=VARCHAR}
  614. </update>
  615. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.User">
  616. <!--
  617. WARNING - @mbg.generated
  618. This element is automatically generated by MyBatis Generator, do not modify.
  619. This element was generated on Thu May 31 15:33:56 CST 2018.
  620. -->
  621. update user
  622. set mobile = #{mobile,jdbcType=VARCHAR},
  623. password = #{password,jdbcType=VARCHAR},
  624. nickname = #{nickname,jdbcType=VARCHAR},
  625. email = #{email,jdbcType=VARCHAR},
  626. create_time = #{createTime,jdbcType=TIMESTAMP},
  627. number = #{number,jdbcType=BIGINT},
  628. lvl = #{lvl,jdbcType=INTEGER},
  629. type = #{type,jdbcType=INTEGER},
  630. mid = #{mid,jdbcType=VARCHAR},
  631. status = #{status,jdbcType=INTEGER},
  632. source = #{source,jdbcType=INTEGER},
  633. update_time = #{updateTime,jdbcType=TIMESTAMP},
  634. company_logo_url = #{companyLogoUrl,jdbcType=VARCHAR},
  635. head_portrait_url = #{headPortraitUrl,jdbcType=VARCHAR},
  636. society_tag = #{societyTag,jdbcType=VARCHAR},
  637. introduction = #{introduction,jdbcType=VARCHAR},
  638. value_added_tag = #{valueAddedTag,jdbcType=VARCHAR},
  639. organization_id = #{organizationId,jdbcType=VARCHAR},
  640. identify_name = #{identifyName,jdbcType=VARCHAR},
  641. background_url = #{backgroundUrl,jdbcType=VARCHAR},
  642. audit_opinion = #{auditOpinion,jdbcType=VARCHAR},
  643. audit_status = #{auditStatus,jdbcType=INTEGER},
  644. share_type = #{shareType,jdbcType=INTEGER},
  645. aid = #{aid,jdbcType=VARCHAR},
  646. transfer_time = #{transferTime,jdbcType=TIMESTAMP},
  647. username = #{username,jdbcType=VARCHAR},
  648. authentication = #{authentication,jdbcType=INTEGER}
  649. where id = #{id,jdbcType=VARCHAR}
  650. </update>
  651. <resultMap id="UserPageHomeBo" type="com.goafanti.user.bo.UserPageHomeBo">
  652. <result column="uid" jdbcType="VARCHAR" property="uid" />
  653. <result column="lvl" jdbcType="INTEGER" property="lvl" />
  654. <result column="nickname" jdbcType="VARCHAR" property="nickname" />
  655. <result column="username" jdbcType="VARCHAR" property="username"/>
  656. <result column="identify_name" jdbcType="VARCHAR" property="identifyName"/>
  657. <result column="email" jdbcType="VARCHAR" property="email" />
  658. <result column="mobile" jdbcType="VARCHAR" property="mobile"/>
  659. <result column="number" jdbcType="INTEGER" property="number" />
  660. <result column="type" jdbcType="INTEGER" property="type" />
  661. <result column="status" jdbcType="INTEGER" property="status"/>
  662. <result column="authentication" jdbcType="INTEGER" property="authentication"/>
  663. <result column="head_portrait_url" jdbcType="VARCHAR" property="headPortraitUrl" />
  664. <result column="logo_url" jdbcType="VARCHAR" property="logoUrl" />
  665. <result column="expert" jdbcType="INTEGER" property="expert" />
  666. <result column="audit_status" jdbcType="INTEGER" property="auditStatus" />
  667. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  668. </resultMap>
  669. <resultMap id="UserDownLoadBo" type="com.goafanti.user.bo.UserDownLoadBo">
  670. <id column="id" jdbcType="VARCHAR" property="id" />
  671. <result column="diploma_url" jdbcType="VARCHAR" property="diplomaUrl" />
  672. <result column="degree_diploma_url" jdbcType="VARCHAR" property="degreeDiplomaUrl" />
  673. <result column="professional_certificate_url" jdbcType="VARCHAR" property="professionalCertificateUrl" />
  674. <result column="qualification_certificate_url" jdbcType="VARCHAR" property="qualificationCertificateUrl" />
  675. <result column="positive_id_url" jdbcType="VARCHAR" property="positiveIdUrl" />
  676. <result column="opposite_id_url" jdbcType="VARCHAR" property="oppositeIdUrl" />
  677. </resultMap>
  678. <select id="selectByMobieAndType" resultMap="BaseResultMap">
  679. select
  680. <include refid="Base_Column_List" />
  681. from user
  682. where mobile = #{0} and type=#{1} and source = 0
  683. </select>
  684. <select id="selectByNameAndType" resultMap="BaseResultMap">
  685. select
  686. <include refid="Base_Column_List" />
  687. from
  688. user
  689. where
  690. source = 0
  691. and binary username = #{username}
  692. <if test="type != null">
  693. and type = #{type}
  694. </if>
  695. </select>
  696. <select id="selectUserBaseByUserId" parameterType="java.lang.String" resultMap="UserPageHomeBo">
  697. select
  698. a.id,
  699. a.number,
  700. a.type,
  701. a.authentication,
  702. a.username,
  703. a.identify_name,
  704. a.nickname,
  705. a.create_time,
  706. a.authentication,
  707. a.status,a.email,
  708. a.head_portrait_url,
  709. b.expert,
  710. b.audit_status,
  711. a.mobile from user a
  712. left join user_identity b on a.id=b.uid
  713. where
  714. a.id = #{uid,jdbcType = VARCHAR}
  715. </select>
  716. <select id="selectUserDownLoadBoByUserId" parameterType="java.lang.String" resultMap="UserDownLoadBo">
  717. select u.id,i.positive_id_url ,i.opposite_id_url,c.professional_certificate_url,c.qualification_certificate_url,
  718. e.diploma_url, e.degree_diploma_url
  719. from user u
  720. LEFT JOIN user_identity i on u.id = i.uid
  721. LEFT JOIN user_career c on u.id = c.uid
  722. LEFT JOIN user_edu e on u.id = e.uid
  723. where u.id =#{id,jdbcType=VARCHAR}
  724. </select>
  725. <select id="findUserListByPage" parameterType="String" resultType="com.goafanti.user.bo.UserListBo">
  726. select
  727. u.id ,
  728. u.mobile,
  729. u.email,
  730. u.create_time as createTime,
  731. u.number ,
  732. i.username,
  733. i.audit_status as auditStatus,
  734. a.name as adminName,
  735. ad.name as managerName
  736. from user u
  737. LEFT JOIN admin a on a.id = u.aid
  738. LEFT JOIN admin ad on ad.id = u.mid
  739. LEFT JOIN user_identity i
  740. ON u.id = i.uid where u.type = 0
  741. <if test="mobile != null">
  742. and u.mobile = #{mobile,jdbcType=VARCHAR}
  743. </if>
  744. <if test="email != null">
  745. and u.email = #{email,jdbcType=VARCHAR}
  746. </if>
  747. <if test="pStart != null">
  748. and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  749. </if>
  750. <if test="pEnd != null">
  751. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  752. </if>
  753. <if test=" number != null">
  754. and u.number = #{number,jdbcType=INTEGER}
  755. </if>
  756. <if test="username != null">
  757. and i.username like CONCAT ('%',#{username,jdbcType=VARCHAR},'%')
  758. </if>
  759. <if test="auditStatus != null">
  760. and i.audit_status= #{auditStatus,jdbcType=INTEGER}
  761. </if>
  762. order by u.number desc
  763. <if test="page_sql!=null">
  764. ${page_sql}
  765. </if>
  766. </select>
  767. <select id="findUserCount" parameterType="String" resultType="java.lang.Integer">
  768. select count(1)
  769. from user u LEFT JOIN user_identity i
  770. ON u.id = i.uid
  771. WHERE u.type = 0
  772. <if test="mobile != null">
  773. and u.mobile = #{mobile,jdbcType=VARCHAR}
  774. </if>
  775. <if test="email != null">
  776. and u.email = #{email,jdbcType=VARCHAR}
  777. </if>
  778. <if test="pStart != null">
  779. and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  780. </if>
  781. <if test="pEnd != null">
  782. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  783. </if>
  784. <if test="number != null">
  785. and u.number = #{number,jdbcType=INTEGER}
  786. </if>
  787. <if test="username != null">
  788. and i.username like CONCAT ('%',#{username,jdbcType=VARCHAR},'%')
  789. </if>
  790. <if test="auditStatus != null">
  791. and i.audit_status= #{auditStatus,jdbcType=INTEGER}
  792. </if>
  793. </select>
  794. <select id="findOrgListByPage" parameterType="String" resultType="com.goafanti.user.bo.OrgListBo">
  795. select u.id ,u.mobile, u.email, u.create_time as createTime,
  796. u.number, o.audit_status as orgAuditStatus, a.name as adminName,
  797. o.unit_name as unitName, ad.name as managerName
  798. from user u
  799. LEFT JOIN admin a on a.id = u.aid
  800. LEFT JOIN admin ad on ad.id = u.mid
  801. LEFT JOIN organization_identity o
  802. ON u.id = o.uid
  803. WHERE u.type = 1
  804. <if test="mobile != null">
  805. and u.mobile = #{mobile,jdbcType=VARCHAR}
  806. </if>
  807. <if test="uid != null">
  808. and u.id = #{uid,jdbcType=VARCHAR}
  809. </if>
  810. <if test="email != null">
  811. and u.email = #{email,jdbcType=VARCHAR}
  812. </if>
  813. <if test="pStart != null">
  814. and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
  815. </if>
  816. <if test="pEnd != null">
  817. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  818. </if>
  819. <if test=" number != null">
  820. and u.number = #{number,jdbcType=INTEGER}
  821. </if>
  822. <if test="unitName != null">
  823. and o.unit_name = #{unitName,jdbcType=VARCHAR}
  824. </if>
  825. <if test="auditStatus != null">
  826. and o.audit_status= #{auditStatus,jdbcType=INTEGER}
  827. </if>
  828. order by u.number desc
  829. <if test="page_sql!=null">
  830. ${page_sql}
  831. </if>
  832. </select>
  833. <select id="findOrgCount" parameterType="String" resultType="java.lang.Integer">
  834. select count(1)
  835. from user u LEFT JOIN organization_identity o
  836. ON u.id = o.uid
  837. WHERE u.type = 1
  838. <if test="uid != null">
  839. and u.id = #{uid,jdbcType=VARCHAR}
  840. </if>
  841. <if test="mobile != null">
  842. and u.mobile = #{mobile,jdbcType=VARCHAR}
  843. </if>
  844. <if test="email != null">
  845. and u.email = #{email,jdbcType=VARCHAR}
  846. </if>
  847. <if test="pStart != null">
  848. and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
  849. </if>
  850. <if test="pEnd != null">
  851. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  852. </if>
  853. <if test=" number != null">
  854. and u.number = #{number,jdbcType=INTEGER}
  855. </if>
  856. <if test="unitName != null">
  857. and o.unit_name = #{unitName,jdbcType=VARCHAR}
  858. </if>
  859. <if test="auditStatus != null">
  860. and o.audit_status= #{auditStatus,jdbcType=INTEGER}
  861. </if>
  862. </select>
  863. <select id="findUserByAidWithParamsListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
  864. select
  865. u.id ,
  866. u.mobile,
  867. u.email,
  868. u.create_time as createTime,
  869. u.number ,
  870. a.name as adminName,
  871. ma.name as managerName,
  872. u.type,
  873. i.username,
  874. i.audit_status as userAuditStatus
  875. from user u
  876. LEFT JOIN admin a on a.id = u.aid
  877. LEFT JOIN admin ma on ma.id = u.mid
  878. LEFT JOIN user_identity i on u.id = i.uid
  879. where u.type = 0
  880. <if test="aid != null">
  881. and u.aid = #{aid,jdbcType=VARCHAR}
  882. </if>
  883. <if test="number !=null">
  884. and u.number = #{number,jdbcType=INTEGER}
  885. </if>
  886. <if test="mobile !=null">
  887. and u.mobile= #{mobile,jdbcType=VARCHAR}
  888. </if>
  889. <if test="auditStatus !=null">
  890. and i.audit_status = #{auditStatus,jdbcType=INTEGER}
  891. </if>
  892. <if test="auditName !=null">
  893. and i.username like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
  894. </if>
  895. <if test="email !=null">
  896. and u.email = #{email,jdbcType=VARCHAR}
  897. </if>
  898. <if test="startCreateTime !=null">
  899. and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
  900. </if>
  901. <if test="endCreateTime !=null">
  902. and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
  903. </if>
  904. order by u.number desc
  905. <if test="page_sql!=null">
  906. ${page_sql}
  907. </if>
  908. </select>
  909. <select id="findUserByAidWithParamsCount" parameterType="String" resultType="java.lang.Integer">
  910. select
  911. count(1)
  912. from user u
  913. LEFT JOIN admin a on a.id = u.aid
  914. LEFT JOIN user_identity i on u.id = i.uid
  915. where u.type = 0
  916. <if test="aid != null">
  917. and u.aid = #{aid,jdbcType=VARCHAR}
  918. </if>
  919. <if test="number !=null">
  920. and u.number = #{number,jdbcType=INTEGER}
  921. </if>
  922. <if test="mobile !=null">
  923. and u.mobile= #{mobile,jdbcType=VARCHAR}
  924. </if>
  925. <if test="auditStatus !=null">
  926. and i.audit_status = #{auditStatus,jdbcType=INTEGER}
  927. </if>
  928. <if test="auditName !=null">
  929. and i.username like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
  930. </if>
  931. <if test="email !=null">
  932. and u.email = #{email,jdbcType=VARCHAR}
  933. </if>
  934. <if test="startCreateTime !=null">
  935. and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
  936. </if>
  937. <if test="endCreateTime !=null">
  938. and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
  939. </if>
  940. </select>
  941. <select id="findOrgByAidWithParamsListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
  942. select
  943. u.id ,
  944. u.mobile,
  945. u.email,
  946. u.create_time as createTime,
  947. u.number ,
  948. a.name as adminName,
  949. ma.name as managerName,
  950. u.type,
  951. i.unit_name as unitName,
  952. i.audit_status as orgAuditStatus
  953. from user u
  954. LEFT JOIN admin a on a.id = u.aid
  955. LEFT JOIN admin ma on ma.id = u.mid
  956. LEFT JOIN organization_identity i on u.id = i.uid
  957. where u.type = 1
  958. <if test="aid != null">
  959. and u.aid = #{aid,jdbcType=VARCHAR}
  960. </if>
  961. <if test="number !=null">
  962. and u.number = #{number,jdbcType=INTEGER}
  963. </if>
  964. <if test="mobile !=null">
  965. and u.mobile= #{mobile,jdbcType=VARCHAR}
  966. </if>
  967. <if test="auditStatus !=null">
  968. and i.audit_status = #{auditStatus,jdbcType=INTEGER}
  969. </if>
  970. <if test="auditName !=null">
  971. and i.unit_name like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
  972. </if>
  973. <if test="email !=null">
  974. and u.email = #{email,jdbcType=VARCHAR}
  975. </if>
  976. <if test="startCreateTime !=null">
  977. and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
  978. </if>
  979. <if test="endCreateTime !=null">
  980. and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
  981. </if>
  982. order by u.number desc
  983. <if test="page_sql!=null">
  984. ${page_sql}
  985. </if>
  986. </select>
  987. <select id="findOrgByAidWithParamsCount" parameterType="String" resultType="java.lang.Integer">
  988. select
  989. count(1)
  990. from user u
  991. LEFT JOIN admin a on a.id = u.aid
  992. LEFT JOIN organization_identity i on u.id = i.uid
  993. where u.type = 1
  994. <if test="aid != null">
  995. and u.aid = #{aid,jdbcType=VARCHAR}
  996. </if>
  997. <if test="number !=null">
  998. and u.number = #{number,jdbcType=INTEGER}
  999. </if>
  1000. <if test="mobile !=null">
  1001. and u.mobile= #{mobile,jdbcType=VARCHAR}
  1002. </if>
  1003. <if test="auditStatus !=null">
  1004. and i.audit_status = #{auditStatus,jdbcType=INTEGER}
  1005. </if>
  1006. <if test="auditName !=null">
  1007. and i.unit_name like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
  1008. </if>
  1009. <if test="email !=null">
  1010. and u.email = #{email,jdbcType=VARCHAR}
  1011. </if>
  1012. <if test="startCreateTime !=null">
  1013. and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
  1014. </if>
  1015. <if test="endCreateTime !=null">
  1016. and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
  1017. </if>
  1018. </select>
  1019. <select id="findUserByNameAndMobile" resultType="java.lang.String">
  1020. select
  1021. ui.username
  1022. from user u
  1023. left join user_identity ui on u.id = ui.uid
  1024. where u.lvl &gt; 0 and u.type = 0 and ui.audit_status = 5
  1025. <if test="name != null">
  1026. and ui.username = #{name,jdbcType=VARCHAR}
  1027. </if>
  1028. <if test="mobile != null">
  1029. and u.mobile = #{mobile,jdbcType=VARCHAR}
  1030. </if>
  1031. </select>
  1032. <select id="findOrgByNameAndMobile" resultType="java.lang.String">
  1033. select
  1034. oi.unit_name
  1035. from user u
  1036. left join organization_identity oi on u.id = oi.uid
  1037. where u.lvl &gt; 0 and u.type = 1 and oi.audit_status = 5
  1038. <if test="name != null">
  1039. and oi.unit_name = #{name,jdbcType=VARCHAR}
  1040. </if>
  1041. <if test="mobile != null">
  1042. and u.mobile = #{mobile,jdbcType=VARCHAR}
  1043. </if>
  1044. </select>
  1045. <select id="checkUser" resultMap="BaseResultMap">
  1046. select
  1047. id
  1048. from
  1049. user
  1050. where status <![CDATA[!= ]]> 1
  1051. <if test="id != null and id != ''">
  1052. and id = #{id,jdbcType=VARCHAR}
  1053. </if>
  1054. <if test="identifyName != null and identifyName != ''">
  1055. and identify_name = #{identifyName,jdbcType=VARCHAR}
  1056. </if>
  1057. <if test="mobile != null and mobile !=''">
  1058. and mobile = #{mobile,jdbcType=VARCHAR}
  1059. </if>
  1060. <if test="type != null">
  1061. and type = #{type,jdbcType=INTEGER}
  1062. </if>
  1063. <if test="source != null">
  1064. and source = #{source,jdbcType=INTEGER}
  1065. </if>
  1066. <if test="nickname != null and nickname != ''">
  1067. and nickname = #{nickname,jdbcType=INTEGER}
  1068. </if>
  1069. </select>
  1070. <select id="userInterest" resultType="com.goafanti.user.bo.UserInterestBo">
  1071. select
  1072. t.to_uid as id,y.username as name,y.work_unit as workUnit,y.professional_title as professionalTitle,t.create_time as createTime
  1073. from user_interest t
  1074. LEFT join user_identity y on t.to_uid=y.uid
  1075. LEFT join user u on t.to_uid=u.id
  1076. where t.from_uid=#{uid,jdbcType=VARCHAR}
  1077. </select>
  1078. <select id="selectBaseInfo" parameterType="java.lang.String" resultType="com.goafanti.app.bo.UserBasicInfo">
  1079. select
  1080. a.id,
  1081. a.mobile,
  1082. a.nickname,
  1083. a.email,
  1084. a.number,
  1085. a.type,
  1086. a.company_logo_url as companyLogoUrl,
  1087. a.head_portrait_url as headPortraitUrl,
  1088. a.introduction,
  1089. b.registration_id as registrationId,
  1090. b.easemob_name as easemobName,
  1091. b.easemob_pass as easemobPass
  1092. from user a left join jpush_easemob_account b
  1093. on a.id = b.uid
  1094. where
  1095. a.id = #{id,jdbcType=VARCHAR}
  1096. </select>
  1097. <select id="selectByNumber" parameterType="java.lang.String" resultMap="BaseResultMap">
  1098. select nickname,head_portrait_url from user where number = #{easemobName,jdbcType=VARCHAR}
  1099. </select>
  1100. <update id="updateEnteringAudit" parameterType="com.goafanti.common.model.User">
  1101. update user
  1102. <set>
  1103. <if test="auditStatus != null">
  1104. audit_status = #{auditStatus,jdbcType=INTEGER},
  1105. </if>
  1106. <if test="auditOpinion != null">
  1107. audit_opinion = #{auditOpinion,jdbcType=VARCHAR},
  1108. </if>
  1109. </set>
  1110. where id = #{id,jdbcType=VARCHAR}
  1111. </update>
  1112. <select id="selectUserByRoleName" parameterType="java.lang.String" resultMap="BaseResultMap">
  1113. select c.id from role a left join user_role b on a.id = b.rid left join admin c on b.uid = c.id where a.role_name = #{roleName}
  1114. </select>
  1115. <select id="findUserPartnerDetail" parameterType="java.lang.String" resultType="com.goafanti.user.bo.UserPartnerDetailBo">
  1116. select
  1117. u.id,i.work_unit as workUnit,i.professional_title as position,u.introduction as achievement,
  1118. u.head_portrait_url as personPortraitUrl,u.identify_name as username,
  1119. i.province,
  1120. u.introduction as personalProfile,
  1121. ua.ability_label as abilityLabel,i.qualification,
  1122. i.graduate_school,i.major_category,i.work_unit as workUnit,
  1123. ic.name as engagedField
  1124. from `user` u
  1125. left join user_identity i on u.id=i.uid
  1126. left join
  1127. user_career c on u.id=c.uid
  1128. <!-- left join user_info info on u.id=info.uid -->
  1129. left join user_ability ua on u.id=ua.uid
  1130. left join user_edu e on u.id=e.uid
  1131. left join industry_category ic on i.industry=ic.id
  1132. WHERE
  1133. u.source=0 and i.expert=1
  1134. <if test="_parameter!= null">
  1135. and u.id= #{_parameter,jdbcType=VARCHAR}
  1136. </if>
  1137. </select>
  1138. <select id="findUserPartner" parameterType="String" resultType="com.goafanti.user.bo.UserPartnerDetailBo">
  1139. select
  1140. u.id,u.identify_name as username,c.work_unit as work_unit,i.professional_title as position,c.achievement,
  1141. u.head_portrait_url as personPortraitUrl,
  1142. i.province,
  1143. u.introduction as personalProfile,
  1144. ua.ability_label as abilityLabel,i.uid,u.type
  1145. from `user` u
  1146. left join user_identity i on u.id=i.uid
  1147. left join
  1148. user_career c on u.id=c.uid
  1149. <!-- left join user_info info on u.id=info.uid -->
  1150. left join user_ability ua on u.id=ua.uid
  1151. WHERE
  1152. u.source =0 and i.expert=1
  1153. limit 0,50
  1154. </select>
  1155. <select id="selectByMobieAndTypeCount" resultType="java.lang.Integer">
  1156. select
  1157. count(*)
  1158. from user
  1159. where mobile = #{0} and source = 0
  1160. </select>
  1161. <resultMap id="regUserMap" type="com.goafanti.common.model.JtMessageConsumer">
  1162. <result column="id" jdbcType="VARCHAR" property="aid" />
  1163. </resultMap>
  1164. <!-- 查找所有正常的注册用户数据 -->
  1165. <select id="getAllUser" resultMap="regUserMap">
  1166. select id from user where status = 0 and source = 0
  1167. </select>
  1168. <!-- 获得用户数据 -->
  1169. <select id="getUserInfoList" parameterType="Map" resultType="com.goafanti.common.model.User">
  1170. select
  1171. id, mobile, nickname, email, type,
  1172. source, username, create_time as createTime
  1173. from `user`
  1174. where 1 = 1
  1175. <if test="user.status != null">
  1176. and status = #{user.status,jdbcType=INTEGER}
  1177. </if>
  1178. <if test="user.source != null">
  1179. and source = #{user.source,jdbcType=INTEGER}
  1180. </if>
  1181. <if test="user.type != null">
  1182. and `type` = #{user.type,jdbcType=INTEGER}
  1183. </if>
  1184. <if test="user.mobile != null">
  1185. <bind name="m" value="'%' + user.mobile + '%'"/>
  1186. and mobile like #{m,jdbcType=VARCHAR}
  1187. </if>
  1188. <if test="user.username != null">
  1189. <bind name="u" value="'%' + user.username + '%'"/>
  1190. and username like #{u,jdbcType=VARCHAR}
  1191. </if>
  1192. order by create_time desc
  1193. <if test="page_sql != null">
  1194. ${page_sql}
  1195. </if>
  1196. </select>
  1197. <select id="getUserInfoCount" parameterType="Map" resultType="java.lang.Integer">
  1198. select count(0)
  1199. from `user`
  1200. where 1 = 1
  1201. <if test="user.status != null">
  1202. and status = #{user.status,jdbcType=INTEGER}
  1203. </if>
  1204. <if test="user.source != null">
  1205. and source = #{user.source,jdbcType=INTEGER}
  1206. </if>
  1207. <if test="user.type != null">
  1208. and `type` = #{user.type,jdbcType=INTEGER}
  1209. </if>
  1210. <if test="user.mobile != null">
  1211. <bind name="m" value="'%' + user.mobile + '%'"/>
  1212. and mobile like #{m,jdbcType=VARCHAR}
  1213. </if>
  1214. <if test="user.username != null">
  1215. <bind name="u" value="'%' + user.username + '%'"/>
  1216. and username like #{u,jdbcType=VARCHAR}
  1217. </if>
  1218. </select>
  1219. <!-- 验证手机号码是否重复 -->
  1220. <select id="getCountByMobile" parameterType="com.goafanti.common.model.User" resultType="java.lang.Integer">
  1221. select count(0) from user where mobile = #{mobile,jdbcType=VARCHAR} and id &lt;&gt; #{id,jdbcType=VARCHAR}
  1222. </select>
  1223. </mapper>