UserMapper.xml 63 KB

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