UserMapper.xml 47 KB

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