UserMapper.xml 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857
  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 Tue Jun 26 10:23:14 CST 2018.
  9. -->
  10. <id column="id" jdbcType="VARCHAR" property="id" />
  11. <result column="mobile" jdbcType="VARCHAR" property="mobile" />
  12. <result column="password" jdbcType="VARCHAR" property="password" />
  13. <result column="nickname" jdbcType="VARCHAR" property="nickname" />
  14. <result column="email" jdbcType="VARCHAR" property="email" />
  15. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  16. <result column="number" jdbcType="BIGINT" property="number" />
  17. <result column="lvl" jdbcType="INTEGER" property="lvl" />
  18. <result column="type" jdbcType="INTEGER" property="type" />
  19. <result column="mid" jdbcType="VARCHAR" property="mid" />
  20. <result column="status" jdbcType="INTEGER" property="status" />
  21. <result column="source" jdbcType="INTEGER" property="source" />
  22. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  23. <result column="company_logo_url" jdbcType="VARCHAR" property="companyLogoUrl" />
  24. <result column="head_portrait_url" jdbcType="VARCHAR" property="headPortraitUrl" />
  25. <result column="society_tag" jdbcType="VARCHAR" property="societyTag" />
  26. <result column="introduction" jdbcType="VARCHAR" property="introduction" />
  27. <result column="value_added_tag" jdbcType="VARCHAR" property="valueAddedTag" />
  28. <result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
  29. <result column="identify_name" jdbcType="VARCHAR" property="identifyName" />
  30. <result column="background_url" jdbcType="VARCHAR" property="backgroundUrl" />
  31. <result column="audit_opinion" jdbcType="VARCHAR" property="auditOpinion" />
  32. <result column="audit_status" jdbcType="INTEGER" property="auditStatus" />
  33. <result column="share_type" jdbcType="INTEGER" property="shareType" />
  34. <result column="aid" jdbcType="VARCHAR" property="aid" />
  35. <result column="transfer_time" jdbcType="TIMESTAMP" property="transferTime" />
  36. <result column="information_maintainer" jdbcType="VARCHAR" property="informationMaintainer" />
  37. <result column="core_technology" jdbcType="VARCHAR" property="coreTechnology" />
  38. <result column="accomplish_situation" jdbcType="VARCHAR" property="accomplishSituation" />
  39. <result column="intellectual_property" jdbcType="VARCHAR" property="intellectualProperty" />
  40. <result column="credit_rating" jdbcType="INTEGER" property="creditRating" />
  41. <result column="username" jdbcType="VARCHAR" property="username" />
  42. <result column="authentication" jdbcType="INTEGER" property="authentication" />
  43. <result column="level" jdbcType="INTEGER" property="level" />
  44. <result column="integrity" jdbcType="FLOAT" property="integrity" />
  45. <result column="sign_bills" jdbcType="INTEGER" property="signBills" />
  46. <result column="channel" jdbcType="INTEGER" property="channel" />
  47. </resultMap>
  48. <sql id="Example_Where_Clause">
  49. <!--
  50. WARNING - @mbg.generated
  51. This element is automatically generated by MyBatis Generator, do not modify.
  52. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  53. -->
  54. <where>
  55. <foreach collection="oredCriteria" item="criteria" separator="or">
  56. <if test="criteria.valid">
  57. <trim prefix="(" prefixOverrides="and" suffix=")">
  58. <foreach collection="criteria.criteria" item="criterion">
  59. <choose>
  60. <when test="criterion.noValue">
  61. and ${criterion.condition}
  62. </when>
  63. <when test="criterion.singleValue">
  64. and ${criterion.condition} #{criterion.value}
  65. </when>
  66. <when test="criterion.betweenValue">
  67. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  68. </when>
  69. <when test="criterion.listValue">
  70. and ${criterion.condition}
  71. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  72. #{listItem}
  73. </foreach>
  74. </when>
  75. </choose>
  76. </foreach>
  77. </trim>
  78. </if>
  79. </foreach>
  80. </where>
  81. </sql>
  82. <sql id="Update_By_Example_Where_Clause">
  83. <!--
  84. WARNING - @mbg.generated
  85. This element is automatically generated by MyBatis Generator, do not modify.
  86. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  87. -->
  88. <where>
  89. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  90. <if test="criteria.valid">
  91. <trim prefix="(" prefixOverrides="and" suffix=")">
  92. <foreach collection="criteria.criteria" item="criterion">
  93. <choose>
  94. <when test="criterion.noValue">
  95. and ${criterion.condition}
  96. </when>
  97. <when test="criterion.singleValue">
  98. and ${criterion.condition} #{criterion.value}
  99. </when>
  100. <when test="criterion.betweenValue">
  101. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  102. </when>
  103. <when test="criterion.listValue">
  104. and ${criterion.condition}
  105. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  106. #{listItem}
  107. </foreach>
  108. </when>
  109. </choose>
  110. </foreach>
  111. </trim>
  112. </if>
  113. </foreach>
  114. </where>
  115. </sql>
  116. <sql id="Base_Column_List">
  117. <!--
  118. WARNING - @mbg.generated
  119. This element is automatically generated by MyBatis Generator, do not modify.
  120. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  121. -->
  122. id, mobile, password, nickname, email, create_time, number, lvl, type, mid, status,
  123. source, update_time, company_logo_url, head_portrait_url, society_tag, introduction,
  124. value_added_tag, organization_id, identify_name, background_url, audit_opinion, audit_status,
  125. share_type, aid, transfer_time, information_maintainer, core_technology, accomplish_situation,
  126. intellectual_property, credit_rating, username, authentication, level,integrity,sign_bills,channel
  127. </sql>
  128. <select id="selectByExample" parameterType="com.goafanti.common.model.UserExample" resultMap="BaseResultMap">
  129. <!--
  130. WARNING - @mbg.generated
  131. This element is automatically generated by MyBatis Generator, do not modify.
  132. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  133. -->
  134. select
  135. <if test="distinct">
  136. distinct
  137. </if>
  138. <include refid="Base_Column_List" />
  139. from user
  140. <if test="_parameter != null">
  141. <include refid="Example_Where_Clause" />
  142. </if>
  143. <if test="orderByClause != null">
  144. order by ${orderByClause}
  145. </if>
  146. </select>
  147. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  148. <!--
  149. WARNING - @mbg.generated
  150. This element is automatically generated by MyBatis Generator, do not modify.
  151. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  152. -->
  153. select
  154. <include refid="Base_Column_List" />
  155. from user
  156. where id = #{id,jdbcType=VARCHAR}
  157. </select>
  158. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  159. <!--
  160. WARNING - @mbg.generated
  161. This element is automatically generated by MyBatis Generator, do not modify.
  162. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  163. -->
  164. delete from user
  165. where id = #{id,jdbcType=VARCHAR}
  166. </delete>
  167. <delete id="deleteByExample" parameterType="com.goafanti.common.model.UserExample">
  168. <!--
  169. WARNING - @mbg.generated
  170. This element is automatically generated by MyBatis Generator, do not modify.
  171. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  172. -->
  173. delete from user
  174. <if test="_parameter != null">
  175. <include refid="Example_Where_Clause" />
  176. </if>
  177. </delete>
  178. <insert id="insert" parameterType="com.goafanti.common.model.User">
  179. <!--
  180. WARNING - @mbg.generated
  181. This element is automatically generated by MyBatis Generator, do not modify.
  182. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  183. -->
  184. insert into user (id, mobile, password,
  185. nickname, email, create_time,
  186. number, lvl, type, mid,
  187. status, source, update_time,
  188. company_logo_url, head_portrait_url, society_tag,
  189. introduction, value_added_tag, organization_id,
  190. identify_name, background_url, audit_opinion,
  191. audit_status, share_type, aid,
  192. transfer_time, information_maintainer,
  193. core_technology, accomplish_situation, intellectual_property,
  194. credit_rating, username, authentication,
  195. level,integrity)
  196. values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
  197. #{nickname,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  198. #{number,jdbcType=BIGINT}, #{lvl,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{mid,jdbcType=VARCHAR},
  199. #{status,jdbcType=INTEGER}, #{source,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
  200. #{companyLogoUrl,jdbcType=VARCHAR}, #{headPortraitUrl,jdbcType=VARCHAR}, #{societyTag,jdbcType=VARCHAR},
  201. #{introduction,jdbcType=VARCHAR}, #{valueAddedTag,jdbcType=VARCHAR}, #{organizationId,jdbcType=VARCHAR},
  202. #{identifyName,jdbcType=VARCHAR}, #{backgroundUrl,jdbcType=VARCHAR}, #{auditOpinion,jdbcType=VARCHAR},
  203. #{auditStatus,jdbcType=INTEGER}, #{shareType,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR},
  204. #{transferTime,jdbcType=TIMESTAMP}, #{informationMaintainer,jdbcType=VARCHAR},
  205. #{coreTechnology,jdbcType=VARCHAR}, #{accomplishSituation,jdbcType=VARCHAR}, #{intellectualProperty,jdbcType=VARCHAR},
  206. #{creditRating,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{authentication,jdbcType=INTEGER},
  207. #{level,jdbcType=INTEGER},#{integrity,jdbcType=FLOAT})
  208. </insert>
  209. <insert id="insertSelective" parameterType="com.goafanti.common.model.User">
  210. <!--
  211. WARNING - @mbg.generated
  212. This element is automatically generated by MyBatis Generator, do not modify.
  213. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  214. -->
  215. insert into user
  216. <trim prefix="(" suffix=")" suffixOverrides=",">
  217. <if test="id != null">
  218. id,
  219. </if>
  220. <if test="mobile != null">
  221. mobile,
  222. </if>
  223. <if test="password != null">
  224. password,
  225. </if>
  226. <if test="nickname != null">
  227. nickname,
  228. </if>
  229. <if test="email != null">
  230. email,
  231. </if>
  232. <if test="createTime != null">
  233. create_time,
  234. </if>
  235. <if test="number != null">
  236. number,
  237. </if>
  238. <if test="lvl != null">
  239. lvl,
  240. </if>
  241. <if test="type != null">
  242. type,
  243. </if>
  244. <if test="mid != null">
  245. mid,
  246. </if>
  247. <if test="status != null">
  248. status,
  249. </if>
  250. <if test="source != null">
  251. source,
  252. </if>
  253. <if test="updateTime != null">
  254. update_time,
  255. </if>
  256. <if test="companyLogoUrl != null">
  257. company_logo_url,
  258. </if>
  259. <if test="headPortraitUrl != null">
  260. head_portrait_url,
  261. </if>
  262. <if test="societyTag != null">
  263. society_tag,
  264. </if>
  265. <if test="introduction != null">
  266. introduction,
  267. </if>
  268. <if test="valueAddedTag != null">
  269. value_added_tag,
  270. </if>
  271. <if test="organizationId != null">
  272. organization_id,
  273. </if>
  274. <if test="identifyName != null">
  275. identify_name,
  276. </if>
  277. <if test="backgroundUrl != null">
  278. background_url,
  279. </if>
  280. <if test="auditOpinion != null">
  281. audit_opinion,
  282. </if>
  283. <if test="auditStatus != null">
  284. audit_status,
  285. </if>
  286. <if test="shareType != null">
  287. share_type,
  288. </if>
  289. <if test="aid != null">
  290. aid,
  291. </if>
  292. <if test="transferTime != null">
  293. transfer_time,
  294. </if>
  295. <if test="informationMaintainer != null">
  296. information_maintainer,
  297. </if>
  298. <if test="coreTechnology != null">
  299. core_technology,
  300. </if>
  301. <if test="accomplishSituation != null">
  302. accomplish_situation,
  303. </if>
  304. <if test="intellectualProperty != null">
  305. intellectual_property,
  306. </if>
  307. <if test="creditRating != null">
  308. credit_rating,
  309. </if>
  310. <if test="username != null">
  311. username,
  312. </if>
  313. <if test="authentication != null">
  314. authentication,
  315. </if>
  316. <if test="level != null">
  317. level,
  318. </if>
  319. <if test="integrity != null">
  320. integrity,
  321. </if>
  322. </trim>
  323. <trim prefix="values (" suffix=")" suffixOverrides=",">
  324. <if test="id != null">
  325. #{id,jdbcType=VARCHAR},
  326. </if>
  327. <if test="mobile != null">
  328. #{mobile,jdbcType=VARCHAR},
  329. </if>
  330. <if test="password != null">
  331. #{password,jdbcType=VARCHAR},
  332. </if>
  333. <if test="nickname != null">
  334. #{nickname,jdbcType=VARCHAR},
  335. </if>
  336. <if test="email != null">
  337. #{email,jdbcType=VARCHAR},
  338. </if>
  339. <if test="createTime != null">
  340. #{createTime,jdbcType=TIMESTAMP},
  341. </if>
  342. <if test="number != null">
  343. #{number,jdbcType=BIGINT},
  344. </if>
  345. <if test="lvl != null">
  346. #{lvl,jdbcType=INTEGER},
  347. </if>
  348. <if test="type != null">
  349. #{type,jdbcType=INTEGER},
  350. </if>
  351. <if test="mid != null">
  352. #{mid,jdbcType=VARCHAR},
  353. </if>
  354. <if test="status != null">
  355. #{status,jdbcType=INTEGER},
  356. </if>
  357. <if test="source != null">
  358. #{source,jdbcType=INTEGER},
  359. </if>
  360. <if test="updateTime != null">
  361. #{updateTime,jdbcType=TIMESTAMP},
  362. </if>
  363. <if test="companyLogoUrl != null">
  364. #{companyLogoUrl,jdbcType=VARCHAR},
  365. </if>
  366. <if test="headPortraitUrl != null">
  367. #{headPortraitUrl,jdbcType=VARCHAR},
  368. </if>
  369. <if test="societyTag != null">
  370. #{societyTag,jdbcType=VARCHAR},
  371. </if>
  372. <if test="introduction != null">
  373. #{introduction,jdbcType=VARCHAR},
  374. </if>
  375. <if test="valueAddedTag != null">
  376. #{valueAddedTag,jdbcType=VARCHAR},
  377. </if>
  378. <if test="organizationId != null">
  379. #{organizationId,jdbcType=VARCHAR},
  380. </if>
  381. <if test="identifyName != null">
  382. #{identifyName,jdbcType=VARCHAR},
  383. </if>
  384. <if test="backgroundUrl != null">
  385. #{backgroundUrl,jdbcType=VARCHAR},
  386. </if>
  387. <if test="auditOpinion != null">
  388. #{auditOpinion,jdbcType=VARCHAR},
  389. </if>
  390. <if test="auditStatus != null">
  391. #{auditStatus,jdbcType=INTEGER},
  392. </if>
  393. <if test="shareType != null">
  394. #{shareType,jdbcType=INTEGER},
  395. </if>
  396. <if test="aid != null">
  397. #{aid,jdbcType=VARCHAR},
  398. </if>
  399. <if test="transferTime != null">
  400. #{transferTime,jdbcType=TIMESTAMP},
  401. </if>
  402. <if test="informationMaintainer != null">
  403. #{informationMaintainer,jdbcType=VARCHAR},
  404. </if>
  405. <if test="coreTechnology != null">
  406. #{coreTechnology,jdbcType=VARCHAR},
  407. </if>
  408. <if test="accomplishSituation != null">
  409. #{accomplishSituation,jdbcType=VARCHAR},
  410. </if>
  411. <if test="intellectualProperty != null">
  412. #{intellectualProperty,jdbcType=VARCHAR},
  413. </if>
  414. <if test="creditRating != null">
  415. #{creditRating,jdbcType=INTEGER},
  416. </if>
  417. <if test="username != null">
  418. #{username,jdbcType=VARCHAR},
  419. </if>
  420. <if test="authentication != null">
  421. #{authentication,jdbcType=INTEGER},
  422. </if>
  423. <if test="level != null">
  424. #{level,jdbcType=INTEGER},
  425. </if>
  426. <if test="integrity != null">
  427. #{integrity,jdbcType=FLOAT}
  428. </if>
  429. </trim>
  430. </insert>
  431. <select id="countByExample" parameterType="com.goafanti.common.model.UserExample" resultType="java.lang.Long">
  432. <!--
  433. WARNING - @mbg.generated
  434. This element is automatically generated by MyBatis Generator, do not modify.
  435. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  436. -->
  437. select count(*) from user
  438. <if test="_parameter != null">
  439. <include refid="Example_Where_Clause" />
  440. </if>
  441. </select>
  442. <update id="updateByExampleSelective" parameterType="map">
  443. <!--
  444. WARNING - @mbg.generated
  445. This element is automatically generated by MyBatis Generator, do not modify.
  446. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  447. -->
  448. update user
  449. <set>
  450. <if test="record.id != null">
  451. id = #{record.id,jdbcType=VARCHAR},
  452. </if>
  453. <if test="record.mobile != null">
  454. mobile = #{record.mobile,jdbcType=VARCHAR},
  455. </if>
  456. <if test="record.password != null">
  457. password = #{record.password,jdbcType=VARCHAR},
  458. </if>
  459. <if test="record.nickname != null">
  460. nickname = #{record.nickname,jdbcType=VARCHAR},
  461. </if>
  462. <if test="record.email != null">
  463. email = #{record.email,jdbcType=VARCHAR},
  464. </if>
  465. <if test="record.createTime != null">
  466. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  467. </if>
  468. <if test="record.number != null">
  469. number = #{record.number,jdbcType=BIGINT},
  470. </if>
  471. <if test="record.lvl != null">
  472. lvl = #{record.lvl,jdbcType=INTEGER},
  473. </if>
  474. <if test="record.type != null">
  475. type = #{record.type,jdbcType=INTEGER},
  476. </if>
  477. <if test="record.mid != null">
  478. mid = #{record.mid,jdbcType=VARCHAR},
  479. </if>
  480. <if test="record.status != null">
  481. status = #{record.status,jdbcType=INTEGER},
  482. </if>
  483. <if test="record.source != null">
  484. source = #{record.source,jdbcType=INTEGER},
  485. </if>
  486. <if test="record.updateTime != null">
  487. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  488. </if>
  489. <if test="record.companyLogoUrl != null">
  490. company_logo_url = #{record.companyLogoUrl,jdbcType=VARCHAR},
  491. </if>
  492. <if test="record.headPortraitUrl != null">
  493. head_portrait_url = #{record.headPortraitUrl,jdbcType=VARCHAR},
  494. </if>
  495. <if test="record.societyTag != null">
  496. society_tag = #{record.societyTag,jdbcType=VARCHAR},
  497. </if>
  498. <if test="record.introduction != null">
  499. introduction = #{record.introduction,jdbcType=VARCHAR},
  500. </if>
  501. <if test="record.valueAddedTag != null">
  502. value_added_tag = #{record.valueAddedTag,jdbcType=VARCHAR},
  503. </if>
  504. <if test="record.organizationId != null">
  505. organization_id = #{record.organizationId,jdbcType=VARCHAR},
  506. </if>
  507. <if test="record.identifyName != null">
  508. identify_name = #{record.identifyName,jdbcType=VARCHAR},
  509. </if>
  510. <if test="record.backgroundUrl != null">
  511. background_url = #{record.backgroundUrl,jdbcType=VARCHAR},
  512. </if>
  513. <if test="record.auditOpinion != null">
  514. audit_opinion = #{record.auditOpinion,jdbcType=VARCHAR},
  515. </if>
  516. <if test="record.auditStatus != null">
  517. audit_status = #{record.auditStatus,jdbcType=INTEGER},
  518. </if>
  519. <if test="record.shareType != null">
  520. share_type = #{record.shareType,jdbcType=INTEGER},
  521. </if>
  522. <if test="record.aid != null">
  523. aid = #{record.aid,jdbcType=VARCHAR},
  524. </if>
  525. <if test="record.transferTime != null">
  526. transfer_time = #{record.transferTime,jdbcType=TIMESTAMP},
  527. </if>
  528. <if test="record.informationMaintainer != null">
  529. information_maintainer = #{record.informationMaintainer,jdbcType=VARCHAR},
  530. </if>
  531. <if test="record.coreTechnology != null">
  532. core_technology = #{record.coreTechnology,jdbcType=VARCHAR},
  533. </if>
  534. <if test="record.accomplishSituation != null">
  535. accomplish_situation = #{record.accomplishSituation,jdbcType=VARCHAR},
  536. </if>
  537. <if test="record.intellectualProperty != null">
  538. intellectual_property = #{record.intellectualProperty,jdbcType=VARCHAR},
  539. </if>
  540. <if test="record.creditRating != null">
  541. credit_rating = #{record.creditRating,jdbcType=INTEGER},
  542. </if>
  543. <if test="record.username != null">
  544. username = #{record.username,jdbcType=VARCHAR},
  545. </if>
  546. <if test="record.authentication != null">
  547. authentication = #{record.authentication,jdbcType=INTEGER},
  548. </if>
  549. <if test="record.level != null">
  550. level = #{record.level,jdbcType=INTEGER},
  551. </if>
  552. </set>
  553. <if test="_parameter != null">
  554. <include refid="Update_By_Example_Where_Clause" />
  555. </if>
  556. </update>
  557. <update id="updateByExample" parameterType="map">
  558. <!--
  559. WARNING - @mbg.generated
  560. This element is automatically generated by MyBatis Generator, do not modify.
  561. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  562. -->
  563. update user
  564. set id = #{record.id,jdbcType=VARCHAR},
  565. mobile = #{record.mobile,jdbcType=VARCHAR},
  566. password = #{record.password,jdbcType=VARCHAR},
  567. nickname = #{record.nickname,jdbcType=VARCHAR},
  568. email = #{record.email,jdbcType=VARCHAR},
  569. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  570. number = #{record.number,jdbcType=BIGINT},
  571. lvl = #{record.lvl,jdbcType=INTEGER},
  572. type = #{record.type,jdbcType=INTEGER},
  573. mid = #{record.mid,jdbcType=VARCHAR},
  574. status = #{record.status,jdbcType=INTEGER},
  575. source = #{record.source,jdbcType=INTEGER},
  576. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  577. company_logo_url = #{record.companyLogoUrl,jdbcType=VARCHAR},
  578. head_portrait_url = #{record.headPortraitUrl,jdbcType=VARCHAR},
  579. society_tag = #{record.societyTag,jdbcType=VARCHAR},
  580. introduction = #{record.introduction,jdbcType=VARCHAR},
  581. value_added_tag = #{record.valueAddedTag,jdbcType=VARCHAR},
  582. organization_id = #{record.organizationId,jdbcType=VARCHAR},
  583. identify_name = #{record.identifyName,jdbcType=VARCHAR},
  584. background_url = #{record.backgroundUrl,jdbcType=VARCHAR},
  585. audit_opinion = #{record.auditOpinion,jdbcType=VARCHAR},
  586. audit_status = #{record.auditStatus,jdbcType=INTEGER},
  587. share_type = #{record.shareType,jdbcType=INTEGER},
  588. aid = #{record.aid,jdbcType=VARCHAR},
  589. transfer_time = #{record.transferTime,jdbcType=TIMESTAMP},
  590. information_maintainer = #{record.informationMaintainer,jdbcType=VARCHAR},
  591. core_technology = #{record.coreTechnology,jdbcType=VARCHAR},
  592. accomplish_situation = #{record.accomplishSituation,jdbcType=VARCHAR},
  593. intellectual_property = #{record.intellectualProperty,jdbcType=VARCHAR},
  594. credit_rating = #{record.creditRating,jdbcType=INTEGER},
  595. username = #{record.username,jdbcType=VARCHAR},
  596. authentication = #{record.authentication,jdbcType=INTEGER},
  597. level = #{record.level,jdbcType=INTEGER},
  598. integrity = #{integrity ,jdbcType=FLOAT}
  599. <if test="_parameter != null">
  600. <include refid="Update_By_Example_Where_Clause" />
  601. </if>
  602. </update>
  603. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.User">
  604. <!--
  605. WARNING - @mbg.generated
  606. This element is automatically generated by MyBatis Generator, do not modify.
  607. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  608. -->
  609. update user
  610. <set>
  611. <if test="mobile != null">
  612. mobile = #{mobile,jdbcType=VARCHAR},
  613. </if>
  614. <if test="password != null">
  615. password = #{password,jdbcType=VARCHAR},
  616. </if>
  617. <if test="nickname != null">
  618. nickname = #{nickname,jdbcType=VARCHAR},
  619. </if>
  620. <if test="email != null">
  621. email = #{email,jdbcType=VARCHAR},
  622. </if>
  623. <if test="createTime != null">
  624. create_time = #{createTime,jdbcType=TIMESTAMP},
  625. </if>
  626. <if test="number != null">
  627. number = #{number,jdbcType=BIGINT},
  628. </if>
  629. <if test="lvl != null">
  630. lvl = #{lvl,jdbcType=INTEGER},
  631. </if>
  632. <if test="type != null">
  633. type = #{type,jdbcType=INTEGER},
  634. </if>
  635. <if test="mid != null">
  636. mid = #{mid,jdbcType=VARCHAR},
  637. </if>
  638. <if test="status != null">
  639. status = #{status,jdbcType=INTEGER},
  640. </if>
  641. <if test="source != null">
  642. source = #{source,jdbcType=INTEGER},
  643. </if>
  644. <if test="updateTime != null">
  645. update_time = #{updateTime,jdbcType=TIMESTAMP},
  646. </if>
  647. <if test="companyLogoUrl != null">
  648. company_logo_url = #{companyLogoUrl,jdbcType=VARCHAR},
  649. </if>
  650. <if test="headPortraitUrl != null">
  651. head_portrait_url = #{headPortraitUrl,jdbcType=VARCHAR},
  652. </if>
  653. <if test="societyTag != null">
  654. society_tag = #{societyTag,jdbcType=VARCHAR},
  655. </if>
  656. <if test="introduction != null">
  657. introduction = #{introduction,jdbcType=VARCHAR},
  658. </if>
  659. <if test="valueAddedTag != null">
  660. value_added_tag = #{valueAddedTag,jdbcType=VARCHAR},
  661. </if>
  662. <if test="organizationId != null">
  663. organization_id = #{organizationId,jdbcType=VARCHAR},
  664. </if>
  665. <if test="identifyName != null">
  666. identify_name = #{identifyName,jdbcType=VARCHAR},
  667. </if>
  668. <if test="backgroundUrl != null">
  669. background_url = #{backgroundUrl,jdbcType=VARCHAR},
  670. </if>
  671. <if test="auditOpinion != null">
  672. audit_opinion = #{auditOpinion,jdbcType=VARCHAR},
  673. </if>
  674. <if test="auditStatus != null">
  675. audit_status = #{auditStatus,jdbcType=INTEGER},
  676. </if>
  677. <if test="shareType != null">
  678. share_type = #{shareType,jdbcType=INTEGER},
  679. </if>
  680. <if test="aid != null">
  681. aid = #{aid,jdbcType=VARCHAR},
  682. </if>
  683. <if test="transferTime != null">
  684. transfer_time = #{transferTime,jdbcType=TIMESTAMP},
  685. </if>
  686. <if test="informationMaintainer != null">
  687. information_maintainer = #{informationMaintainer,jdbcType=VARCHAR},
  688. </if>
  689. <if test="coreTechnology != null">
  690. core_technology = #{coreTechnology,jdbcType=VARCHAR},
  691. </if>
  692. <if test="accomplishSituation != null">
  693. accomplish_situation = #{accomplishSituation,jdbcType=VARCHAR},
  694. </if>
  695. <if test="intellectualProperty != null">
  696. intellectual_property = #{intellectualProperty,jdbcType=VARCHAR},
  697. </if>
  698. <if test="creditRating != null">
  699. credit_rating = #{creditRating,jdbcType=INTEGER},
  700. </if>
  701. <if test="username != null">
  702. username = #{username,jdbcType=VARCHAR},
  703. </if>
  704. <if test="authentication != null">
  705. authentication = #{authentication,jdbcType=INTEGER},
  706. </if>
  707. <if test="level != null">
  708. level = #{level,jdbcType=INTEGER},
  709. </if>
  710. <if test="integrity != null">
  711. integrity = #{integrity ,jdbcType=FLOAT}
  712. </if>
  713. </set>
  714. where id = #{id,jdbcType=VARCHAR}
  715. </update>
  716. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.User">
  717. <!--
  718. WARNING - @mbg.generated
  719. This element is automatically generated by MyBatis Generator, do not modify.
  720. This element was generated on Tue Jun 26 10:23:14 CST 2018.
  721. -->
  722. update user
  723. set mobile = #{mobile,jdbcType=VARCHAR},
  724. password = #{password,jdbcType=VARCHAR},
  725. nickname = #{nickname,jdbcType=VARCHAR},
  726. email = #{email,jdbcType=VARCHAR},
  727. create_time = #{createTime,jdbcType=TIMESTAMP},
  728. number = #{number,jdbcType=BIGINT},
  729. lvl = #{lvl,jdbcType=INTEGER},
  730. type = #{type,jdbcType=INTEGER},
  731. mid = #{mid,jdbcType=VARCHAR},
  732. status = #{status,jdbcType=INTEGER},
  733. source = #{source,jdbcType=INTEGER},
  734. update_time = #{updateTime,jdbcType=TIMESTAMP},
  735. company_logo_url = #{companyLogoUrl,jdbcType=VARCHAR},
  736. head_portrait_url = #{headPortraitUrl,jdbcType=VARCHAR},
  737. society_tag = #{societyTag,jdbcType=VARCHAR},
  738. introduction = #{introduction,jdbcType=VARCHAR},
  739. value_added_tag = #{valueAddedTag,jdbcType=VARCHAR},
  740. organization_id = #{organizationId,jdbcType=VARCHAR},
  741. identify_name = #{identifyName,jdbcType=VARCHAR},
  742. background_url = #{backgroundUrl,jdbcType=VARCHAR},
  743. audit_opinion = #{auditOpinion,jdbcType=VARCHAR},
  744. audit_status = #{auditStatus,jdbcType=INTEGER},
  745. share_type = #{shareType,jdbcType=INTEGER},
  746. aid = #{aid,jdbcType=VARCHAR},
  747. transfer_time = #{transferTime,jdbcType=TIMESTAMP},
  748. information_maintainer = #{informationMaintainer,jdbcType=VARCHAR},
  749. core_technology = #{coreTechnology,jdbcType=VARCHAR},
  750. accomplish_situation = #{accomplishSituation,jdbcType=VARCHAR},
  751. intellectual_property = #{intellectualProperty,jdbcType=VARCHAR},
  752. credit_rating = #{creditRating,jdbcType=INTEGER},
  753. username = #{username,jdbcType=VARCHAR},
  754. authentication = #{authentication,jdbcType=INTEGER},
  755. level = #{level,jdbcType=INTEGER},
  756. integrity = #{integrity ,jdbcType=FLOAT}
  757. where id = #{id,jdbcType=VARCHAR}
  758. </update>
  759. <resultMap id="UserPageHomeBo" type="com.goafanti.user.bo.UserPageHomeBo">
  760. <result column="uid" jdbcType="VARCHAR" property="uid" />
  761. <result column="lvl" jdbcType="INTEGER" property="lvl" />
  762. <result column="nickname" jdbcType="VARCHAR" property="nickname" />
  763. <result column="email" jdbcType="VARCHAR" property="email" />
  764. <result column="number" jdbcType="INTEGER" property="number" />
  765. <result column="type" jdbcType="INTEGER" property="type" />
  766. <result column="person_portrait_url" jdbcType="VARCHAR" property="personPortraitUrl" />
  767. <result column="logo_url" jdbcType="VARCHAR" property="logoUrl" />
  768. <result column="grade_name" jdbcType="VARCHAR" property="gradeName" />
  769. </resultMap>
  770. <resultMap id="UserDownLoadBo" type="com.goafanti.user.bo.UserDownLoadBo">
  771. <id column="id" jdbcType="VARCHAR" property="id" />
  772. <result column="diploma_url" jdbcType="VARCHAR" property="diplomaUrl" />
  773. <result column="degree_diploma_url" jdbcType="VARCHAR" property="degreeDiplomaUrl" />
  774. <result column="professional_certificate_url" jdbcType="VARCHAR" property="professionalCertificateUrl" />
  775. <result column="qualification_certificate_url" jdbcType="VARCHAR" property="qualificationCertificateUrl" />
  776. <result column="positive_id_url" jdbcType="VARCHAR" property="positiveIdUrl" />
  777. <result column="opposite_id_url" jdbcType="VARCHAR" property="oppositeIdUrl" />
  778. </resultMap>
  779. <select id="selectByMobieAndType" resultMap="BaseResultMap">
  780. select
  781. <include refid="Base_Column_List" />
  782. from user
  783. where mobile = #{0} and type=#{1} and source = 0
  784. </select>
  785. <select id="selectUserPageHomeBoByUserId" parameterType="java.lang.String" resultMap="UserPageHomeBo">
  786. select
  787. u.lvl,mg.grade_name , u.nickname, u.email,
  788. u.number, u.type, u.head_portrait_url as person_portrait_url,
  789. u.company_logo_url as logo_url, u.id as uid, adc.achievement_count as achievementNum,
  790. adc.demand_count as demandNum
  791. from user u
  792. LEFT JOIN achievement_demand_count adc on adc.uid = u.id
  793. LEFT JOIN member_grade mg ON mg.member_rank=u.lvl
  794. where u.id = #{uid,jdbcType = VARCHAR}
  795. </select>
  796. <select id="selectUserDownLoadBoByUserId" parameterType="java.lang.String" resultMap="UserDownLoadBo">
  797. select u.id,i.positive_id_url ,i.opposite_id_url,c.professional_certificate_url,c.qualification_certificate_url,
  798. e.diploma_url, e.degree_diploma_url
  799. from user u
  800. LEFT JOIN user_identity i on u.id = i.uid
  801. LEFT JOIN user_career c on u.id = c.uid
  802. LEFT JOIN user_edu e on u.id = e.uid
  803. where u.id =#{id,jdbcType=VARCHAR}
  804. </select>
  805. <select id="findUserListByPage" parameterType="String" resultType="com.goafanti.user.bo.UserListBo">
  806. select
  807. u.id ,
  808. u.mobile,
  809. u.email,
  810. u.create_time as createTime,
  811. u.number ,
  812. i.username,
  813. i.audit_status as auditStatus,
  814. a.name as adminName,
  815. ad.name as managerName
  816. from user u
  817. LEFT JOIN admin a on a.id = u.aid
  818. LEFT JOIN admin ad on ad.id = u.mid
  819. LEFT JOIN user_identity i
  820. ON u.id = i.uid where u.type = 0
  821. <if test="mobile != null">
  822. and u.mobile = #{mobile,jdbcType=VARCHAR}
  823. </if>
  824. <if test="email != null">
  825. and u.email = #{email,jdbcType=VARCHAR}
  826. </if>
  827. <if test="pStart != null">
  828. and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  829. </if>
  830. <if test="pEnd != null">
  831. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  832. </if>
  833. <if test=" number != null">
  834. and u.number = #{number,jdbcType=INTEGER}
  835. </if>
  836. <if test="username != null">
  837. and i.username like CONCAT ('%',#{username,jdbcType=VARCHAR},'%')
  838. </if>
  839. <if test="auditStatus != null">
  840. and i.audit_status= #{auditStatus,jdbcType=INTEGER}
  841. </if>
  842. order by u.number desc
  843. <if test="page_sql!=null">
  844. ${page_sql}
  845. </if>
  846. </select>
  847. <select id="findUserCount" parameterType="String" resultType="java.lang.Integer">
  848. select count(1)
  849. from user u LEFT JOIN user_identity i
  850. ON u.id = i.uid
  851. WHERE u.type = 0
  852. <if test="mobile != null">
  853. and u.mobile = #{mobile,jdbcType=VARCHAR}
  854. </if>
  855. <if test="email != null">
  856. and u.email = #{email,jdbcType=VARCHAR}
  857. </if>
  858. <if test="pStart != null">
  859. and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  860. </if>
  861. <if test="pEnd != null">
  862. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  863. </if>
  864. <if test="number != null">
  865. and u.number = #{number,jdbcType=INTEGER}
  866. </if>
  867. <if test="username != null">
  868. and i.username like CONCAT ('%',#{username,jdbcType=VARCHAR},'%')
  869. </if>
  870. <if test="auditStatus != null">
  871. and i.audit_status= #{auditStatus,jdbcType=INTEGER}
  872. </if>
  873. </select>
  874. <select id="findOrgListByPage" parameterType="String" resultType="com.goafanti.user.bo.OrgListBo">
  875. select u.id ,u.mobile, u.email, u.create_time as createTime,
  876. u.number, o.audit_status as orgAuditStatus, a.name as adminName,
  877. o.unit_name as unitName, ad.name as managerName
  878. from user u
  879. LEFT JOIN admin a on a.id = u.aid
  880. LEFT JOIN admin ad on ad.id = u.mid
  881. LEFT JOIN organization_identity o
  882. ON u.id = o.uid
  883. WHERE u.type = 1
  884. <if test="mobile != null">
  885. and u.mobile = #{mobile,jdbcType=VARCHAR}
  886. </if>
  887. <if test="uid != null">
  888. and u.id = #{uid,jdbcType=VARCHAR}
  889. </if>
  890. <if test="email != null">
  891. and u.email = #{email,jdbcType=VARCHAR}
  892. </if>
  893. <if test="pStart != null">
  894. and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
  895. </if>
  896. <if test="pEnd != null">
  897. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  898. </if>
  899. <if test=" number != null">
  900. and u.number = #{number,jdbcType=INTEGER}
  901. </if>
  902. <if test="unitName != null">
  903. and o.unit_name = #{unitName,jdbcType=VARCHAR}
  904. </if>
  905. <if test="auditStatus != null">
  906. and o.audit_status= #{auditStatus,jdbcType=INTEGER}
  907. </if>
  908. order by u.number desc
  909. <if test="page_sql!=null">
  910. ${page_sql}
  911. </if>
  912. </select>
  913. <select id="findOrgCount" parameterType="String" resultType="java.lang.Integer">
  914. select count(1)
  915. from user u LEFT JOIN organization_identity o
  916. ON u.id = o.uid
  917. WHERE u.type = 1
  918. <if test="uid != null">
  919. and u.id = #{uid,jdbcType=VARCHAR}
  920. </if>
  921. <if test="mobile != null">
  922. and u.mobile = #{mobile,jdbcType=VARCHAR}
  923. </if>
  924. <if test="email != null">
  925. and u.email = #{email,jdbcType=VARCHAR}
  926. </if>
  927. <if test="pStart != null">
  928. and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
  929. </if>
  930. <if test="pEnd != null">
  931. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  932. </if>
  933. <if test=" number != null">
  934. and u.number = #{number,jdbcType=INTEGER}
  935. </if>
  936. <if test="unitName != null">
  937. and o.unit_name = #{unitName,jdbcType=VARCHAR}
  938. </if>
  939. <if test="auditStatus != null">
  940. and o.audit_status= #{auditStatus,jdbcType=INTEGER}
  941. </if>
  942. </select>
  943. <select id="findUserByAidWithParamsListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
  944. select
  945. u.id ,
  946. u.mobile,
  947. u.email,
  948. u.create_time as createTime,
  949. u.number ,
  950. a.name as adminName,
  951. ma.name as managerName,
  952. u.type,
  953. i.username,
  954. i.audit_status as userAuditStatus
  955. from user u
  956. LEFT JOIN admin a on a.id = u.aid
  957. LEFT JOIN admin ma on ma.id = u.mid
  958. LEFT JOIN user_identity i on u.id = i.uid
  959. where u.type = 0
  960. <if test="aid != null">
  961. and u.aid = #{aid,jdbcType=VARCHAR}
  962. </if>
  963. <if test="number !=null">
  964. and u.number = #{number,jdbcType=INTEGER}
  965. </if>
  966. <if test="mobile !=null">
  967. and u.mobile= #{mobile,jdbcType=VARCHAR}
  968. </if>
  969. <if test="auditStatus !=null">
  970. and i.audit_status = #{auditStatus,jdbcType=INTEGER}
  971. </if>
  972. <if test="auditName !=null">
  973. and i.username like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
  974. </if>
  975. <if test="email !=null">
  976. and u.email = #{email,jdbcType=VARCHAR}
  977. </if>
  978. <if test="startCreateTime !=null">
  979. and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
  980. </if>
  981. <if test="endCreateTime !=null">
  982. and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
  983. </if>
  984. order by u.number desc
  985. <if test="page_sql!=null">
  986. ${page_sql}
  987. </if>
  988. </select>
  989. <select id="findUserByAidWithParamsCount" parameterType="String" resultType="java.lang.Integer">
  990. select
  991. count(1)
  992. from user u
  993. LEFT JOIN admin a on a.id = u.aid
  994. LEFT JOIN user_identity i on u.id = i.uid
  995. where u.type = 0
  996. <if test="aid != null">
  997. and u.aid = #{aid,jdbcType=VARCHAR}
  998. </if>
  999. <if test="number !=null">
  1000. and u.number = #{number,jdbcType=INTEGER}
  1001. </if>
  1002. <if test="mobile !=null">
  1003. and u.mobile= #{mobile,jdbcType=VARCHAR}
  1004. </if>
  1005. <if test="auditStatus !=null">
  1006. and i.audit_status = #{auditStatus,jdbcType=INTEGER}
  1007. </if>
  1008. <if test="auditName !=null">
  1009. and i.username like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
  1010. </if>
  1011. <if test="email !=null">
  1012. and u.email = #{email,jdbcType=VARCHAR}
  1013. </if>
  1014. <if test="startCreateTime !=null">
  1015. and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
  1016. </if>
  1017. <if test="endCreateTime !=null">
  1018. and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
  1019. </if>
  1020. </select>
  1021. <select id="findOrgByAidWithParamsListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
  1022. select
  1023. u.id ,
  1024. u.mobile,
  1025. u.email,
  1026. u.create_time as createTime,
  1027. u.number ,
  1028. a.name as adminName,
  1029. ma.name as managerName,
  1030. u.type,
  1031. i.unit_name as unitName,
  1032. i.audit_status as orgAuditStatus
  1033. from user u
  1034. LEFT JOIN admin a on a.id = u.aid
  1035. LEFT JOIN admin ma on ma.id = u.mid
  1036. LEFT JOIN organization_identity i on u.id = i.uid
  1037. where u.type = 1
  1038. <if test="aid != null">
  1039. and u.aid = #{aid,jdbcType=VARCHAR}
  1040. </if>
  1041. <if test="number !=null">
  1042. and u.number = #{number,jdbcType=INTEGER}
  1043. </if>
  1044. <if test="mobile !=null">
  1045. and u.mobile= #{mobile,jdbcType=VARCHAR}
  1046. </if>
  1047. <if test="auditStatus !=null">
  1048. and i.audit_status = #{auditStatus,jdbcType=INTEGER}
  1049. </if>
  1050. <if test="auditName !=null">
  1051. and i.unit_name like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
  1052. </if>
  1053. <if test="email !=null">
  1054. and u.email = #{email,jdbcType=VARCHAR}
  1055. </if>
  1056. <if test="startCreateTime !=null">
  1057. and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
  1058. </if>
  1059. <if test="endCreateTime !=null">
  1060. and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
  1061. </if>
  1062. order by u.number desc
  1063. <if test="page_sql!=null">
  1064. ${page_sql}
  1065. </if>
  1066. </select>
  1067. <select id="findOrgByAidWithParamsCount" parameterType="String" resultType="java.lang.Integer">
  1068. select
  1069. count(1)
  1070. from user u
  1071. LEFT JOIN admin a on a.id = u.aid
  1072. LEFT JOIN organization_identity i on u.id = i.uid
  1073. where u.type = 1
  1074. <if test="aid != null">
  1075. and u.aid = #{aid,jdbcType=VARCHAR}
  1076. </if>
  1077. <if test="number !=null">
  1078. and u.number = #{number,jdbcType=INTEGER}
  1079. </if>
  1080. <if test="mobile !=null">
  1081. and u.mobile= #{mobile,jdbcType=VARCHAR}
  1082. </if>
  1083. <if test="auditStatus !=null">
  1084. and i.audit_status = #{auditStatus,jdbcType=INTEGER}
  1085. </if>
  1086. <if test="auditName !=null">
  1087. and i.unit_name like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
  1088. </if>
  1089. <if test="email !=null">
  1090. and u.email = #{email,jdbcType=VARCHAR}
  1091. </if>
  1092. <if test="startCreateTime !=null">
  1093. and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
  1094. </if>
  1095. <if test="endCreateTime !=null">
  1096. and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
  1097. </if>
  1098. </select>
  1099. <select id="findUserByNameAndMobile" resultType="java.lang.String">
  1100. select
  1101. ui.username
  1102. from user u
  1103. left join user_identity ui on u.id = ui.uid
  1104. where u.lvl &gt; 0 and u.type = 0 and ui.audit_status = 5
  1105. <if test="name != null">
  1106. and ui.username = #{name,jdbcType=VARCHAR}
  1107. </if>
  1108. <if test="mobile != null">
  1109. and u.mobile = #{mobile,jdbcType=VARCHAR}
  1110. </if>
  1111. </select>
  1112. <select id="findOrgByNameAndMobile" resultType="java.lang.String">
  1113. select
  1114. oi.unit_name
  1115. from user u
  1116. left join organization_identity oi on u.id = oi.uid
  1117. where u.lvl &gt; 0 and u.type = 1 and oi.audit_status = 5
  1118. <if test="name != null">
  1119. and oi.unit_name = #{name,jdbcType=VARCHAR}
  1120. </if>
  1121. <if test="mobile != null">
  1122. and u.mobile = #{mobile,jdbcType=VARCHAR}
  1123. </if>
  1124. </select>
  1125. <select id="findAreaManagerUserListByPage" parameterType="String" resultType="com.goafanti.user.bo.UserListBo">
  1126. select
  1127. u.id ,
  1128. u.mobile,
  1129. u.email,
  1130. u.create_time as createTime,
  1131. u.number ,
  1132. i.audit_status as auditStatus,
  1133. i.username,
  1134. a.name as adminName,
  1135. ad.name as managerName
  1136. from user u
  1137. LEFT JOIN admin a on a.id = u.aid
  1138. LEFT JOIN admin ad on ad.id = u.mid
  1139. LEFT JOIN user_identity i on u.id = i.uid
  1140. where u.type = 0
  1141. <if test="mobile != null">
  1142. and u.mobile = #{mobile,jdbcType=VARCHAR}
  1143. </if>
  1144. <if test="email != null">
  1145. and u.email = #{email,jdbcType=VARCHAR}
  1146. </if>
  1147. <if test="pStart != null">
  1148. and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  1149. </if>
  1150. <if test="pEnd != null">
  1151. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  1152. </if>
  1153. <if test=" number != null">
  1154. and u.number = #{number,jdbcType=INTEGER}
  1155. </if>
  1156. <if test="username != null">
  1157. and i.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  1158. </if>
  1159. <if test="auditStatus != null">
  1160. and i.audit_status= #{auditStatus,jdbcType=INTEGER}
  1161. </if>
  1162. <if test="provinceList != null">
  1163. and i.province in
  1164. <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
  1165. #{plist}
  1166. </foreach>
  1167. </if>
  1168. <if test="cityList != null">
  1169. and i.city in
  1170. <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
  1171. #{clist}
  1172. </foreach>
  1173. </if>
  1174. order by u.number desc
  1175. <if test="page_sql!=null">
  1176. ${page_sql}
  1177. </if>
  1178. </select>
  1179. <select id="findAreaManagerUserCount" parameterType="String" resultType="java.lang.Integer">
  1180. select count(1)
  1181. from user u LEFT JOIN user_identity i
  1182. ON u.id = i.uid
  1183. WHERE u.type = 0
  1184. <if test="mobile != null">
  1185. and u.mobile = #{mobile,jdbcType=VARCHAR}
  1186. </if>
  1187. <if test="email != null">
  1188. and u.email = #{email,jdbcType=VARCHAR}
  1189. </if>
  1190. <if test="pStart != null">
  1191. and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  1192. </if>
  1193. <if test="pEnd != null">
  1194. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  1195. </if>
  1196. <if test="number != null">
  1197. and u.number = #{number,jdbcType=INTEGER}
  1198. </if>
  1199. <if test="username != null">
  1200. and i.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  1201. </if>
  1202. <if test="auditStatus != null">
  1203. and i.audit_status= #{auditStatus,jdbcType=INTEGER}
  1204. </if>
  1205. <if test="provinceList != null">
  1206. and i.province in
  1207. <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
  1208. #{plist}
  1209. </foreach>
  1210. </if>
  1211. <if test="cityList != null">
  1212. and i.city in
  1213. <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
  1214. #{clist}
  1215. </foreach>
  1216. </if>
  1217. </select>
  1218. <select id="findAreaManagerOrgListByPage" parameterType="String" resultType="com.goafanti.user.bo.OrgListBo">
  1219. select
  1220. u.id ,
  1221. u.mobile,
  1222. u.email,
  1223. u.create_time as createTime,
  1224. u.number ,
  1225. o.audit_status as orgAuditStatus,
  1226. a.name as adminName,
  1227. o.unit_name as unitName,
  1228. ad.name as managerName
  1229. from user u
  1230. LEFT JOIN admin a on a.id = u.aid
  1231. LEFT JOIN admin ad on ad.id = u.mid
  1232. LEFT JOIN organization_identity o on u.id = o.uid
  1233. WHERE u.type = 1
  1234. <if test="mobile != null">
  1235. and u.mobile = #{mobile,jdbcType=VARCHAR}
  1236. </if>
  1237. <if test="uid != null">
  1238. and u.id = #{uid,jdbcType=VARCHAR}
  1239. </if>
  1240. <if test="email != null">
  1241. and u.email = #{email,jdbcType=VARCHAR}
  1242. </if>
  1243. <if test="pStart != null">
  1244. and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
  1245. </if>
  1246. <if test="pEnd != null">
  1247. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  1248. </if>
  1249. <if test=" number != null">
  1250. and u.number = #{number,jdbcType=INTEGER}
  1251. </if>
  1252. <if test="unitName != null">
  1253. and o.unit_name like '%'#{unitName,jdbcType=VARCHAR}'%'
  1254. </if>
  1255. <if test="auditStatus != null">
  1256. and o.audit_status= #{auditStatus,jdbcType=INTEGER}
  1257. </if>
  1258. <if test="provinceList != null">
  1259. and o.licence_province in
  1260. <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
  1261. #{plist}
  1262. </foreach>
  1263. </if>
  1264. <if test="cityList != null">
  1265. and o.licence_city in
  1266. <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
  1267. #{clist}
  1268. </foreach>
  1269. </if>
  1270. order by u.number desc
  1271. <if test="page_sql!=null">
  1272. ${page_sql}
  1273. </if>
  1274. </select>
  1275. <select id="findAreaManagerOrgCount" parameterType="String" resultType="java.lang.Integer">
  1276. select count(1)
  1277. from user u LEFT JOIN organization_identity o
  1278. ON u.id = o.uid
  1279. WHERE u.type = 1
  1280. <if test="uid != null">
  1281. and u.id = #{uid,jdbcType=VARCHAR}
  1282. </if>
  1283. <if test="mobile != null">
  1284. and u.mobile = #{mobile,jdbcType=VARCHAR}
  1285. </if>
  1286. <if test="email != null">
  1287. and u.email = #{email,jdbcType=VARCHAR}
  1288. </if>
  1289. <if test="pStart != null">
  1290. and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
  1291. </if>
  1292. <if test="pEnd != null">
  1293. and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  1294. </if>
  1295. <if test=" number != null">
  1296. and u.number = #{number,jdbcType=INTEGER}
  1297. </if>
  1298. <if test="unitName != null">
  1299. and o.unit_name like '%'#{unitName,jdbcType=VARCHAR}'%'
  1300. </if>
  1301. <if test="auditStatus != null">
  1302. and o.audit_status= #{auditStatus,jdbcType=INTEGER}
  1303. </if>
  1304. <if test="provinceList != null">
  1305. and i.province in
  1306. <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
  1307. #{plist}
  1308. </foreach>
  1309. </if>
  1310. <if test="cityList != null">
  1311. and i.city in
  1312. <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
  1313. #{clist}
  1314. </foreach>
  1315. </if>
  1316. </select>
  1317. <select id="findUserPartnerDetail" parameterType="java.lang.String" resultType="com.goafanti.user.bo.UserPartnerDetailBo">
  1318. select
  1319. u.id,i.username,i.work_unit as workUnit,i.professional_title as position,u.introduction as achievement,
  1320. u.head_portrait_url as personPortraitUrl,
  1321. i.province,
  1322. u.introduction as personalProfile,
  1323. ua.ability_label as abilityLabel,i.qualification,
  1324. i.graduate_school,i.major_category,i.work_unit as workUnit,
  1325. ic.name as engagedField
  1326. from `user` u
  1327. left join user_identity i on u.id=i.uid
  1328. left join
  1329. user_career c on u.id=c.uid
  1330. <!-- left join user_info info on u.id=info.uid -->
  1331. left join user_ability ua on u.id=ua.uid
  1332. left join user_edu e on u.id=e.uid
  1333. left join industry_category ic on i.industry=ic.id
  1334. WHERE
  1335. u.type = 0
  1336. <if test="_parameter!= null">
  1337. and u.id= #{_parameter,jdbcType=VARCHAR}
  1338. </if>
  1339. </select>
  1340. <select id="findOrgPartnerDetail" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgPartnerDetailBo">
  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,u.introduction as personalProfile,
  1345. ua.ability_label as abilityLabel
  1346. from `user` u
  1347. left join user_identity i on u.id=i.uid
  1348. left join
  1349. user_career c on u.id=c.uid
  1350. <!-- left join user_info info on u.id=info.uid -->
  1351. left join user_ability ua on u.id=ua.uid
  1352. WHERE
  1353. u.type = 1
  1354. <if test="_parameter!= null">
  1355. and u.id= #{_parameter,jdbcType=VARCHAR}
  1356. </if>
  1357. </select>
  1358. <select id="findStarListByPage" parameterType="String" resultType="com.goafanti.user.bo.StarListBo">
  1359. select
  1360. u.id as uid,
  1361. u.number,
  1362. ui.username,
  1363. uc.engaged_field as engagedField,
  1364. uc.professional_title as professionalTitle,
  1365. uc.work_unit as workUnit,
  1366. adc.achievement_count as achievementNum
  1367. from user u
  1368. left join user_identity ui on ui.uid = u.id
  1369. left join user_career uc on uc.uid = u.id
  1370. left join achievement_demand_count adc on adc.uid = u.id
  1371. where
  1372. ui.celebrity = 1
  1373. <if test="number != null">
  1374. and u.number = #{number,jdbcType=INTEGER}
  1375. </if>
  1376. <if test="engagedField != null">
  1377. and uc.engaged_field like CONCAT(#{engagedField,jdbcType=VARCHAR},'%')
  1378. </if>
  1379. <if test="username != null">
  1380. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  1381. </if>
  1382. <if test="professionalTitle != null">
  1383. and uc.professional_title like CONCAT('%',#{professionalTitle,jdbcType=VARCHAR},'%')
  1384. </if>
  1385. <if test="workUnit != null">
  1386. and uc.work_unit like CONCAT('%',#{workUnit,jdbcType=VARCHAR},'%')
  1387. </if>
  1388. ORDER BY adc.achievement_count DESC
  1389. <if test="page_sql!=null">
  1390. ${page_sql}
  1391. </if>
  1392. </select>
  1393. <select id="findStarCount" parameterType="String" resultType="java.lang.Integer">
  1394. select
  1395. count(1)
  1396. from user u
  1397. left join user_identity ui on ui.uid = u.id
  1398. left join user_career uc on uc.uid = u.id
  1399. where
  1400. ui.celebrity = 1
  1401. <if test="number != null">
  1402. and u.number = #{number,jdbcType=INTEGER}
  1403. </if>
  1404. <if test="engagedField != null">
  1405. and uc.engaged_field like CONCAT(#{engagedField,jdbcType=VARCHAR},'%')
  1406. </if>
  1407. <if test="username != null">
  1408. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  1409. </if>
  1410. <if test="professionalTitle != null">
  1411. and uc.professional_title like CONCAT('%',#{professionalTitle,jdbcType=VARCHAR},'%')
  1412. </if>
  1413. <if test="workUnit != null">
  1414. and uc.work_unit like CONCAT('%',#{workUnit,jdbcType=VARCHAR},'%')
  1415. </if>
  1416. </select>
  1417. <select id="findStarAndExpertListByPage" parameterType="String" resultType="com.goafanti.user.bo.StarAndExpertListBo">
  1418. select
  1419. u.id as uid,
  1420. u.number,
  1421. ui.username,
  1422. uc.engaged_field as engagedField,
  1423. uc.professional_title as professionalTitle,
  1424. uc.work_unit as workUnit,
  1425. adc.achievement_count as achievementNum
  1426. from user u
  1427. left join user_identity ui on ui.uid = u.id
  1428. left join user_career uc on uc.uid = u.id
  1429. left join achievement_demand_count adc on adc.uid = u.id
  1430. where
  1431. (ui.celebrity = 1 or ui.expert = 1)
  1432. <if test="number != null">
  1433. and u.number = #{number,jdbcType=INTEGER}
  1434. </if>
  1435. <if test="engagedField != null">
  1436. and uc.engaged_field like CONCAT(#{engagedField,jdbcType=VARCHAR},'%')
  1437. </if>
  1438. <if test="username != null">
  1439. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  1440. </if>
  1441. <if test="professionalTitle != null">
  1442. and uc.professional_title like CONCAT('%',#{professionalTitle,jdbcType=VARCHAR},'%')
  1443. </if>
  1444. <if test="workUnit != null">
  1445. and uc.work_unit like CONCAT('%',#{workUnit,jdbcType=VARCHAR},'%')
  1446. </if>
  1447. ORDER BY adc.achievement_count DESC
  1448. <if test="page_sql!=null">
  1449. ${page_sql}
  1450. </if>
  1451. </select>
  1452. <select id="findStarAndExpertCount" parameterType="String" resultType="java.lang.Integer">
  1453. select
  1454. count(1)
  1455. from user u
  1456. left join user_identity ui on ui.uid = u.id
  1457. left join user_career uc on uc.uid = u.id
  1458. where
  1459. (ui.celebrity = 1 or ui.expert = 1)
  1460. <if test="number != null">
  1461. and u.number = #{number,jdbcType=INTEGER}
  1462. </if>
  1463. <if test="engagedField != null">
  1464. and uc.engaged_field like CONCAT(#{engagedField,jdbcType=VARCHAR},'%')
  1465. </if>
  1466. <if test="username != null">
  1467. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  1468. </if>
  1469. <if test="professionalTitle != null">
  1470. and uc.professional_title like CONCAT('%',#{professionalTitle,jdbcType=VARCHAR},'%')
  1471. </if>
  1472. <if test="workUnit != null">
  1473. and uc.work_unit like CONCAT('%',#{workUnit,jdbcType=VARCHAR},'%')
  1474. </if>
  1475. </select>
  1476. <select id="selectNumberByPrimaryKey" parameterType="String" resultType="java.lang.Long">
  1477. select number
  1478. from user
  1479. where id = #{id,jdbcType=VARCHAR}
  1480. </select>
  1481. <select id="findUserPartner" parameterType="String" resultType="com.goafanti.user.bo.UserPartnerDetailBo">
  1482. select
  1483. u.id,i.username,c.work_unit as work_unit,c.position,c.achievement,
  1484. u.head_portrait_url as personPortraitUrl,
  1485. i.province,
  1486. u.introduction as personalProfile,
  1487. ua.ability_label as abilityLabel,i.uid,u.type
  1488. from `user` u
  1489. left join user_identity i on u.id=i.uid
  1490. left join
  1491. user_career c on u.id=c.uid
  1492. <!-- left join user_info info on u.id=info.uid -->
  1493. left join user_ability ua on u.id=ua.uid
  1494. WHERE
  1495. u.type = 0
  1496. limit 0,50
  1497. </select>
  1498. <select id="checkUser" resultMap="BaseResultMap">
  1499. select
  1500. id
  1501. from
  1502. user
  1503. where status <![CDATA[!= ]]> 1
  1504. <if test="id != null and id != ''">
  1505. and id = #{id,jdbcType=VARCHAR}
  1506. </if>
  1507. <if test="identifyName != null and identifyName != ''">
  1508. and identify_name = #{identifyName,jdbcType=VARCHAR}
  1509. </if>
  1510. <if test="mobile != null and mobile !=''">
  1511. and mobile = #{mobile,jdbcType=VARCHAR}
  1512. </if>
  1513. <if test="type != null">
  1514. and type = #{type,jdbcType=INTEGER}
  1515. </if>
  1516. <if test="source != null">
  1517. and source = #{source,jdbcType=INTEGER}
  1518. </if>
  1519. <if test="nickname != null and nickname != ''">
  1520. and nickname = #{nickname,jdbcType=INTEGER}
  1521. </if>
  1522. </select>
  1523. <select id="userInterest" resultType="com.goafanti.user.bo.UserInterestBo">
  1524. select
  1525. t.to_uid as id,y.username as name,y.work_unit as workUnit,y.professional_title as professionalTitle,t.create_time as createTime
  1526. from user_interest t
  1527. LEFT join user_identity y on t.to_uid=y.uid
  1528. LEFT join user u on t.to_uid=u.id
  1529. where t.from_uid=#{uid,jdbcType=VARCHAR}
  1530. </select>
  1531. <select id="selectBaseInfo" parameterType="java.lang.String" resultType="com.goafanti.app.bo.UserBasicInfo">
  1532. select
  1533. a.id,
  1534. a.mobile,
  1535. a.nickname,
  1536. a.email,
  1537. a.number,
  1538. a.type,
  1539. a.company_logo_url as companyLogoUrl,
  1540. a.head_portrait_url as headPortraitUrl,
  1541. a.introduction,
  1542. b.registration_id as registrationId,
  1543. b.easemob_name as easemobName,
  1544. b.easemob_pass as easemobPass
  1545. from user a left join jpush_easemob_account b
  1546. on a.id = b.uid
  1547. where
  1548. a.id = #{id,jdbcType=VARCHAR}
  1549. </select>
  1550. <select id="selectByNumber" parameterType="java.lang.String" resultMap="BaseResultMap">
  1551. select nickname,head_portrait_url from user where number = #{easemobName,jdbcType=VARCHAR}
  1552. </select>
  1553. <update id="updateEnteringAudit" parameterType="com.goafanti.common.model.User">
  1554. update user
  1555. <set>
  1556. <if test="auditStatus != null">
  1557. audit_status = #{auditStatus,jdbcType=INTEGER},
  1558. </if>
  1559. <if test="auditOpinion != null">
  1560. audit_opinion = #{auditOpinion,jdbcType=VARCHAR},
  1561. </if>
  1562. </set>
  1563. where id = #{id,jdbcType=VARCHAR}
  1564. </update>
  1565. <select id="selectUserByRoleName" parameterType="java.lang.String" resultMap="BaseResultMap">
  1566. select c.id from role a left join user_role b on a.id = b.rid left join admin c on b.uid = c.id where a.role_name in(#{roleName1},#{roleName2})
  1567. </select>
  1568. <update id="updateDimissionTransfer">
  1569. update user
  1570. set aid=#{transferId,jdbcType=VARCHAR},
  1571. information_maintainer=#{transferId,jdbcType=VARCHAR},
  1572. source=3
  1573. where aid=#{aid,jdbcType=VARCHAR}
  1574. </update>
  1575. <select id="getAidAndUser" resultType="java.lang.Integer">
  1576. select count(*) from `user`
  1577. where aid=#{aid,jdbcType=VARCHAR} and id=#{uid,jdbcType=VARCHAR}
  1578. </select>
  1579. <update id="pushUserGuidance">
  1580. update user set guidance=#{guidance} where id=#{id}
  1581. </update>
  1582. <update id="updateList">
  1583. update user
  1584. <set>
  1585. <if test="source != null">
  1586. source = #{source,jdbcType=INTEGER},
  1587. </if>
  1588. <if test="level != null">
  1589. level= #{level,jdbcType=INTEGER},
  1590. </if>
  1591. <if test="aid != null">
  1592. aid = #{aid,jdbcType=VARCHAR},
  1593. </if>
  1594. <if test="data ==1">
  1595. information_maintainer = #{aid,jdbcType=VARCHAR},
  1596. </if>
  1597. <if test="transferTime != null">
  1598. transfer_time = #{transferTime,jdbcType=TIMESTAMP},
  1599. </if>
  1600. <if test="shareType != null">
  1601. share_type = #{shareType,jdbcType=VARCHAR}
  1602. </if>
  1603. </set>
  1604. where id in
  1605. <foreach item="item" collection="list" separator="," open="(" close=")" index="">
  1606. #{item}
  1607. </foreach>
  1608. </update>
  1609. <select id="selectByName" parameterType="java.lang.String" resultMap="BaseResultMap">
  1610. select
  1611. <include refid="Base_Column_List" />
  1612. from user
  1613. where nickname = #{name} limit 1
  1614. </select>
  1615. <select id="selectPrivateOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
  1616. select a.id uid,a.aid,a.nickname name,a.society_tag societyTag,a.`level`,b.name aName,dg1.name as province,dg2.name as city,
  1617. a.guidance, dg3.name as area,d.intended_project intendedProject,d.business_scope businessScope,
  1618. date_format(um.last_sign_time,'%Y-%m-%d %H:%i:%S') lastSignTime,
  1619. date_format(a.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime,
  1620. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  1621. date_format(um.last_follow_time,'%Y-%m-%d %H:%i:%S') lastFollowTime,
  1622. if(a.transfer_time &lt; um.last_follow_time,um.last_follow_time,a.transfer_time) as orderTime
  1623. from user a left join admin b on a.aid=b.id left join organization_identity d on a.id = d.uid
  1624. left join district_glossory dg1 on d.location_province = dg1.id
  1625. left join district_glossory dg2 on d.location_city = dg2.id
  1626. left join district_glossory dg3 on d.location_area = dg3.id
  1627. left join user_mid um on um.aid=a.aid and um.uid=a.id
  1628. where a.type= 1 and a.source in(1,2,3) and a.share_type = 0
  1629. <if test="power ==0">
  1630. and a.aid = #{aid,jdbcType=VARCHAR}
  1631. </if>
  1632. <if test="power ==1 or power ==2">
  1633. and a.aid
  1634. <if test="alist != null">
  1635. in
  1636. <foreach item="item" collection="alist" separator="," open="(" close=")" index="">
  1637. #{item}
  1638. </foreach>
  1639. </if>
  1640. <if test="alist == null">
  1641. is null
  1642. </if>
  1643. </if>
  1644. <if test="name != null and name != ''">
  1645. and a.nickname like concat('%',#{name},'%')
  1646. </if>
  1647. <if test="startDate != null and startDate != ''">
  1648. and a.transfer_time &gt; #{startDate}
  1649. </if>
  1650. <if test="endDate != null and endDate != ''">
  1651. and a.transfer_time &lt; #{endDate}
  1652. </if>
  1653. <if test="province != null">
  1654. and d.location_province = #{province,jdbcType=INTEGER}
  1655. </if>
  1656. <if test="city != null">
  1657. and d.location_city = #{city,jdbcType=INTEGER}
  1658. </if>
  1659. <if test="area != null">
  1660. and d.location_area = #{area,jdbcType=INTEGER}
  1661. </if>
  1662. <if test="level != null">
  1663. and a.level = #{level,jdbcType=INTEGER}
  1664. </if>
  1665. <if test="sort != 1">
  1666. order by orderTime
  1667. </if>
  1668. <if test="sort == 1">
  1669. order by a.create_time
  1670. </if>
  1671. <if test="sortType == 1">
  1672. desc
  1673. </if>
  1674. ,a.transfer_time desc
  1675. <if test="page_sql != null">
  1676. ${page_sql}
  1677. </if>
  1678. </select>
  1679. <select id="selectPrivateOrganizationCustomerCount" resultType="java.lang.Integer">
  1680. select count(*)
  1681. from user a left join admin b on a.aid=b.id left join organization_identity d on a.id = d.uid
  1682. left join district_glossory dg1 on d.location_province = dg1.id
  1683. left join district_glossory dg2 on d.location_city = dg2.id
  1684. left join district_glossory dg3 on d.location_area = dg3.id
  1685. left join user_mid um on um.aid=a.aid and um.uid=a.id
  1686. /*inner join (select aid,uid from user_follow uf group by aid,uid) t0
  1687. on a.id=t0.uid and a.aid =t0.aid*/
  1688. where a.type= 1 and a.source in(1,2,3) and a.share_type = 0
  1689. <if test="power ==0">
  1690. and a.aid = #{aid,jdbcType=VARCHAR}
  1691. </if>
  1692. <if test="power ==1 or power ==2">
  1693. and a.aid
  1694. <if test="alist != null">
  1695. in
  1696. <foreach item="item" collection="alist" separator="," open="(" close=")" index="">
  1697. #{item}
  1698. </foreach>
  1699. </if>
  1700. <if test="alist == null">
  1701. is null
  1702. </if>
  1703. </if>
  1704. <if test="name != null and name != ''">
  1705. and a.nickname like concat('%',#{name},'%')
  1706. </if>
  1707. <if test="startDate != null and startDate != ''">
  1708. and a.transfer_time &gt; #{startDate}
  1709. </if>
  1710. <if test="endDate != null and endDate != ''">
  1711. and a.transfer_time &lt; #{endDate}
  1712. </if>
  1713. <if test="province != null">
  1714. and d.location_province = #{province,jdbcType=INTEGER}
  1715. </if>
  1716. <if test="city != null">
  1717. and d.location_city = #{city,jdbcType=INTEGER}
  1718. </if>
  1719. <if test="area != null">
  1720. and d.location_area = #{area,jdbcType=INTEGER}
  1721. </if>
  1722. <if test="level != null">
  1723. and a.level = #{level,jdbcType=INTEGER}
  1724. </if>
  1725. </select>
  1726. <select id="findMainProductsList" resultType="com.goafanti.customer.bo.OutUserMianProducts">
  1727. select oi.id ,u.id uid, u.nickname userName, oi.business_scope businessScope,
  1728. um.update_name updateName,um.update_aid updateAid,u.share_type shareType,
  1729. <if test="shiroType ==2">
  1730. a.name adminName,d.name depName,dg.name province,
  1731. </if>
  1732. date_format(u.transfer_time ,'%Y-%m-%d %H:%i:%s')transferTimes,
  1733. date_format(um.date_update_time,'%Y-%m-%d %H:%i:%s')dateUpdateTimes
  1734. from `user` u
  1735. <if test="shiroType==0">
  1736. inner join (select b.buyer_id from t_order_task a left join t_order_new b
  1737. on a.order_no = b.order_no where a.main = 1 and a.split_status in (0, 1)
  1738. and a.task_receiver = #{aid} group by b.buyer_id) t0 on t0.buyer_id = u.id
  1739. </if>
  1740. left join organization_identity oi on u.id = oi.uid left join user_mid um on u.id=um.uid
  1741. <if test="shiroType==2">
  1742. left join admin a on u.aid=a.id left join department d on a.department_id =d.id
  1743. left join district_glossory dg on oi.location_province =dg.id
  1744. </if>
  1745. where u.`type` =1 and u.status=0
  1746. <if test="shiroType==1">
  1747. and u.information_maintainer = #{aid}
  1748. </if>
  1749. <if test="shiroType==2">
  1750. <if test="adminName !=null">
  1751. and a.name like concat('%', #{adminName},'%')
  1752. </if>
  1753. <if test="depId !=null">
  1754. and d.id= #{depId}
  1755. </if>
  1756. </if>
  1757. <if test="shareType !=null">
  1758. and u.share_type = #{shareType}
  1759. </if>
  1760. <if test="userName != null">
  1761. and u.nickname like concat('%',#{userName},'%')
  1762. </if>
  1763. <if test="key !=null">
  1764. and oi.business_scope like concat('%',#{key},'%')
  1765. </if>
  1766. <if test="startTime !=null and endTime !=null">
  1767. and u.transfer_time between #{startTime} and #{endTime}
  1768. </if>
  1769. <if test="page_sql != null">
  1770. ${page_sql}
  1771. </if>
  1772. </select>
  1773. <select id="findMainProductsCount" resultType="java.lang.Integer">
  1774. select count(*) from `user` u
  1775. <if test="shiroType==0">
  1776. inner join (select b.buyer_id from t_order_task a left join t_order_new b
  1777. on a.order_no = b.order_no where a.main = 1 and a.split_status in (0, 1)
  1778. and a.task_receiver = #{aid} group by b.buyer_id) t0 on t0.buyer_id = u.id
  1779. </if>
  1780. left join organization_identity oi on u.id = oi.uid
  1781. <if test="shiroType==2">
  1782. <if test="adminName !=null or depId !=null">
  1783. left join admin a on u.aid=a.id left join department d on a.department_id =d.id
  1784. </if>
  1785. </if>
  1786. where u.`type` =1 and u.status=0
  1787. <if test="shiroType==1">
  1788. and u.information_maintainer = #{aid}
  1789. </if>
  1790. <if test="shiroType==2">
  1791. <if test="adminName !=null">
  1792. and a.name like concat('%', #{adminName},'%')
  1793. </if>
  1794. <if test="depId !=null">
  1795. and d.id= #{depId}
  1796. </if>
  1797. </if>
  1798. <if test="shareType !=null">
  1799. and u.share_type = #{shareType}
  1800. </if>
  1801. <if test="userName != null">
  1802. and u.nickname like concat('%',#{userName},'%')
  1803. </if>
  1804. <if test="key !=null">
  1805. and oi.business_scope like concat('%',#{key},'%')
  1806. </if>
  1807. <if test="startTime !=null and endTime !=null">
  1808. and u.transfer_time between #{startTime} and #{endTime}
  1809. </if>
  1810. </select>
  1811. </mapper>