UserMapper.xml 82 KB

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