UserMapper.xml 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466
  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 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. <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>