UserMapper.xml 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413
  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}
  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.person_portrait_url,
  648. o.logo_url , u.id as uid, adc.achievement_count as achievementNum,
  649. adc.demand_count as demandNum
  650. from user u
  651. LEFT JOIN organization_info o on u.id = o.uid
  652. LEFT JOIN achievement_demand_count adc on adc.uid = u.id
  653. LEFT JOIN member_grade mg ON mg.member_rank=u.lvl
  654. where u.id = #{uid,jdbcType = VARCHAR}
  655. </select>
  656. <select id="selectUserDownLoadBoByUserId" parameterType="java.lang.String" resultMap="UserDownLoadBo">
  657. select u.id,i.positive_id_url ,i.opposite_id_url,c.professional_certificate_url,c.qualification_certificate_url,
  658. e.diploma_url, e.degree_diploma_url
  659. from user u
  660. LEFT JOIN user_identity i on u.id = i.uid
  661. LEFT JOIN user_career c on u.id = c.uid
  662. LEFT JOIN user_edu e on u.id = e.uid
  663. where u.id =#{id,jdbcType=VARCHAR}
  664. </select>
  665. <select id="findUserListByPage" parameterType="String" resultType="com.goafanti.user.bo.UserListBo">
  666. select
  667. u.id ,
  668. u.mobile,
  669. u.email,
  670. u.create_time as createTime,
  671. u.number ,
  672. i.username,
  673. i.audit_status as auditStatus,
  674. a.name as adminName,
  675. ad.name as managerName
  676. from user u
  677. LEFT JOIN admin a on a.id = u.aid
  678. LEFT JOIN admin ad on ad.id = u.mid
  679. LEFT JOIN user_identity i
  680. ON u.id = i.uid where u.type = 0
  681. <if test="mobile != null">
  682. and u.mobile = #{mobile,jdbcType=VARCHAR}
  683. </if>
  684. <if test="email != null">
  685. and u.email = #{email,jdbcType=VARCHAR}
  686. </if>
  687. <if test="pStart != null">
  688. and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  689. </if>
  690. <if test="pEnd != null">
  691. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  692. </if>
  693. <if test=" number != null">
  694. and u.number = #{number,jdbcType=INTEGER}
  695. </if>
  696. <if test="username != null">
  697. and i.username like CONCAT ('%',#{username,jdbcType=VARCHAR},'%')
  698. </if>
  699. <if test="auditStatus != null">
  700. and i.audit_status= #{auditStatus,jdbcType=INTEGER}
  701. </if>
  702. order by u.number desc
  703. <if test="page_sql!=null">
  704. ${page_sql}
  705. </if>
  706. </select>
  707. <select id="findUserCount" parameterType="String" resultType="java.lang.Integer">
  708. select count(1)
  709. from user u LEFT JOIN user_identity i
  710. ON u.id = i.uid
  711. WHERE u.type = 0
  712. <if test="mobile != null">
  713. and u.mobile = #{mobile,jdbcType=VARCHAR}
  714. </if>
  715. <if test="email != null">
  716. and u.email = #{email,jdbcType=VARCHAR}
  717. </if>
  718. <if test="pStart != null">
  719. and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  720. </if>
  721. <if test="pEnd != null">
  722. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  723. </if>
  724. <if test="number != null">
  725. and u.number = #{number,jdbcType=INTEGER}
  726. </if>
  727. <if test="username != null">
  728. and i.username like CONCAT ('%',#{username,jdbcType=VARCHAR},'%')
  729. </if>
  730. <if test="auditStatus != null">
  731. and i.audit_status= #{auditStatus,jdbcType=INTEGER}
  732. </if>
  733. </select>
  734. <select id="findOrgListByPage" parameterType="String" resultType="com.goafanti.user.bo.OrgListBo">
  735. select u.id ,u.mobile, u.email, u.create_time as createTime,
  736. u.number, o.audit_status as orgAuditStatus, a.name as adminName,
  737. o.unit_name as unitName, ad.name as managerName
  738. from user u
  739. LEFT JOIN admin a on a.id = u.aid
  740. LEFT JOIN admin ad on ad.id = u.mid
  741. LEFT JOIN organization_identity o
  742. ON u.id = o.uid
  743. WHERE u.type = 1
  744. <if test="mobile != null">
  745. and u.mobile = #{mobile,jdbcType=VARCHAR}
  746. </if>
  747. <if test="uid != null">
  748. and u.id = #{uid,jdbcType=VARCHAR}
  749. </if>
  750. <if test="email != null">
  751. and u.email = #{email,jdbcType=VARCHAR}
  752. </if>
  753. <if test="pStart != null">
  754. and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
  755. </if>
  756. <if test="pEnd != null">
  757. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  758. </if>
  759. <if test=" number != null">
  760. and u.number = #{number,jdbcType=INTEGER}
  761. </if>
  762. <if test="unitName != null">
  763. and o.unit_name = #{unitName,jdbcType=VARCHAR}
  764. </if>
  765. <if test="auditStatus != null">
  766. and o.audit_status= #{auditStatus,jdbcType=INTEGER}
  767. </if>
  768. order by u.number desc
  769. <if test="page_sql!=null">
  770. ${page_sql}
  771. </if>
  772. </select>
  773. <select id="findOrgCount" parameterType="String" resultType="java.lang.Integer">
  774. select count(1)
  775. from user u LEFT JOIN organization_identity o
  776. ON u.id = o.uid
  777. WHERE u.type = 1
  778. <if test="uid != null">
  779. and u.id = #{uid,jdbcType=VARCHAR}
  780. </if>
  781. <if test="mobile != null">
  782. and u.mobile = #{mobile,jdbcType=VARCHAR}
  783. </if>
  784. <if test="email != null">
  785. and u.email = #{email,jdbcType=VARCHAR}
  786. </if>
  787. <if test="pStart != null">
  788. and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
  789. </if>
  790. <if test="pEnd != null">
  791. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  792. </if>
  793. <if test=" number != null">
  794. and u.number = #{number,jdbcType=INTEGER}
  795. </if>
  796. <if test="unitName != null">
  797. and o.unit_name = #{unitName,jdbcType=VARCHAR}
  798. </if>
  799. <if test="auditStatus != null">
  800. and o.audit_status= #{auditStatus,jdbcType=INTEGER}
  801. </if>
  802. </select>
  803. <select id="findUserByAidWithParamsListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
  804. select
  805. u.id ,
  806. u.mobile,
  807. u.email,
  808. u.create_time as createTime,
  809. u.number ,
  810. a.name as adminName,
  811. ma.name as managerName,
  812. u.type,
  813. i.username,
  814. i.audit_status as userAuditStatus
  815. from user u
  816. LEFT JOIN admin a on a.id = u.aid
  817. LEFT JOIN admin ma on ma.id = u.mid
  818. LEFT JOIN user_identity i on u.id = i.uid
  819. where u.type = 0
  820. <if test="aid != null">
  821. and u.aid = #{aid,jdbcType=VARCHAR}
  822. </if>
  823. <if test="number !=null">
  824. and u.number = #{number,jdbcType=INTEGER}
  825. </if>
  826. <if test="mobile !=null">
  827. and u.mobile= #{mobile,jdbcType=VARCHAR}
  828. </if>
  829. <if test="auditStatus !=null">
  830. and i.audit_status = #{auditStatus,jdbcType=INTEGER}
  831. </if>
  832. <if test="auditName !=null">
  833. and i.username like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
  834. </if>
  835. <if test="email !=null">
  836. and u.email = #{email,jdbcType=VARCHAR}
  837. </if>
  838. <if test="startCreateTime !=null">
  839. and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
  840. </if>
  841. <if test="endCreateTime !=null">
  842. and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
  843. </if>
  844. order by u.number desc
  845. <if test="page_sql!=null">
  846. ${page_sql}
  847. </if>
  848. </select>
  849. <select id="findUserByAidWithParamsCount" parameterType="String" resultType="java.lang.Integer">
  850. select
  851. count(1)
  852. from user u
  853. LEFT JOIN admin a on a.id = u.aid
  854. LEFT JOIN user_identity i on u.id = i.uid
  855. where u.type = 0
  856. <if test="aid != null">
  857. and u.aid = #{aid,jdbcType=VARCHAR}
  858. </if>
  859. <if test="number !=null">
  860. and u.number = #{number,jdbcType=INTEGER}
  861. </if>
  862. <if test="mobile !=null">
  863. and u.mobile= #{mobile,jdbcType=VARCHAR}
  864. </if>
  865. <if test="auditStatus !=null">
  866. and i.audit_status = #{auditStatus,jdbcType=INTEGER}
  867. </if>
  868. <if test="auditName !=null">
  869. and i.username like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
  870. </if>
  871. <if test="email !=null">
  872. and u.email = #{email,jdbcType=VARCHAR}
  873. </if>
  874. <if test="startCreateTime !=null">
  875. and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
  876. </if>
  877. <if test="endCreateTime !=null">
  878. and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
  879. </if>
  880. </select>
  881. <select id="findOrgByAidWithParamsListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
  882. select
  883. u.id ,
  884. u.mobile,
  885. u.email,
  886. u.create_time as createTime,
  887. u.number ,
  888. a.name as adminName,
  889. ma.name as managerName,
  890. u.type,
  891. i.unit_name as unitName,
  892. i.audit_status as orgAuditStatus
  893. from user u
  894. LEFT JOIN admin a on a.id = u.aid
  895. LEFT JOIN admin ma on ma.id = u.mid
  896. LEFT JOIN organization_identity i on u.id = i.uid
  897. where u.type = 1
  898. <if test="aid != null">
  899. and u.aid = #{aid,jdbcType=VARCHAR}
  900. </if>
  901. <if test="number !=null">
  902. and u.number = #{number,jdbcType=INTEGER}
  903. </if>
  904. <if test="mobile !=null">
  905. and u.mobile= #{mobile,jdbcType=VARCHAR}
  906. </if>
  907. <if test="auditStatus !=null">
  908. and i.audit_status = #{auditStatus,jdbcType=INTEGER}
  909. </if>
  910. <if test="auditName !=null">
  911. and i.unit_name like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
  912. </if>
  913. <if test="email !=null">
  914. and u.email = #{email,jdbcType=VARCHAR}
  915. </if>
  916. <if test="startCreateTime !=null">
  917. and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
  918. </if>
  919. <if test="endCreateTime !=null">
  920. and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
  921. </if>
  922. order by u.number desc
  923. <if test="page_sql!=null">
  924. ${page_sql}
  925. </if>
  926. </select>
  927. <select id="findOrgByAidWithParamsCount" parameterType="String" resultType="java.lang.Integer">
  928. select
  929. count(1)
  930. from user u
  931. LEFT JOIN admin a on a.id = u.aid
  932. LEFT JOIN organization_identity i on u.id = i.uid
  933. where u.type = 1
  934. <if test="aid != null">
  935. and u.aid = #{aid,jdbcType=VARCHAR}
  936. </if>
  937. <if test="number !=null">
  938. and u.number = #{number,jdbcType=INTEGER}
  939. </if>
  940. <if test="mobile !=null">
  941. and u.mobile= #{mobile,jdbcType=VARCHAR}
  942. </if>
  943. <if test="auditStatus !=null">
  944. and i.audit_status = #{auditStatus,jdbcType=INTEGER}
  945. </if>
  946. <if test="auditName !=null">
  947. and i.unit_name like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
  948. </if>
  949. <if test="email !=null">
  950. and u.email = #{email,jdbcType=VARCHAR}
  951. </if>
  952. <if test="startCreateTime !=null">
  953. and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
  954. </if>
  955. <if test="endCreateTime !=null">
  956. and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
  957. </if>
  958. </select>
  959. <select id="findUserByNameAndMobile" resultType="java.lang.String">
  960. select
  961. ui.username
  962. from user u
  963. left join user_identity ui on u.id = ui.uid
  964. where u.lvl &gt; 0 and u.type = 0 and ui.audit_status = 5
  965. <if test="name != null">
  966. and ui.username = #{name,jdbcType=VARCHAR}
  967. </if>
  968. <if test="mobile != null">
  969. and u.mobile = #{mobile,jdbcType=VARCHAR}
  970. </if>
  971. </select>
  972. <select id="findOrgByNameAndMobile" resultType="java.lang.String">
  973. select
  974. oi.unit_name
  975. from user u
  976. left join organization_identity oi on u.id = oi.uid
  977. where u.lvl &gt; 0 and u.type = 1 and oi.audit_status = 5
  978. <if test="name != null">
  979. and oi.unit_name = #{name,jdbcType=VARCHAR}
  980. </if>
  981. <if test="mobile != null">
  982. and u.mobile = #{mobile,jdbcType=VARCHAR}
  983. </if>
  984. </select>
  985. <select id="findAreaManagerUserListByPage" parameterType="String" resultType="com.goafanti.user.bo.UserListBo">
  986. select
  987. u.id ,
  988. u.mobile,
  989. u.email,
  990. u.create_time as createTime,
  991. u.number ,
  992. i.audit_status as auditStatus,
  993. i.username,
  994. a.name as adminName,
  995. ad.name as managerName
  996. from user u
  997. LEFT JOIN admin a on a.id = u.aid
  998. LEFT JOIN admin ad on ad.id = u.mid
  999. LEFT JOIN user_identity i on u.id = i.uid
  1000. where u.type = 0
  1001. <if test="mobile != null">
  1002. and u.mobile = #{mobile,jdbcType=VARCHAR}
  1003. </if>
  1004. <if test="email != null">
  1005. and u.email = #{email,jdbcType=VARCHAR}
  1006. </if>
  1007. <if test="pStart != null">
  1008. and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  1009. </if>
  1010. <if test="pEnd != null">
  1011. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  1012. </if>
  1013. <if test=" number != null">
  1014. and u.number = #{number,jdbcType=INTEGER}
  1015. </if>
  1016. <if test="username != null">
  1017. and i.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  1018. </if>
  1019. <if test="auditStatus != null">
  1020. and i.audit_status= #{auditStatus,jdbcType=INTEGER}
  1021. </if>
  1022. <if test="provinceList != null">
  1023. and i.province in
  1024. <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
  1025. #{plist}
  1026. </foreach>
  1027. </if>
  1028. <if test="cityList != null">
  1029. and i.city in
  1030. <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
  1031. #{clist}
  1032. </foreach>
  1033. </if>
  1034. order by u.number desc
  1035. <if test="page_sql!=null">
  1036. ${page_sql}
  1037. </if>
  1038. </select>
  1039. <select id="findAreaManagerUserCount" parameterType="String" resultType="java.lang.Integer">
  1040. select count(1)
  1041. from user u LEFT JOIN user_identity i
  1042. ON u.id = i.uid
  1043. WHERE u.type = 0
  1044. <if test="mobile != null">
  1045. and u.mobile = #{mobile,jdbcType=VARCHAR}
  1046. </if>
  1047. <if test="email != null">
  1048. and u.email = #{email,jdbcType=VARCHAR}
  1049. </if>
  1050. <if test="pStart != null">
  1051. and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  1052. </if>
  1053. <if test="pEnd != null">
  1054. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  1055. </if>
  1056. <if test="number != null">
  1057. and u.number = #{number,jdbcType=INTEGER}
  1058. </if>
  1059. <if test="username != null">
  1060. and i.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  1061. </if>
  1062. <if test="auditStatus != null">
  1063. and i.audit_status= #{auditStatus,jdbcType=INTEGER}
  1064. </if>
  1065. <if test="provinceList != null">
  1066. and i.province in
  1067. <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
  1068. #{plist}
  1069. </foreach>
  1070. </if>
  1071. <if test="cityList != null">
  1072. and i.city in
  1073. <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
  1074. #{clist}
  1075. </foreach>
  1076. </if>
  1077. </select>
  1078. <select id="findAreaManagerOrgListByPage" parameterType="String" resultType="com.goafanti.user.bo.OrgListBo">
  1079. select
  1080. u.id ,
  1081. u.mobile,
  1082. u.email,
  1083. u.create_time as createTime,
  1084. u.number ,
  1085. o.audit_status as orgAuditStatus,
  1086. a.name as adminName,
  1087. o.unit_name as unitName,
  1088. ad.name as managerName
  1089. from user u
  1090. LEFT JOIN admin a on a.id = u.aid
  1091. LEFT JOIN admin ad on ad.id = u.mid
  1092. LEFT JOIN organization_identity o on u.id = o.uid
  1093. WHERE u.type = 1
  1094. <if test="mobile != null">
  1095. and u.mobile = #{mobile,jdbcType=VARCHAR}
  1096. </if>
  1097. <if test="uid != null">
  1098. and u.id = #{uid,jdbcType=VARCHAR}
  1099. </if>
  1100. <if test="email != null">
  1101. and u.email = #{email,jdbcType=VARCHAR}
  1102. </if>
  1103. <if test="pStart != null">
  1104. and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
  1105. </if>
  1106. <if test="pEnd != null">
  1107. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  1108. </if>
  1109. <if test=" number != null">
  1110. and u.number = #{number,jdbcType=INTEGER}
  1111. </if>
  1112. <if test="unitName != null">
  1113. and o.unit_name like '%'#{unitName,jdbcType=VARCHAR}'%'
  1114. </if>
  1115. <if test="auditStatus != null">
  1116. and o.audit_status= #{auditStatus,jdbcType=INTEGER}
  1117. </if>
  1118. <if test="provinceList != null">
  1119. and o.licence_province in
  1120. <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
  1121. #{plist}
  1122. </foreach>
  1123. </if>
  1124. <if test="cityList != null">
  1125. and o.licence_city in
  1126. <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
  1127. #{clist}
  1128. </foreach>
  1129. </if>
  1130. order by u.number desc
  1131. <if test="page_sql!=null">
  1132. ${page_sql}
  1133. </if>
  1134. </select>
  1135. <select id="findAreaManagerOrgCount" parameterType="String" resultType="java.lang.Integer">
  1136. select count(1)
  1137. from user u LEFT JOIN organization_identity o
  1138. ON u.id = o.uid
  1139. WHERE u.type = 1
  1140. <if test="uid != null">
  1141. and u.id = #{uid,jdbcType=VARCHAR}
  1142. </if>
  1143. <if test="mobile != null">
  1144. and u.mobile = #{mobile,jdbcType=VARCHAR}
  1145. </if>
  1146. <if test="email != null">
  1147. and u.email = #{email,jdbcType=VARCHAR}
  1148. </if>
  1149. <if test="pStart != null">
  1150. and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
  1151. </if>
  1152. <if test="pEnd != null">
  1153. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  1154. </if>
  1155. <if test=" number != null">
  1156. and u.number = #{number,jdbcType=INTEGER}
  1157. </if>
  1158. <if test="unitName != null">
  1159. and o.unit_name like '%'#{unitName,jdbcType=VARCHAR}'%'
  1160. </if>
  1161. <if test="auditStatus != null">
  1162. and o.audit_status= #{auditStatus,jdbcType=INTEGER}
  1163. </if>
  1164. <if test="provinceList != null">
  1165. and i.province in
  1166. <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
  1167. #{plist}
  1168. </foreach>
  1169. </if>
  1170. <if test="cityList != null">
  1171. and i.city in
  1172. <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
  1173. #{clist}
  1174. </foreach>
  1175. </if>
  1176. </select>
  1177. <select id="findUserPartnerDetail" parameterType="java.lang.String" resultType="com.goafanti.user.bo.UserPartnerDetailBo">
  1178. select
  1179. u.id,i.username,c.work_unit as work_unit,c.position,c.achievement,
  1180. u.head_portrait_url as personPortraitUrl,
  1181. i.province,
  1182. u.introduction as personalProfile,
  1183. ua.ability_label as abilityLabel,c.qualification,
  1184. e.graduate_school,e.major_category,c.work_unit as workUnit,
  1185. c.engaged_field as engagedField
  1186. from `user` u
  1187. left join user_identity i on u.id=i.uid
  1188. left join
  1189. user_career c on u.id=c.uid
  1190. <!-- left join user_info info on u.id=info.uid -->
  1191. left join user_ability ua on u.id=ua.uid
  1192. left join user_edu e on u.id=e.uid
  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 1=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. </select>
  1376. </mapper>