UserMapper.xml 52 KB

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