| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.goafanti.common.dao.UserMapper">
- <resultMap type="com.goafanti.common.model.User" id="UserMap">
- <result property="id" column="id" jdbcType="VARCHAR"/>
- <result property="mobile" column="mobile" jdbcType="VARCHAR"/>
- <result property="password" column="password" jdbcType="VARCHAR"/>
- <result property="nickname" column="nickname" jdbcType="VARCHAR"/>
- <result property="email" column="email" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="number" column="number" jdbcType="INTEGER"/>
- <result property="lvl" column="lvl" jdbcType="INTEGER"/>
- <result property="type" column="type" jdbcType="INTEGER"/>
- <result property="aid" column="aid" jdbcType="VARCHAR"/>
- <result property="mid" column="mid" jdbcType="VARCHAR"/>
- <result property="status" column="status" jdbcType="INTEGER"/>
- <result property="source" column="source" jdbcType="INTEGER"/>
- <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
- <result property="companyLogoUrl" column="company_logo_url" jdbcType="VARCHAR"/>
- <result property="headPortraitUrl" column="head_portrait_url" jdbcType="VARCHAR"/>
- <result property="societyTag" column="society_tag" jdbcType="VARCHAR"/>
- <result property="introduction" column="introduction" jdbcType="VARCHAR"/>
- <result property="valueAddedTag" column="value_added_tag" jdbcType="VARCHAR"/>
- <result property="organizationId" column="organization_id" jdbcType="VARCHAR"/>
- <result property="shareType" column="share_type" jdbcType="INTEGER"/>
- <result property="identifyName" column="identify_name" jdbcType="VARCHAR"/>
- <result property="backgroundUrl" column="background_url" jdbcType="VARCHAR"/>
- <result property="auditStatus" column="audit_status" jdbcType="INTEGER"/>
- <result property="auditOpinion" column="audit_opinion" jdbcType="VARCHAR"/>
- <result property="transferTime" column="transfer_time" jdbcType="TIMESTAMP"/>
- <result property="informationMaintainer" column="information_maintainer" jdbcType="VARCHAR"/>
- <result property="coreTechnology" column="core_technology" jdbcType="VARCHAR"/>
- <result property="accomplishSituation" column="accomplish_situation" jdbcType="VARCHAR"/>
- <result property="intellectualProperty" column="intellectual_property" jdbcType="VARCHAR"/>
- <result property="creditRating" column="credit_rating" jdbcType="INTEGER"/>
- <result property="level" column="level" jdbcType="INTEGER"/>
- <result property="authentication" column="authentication" jdbcType="INTEGER"/>
- <result property="username" column="username" jdbcType="VARCHAR"/>
- <result property="integrity" column="integrity" jdbcType="NUMERIC"/>
- <result property="toInviteCode" column="to_invite_code" jdbcType="VARCHAR"/>
- <result property="beInviteCode" column="be_invite_code" jdbcType="VARCHAR"/>
- <result property="guidance" column="guidance" jdbcType="INTEGER"/>
- <result property="signBills" column="sign_bills" jdbcType="INTEGER"/>
- <result property="channel" column="channel" jdbcType="INTEGER"/>
- <result property="newChannel" column="new_channel" jdbcType="INTEGER"/>
- <result property="signTime" column="sign_time" jdbcType="TIMESTAMP"/>
- <result property="callStatus" column="call_status" jdbcType="INTEGER"/>
- <result property="clueStatus" column="clue_status" jdbcType="INTEGER"/>
- <result property="clueProcess" column="clue_process" jdbcType="INTEGER"/>
- <result property="clueTime" column="clue_time" jdbcType="TIMESTAMP"/>
- <result property="clueAid" column="clue_aid" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="UserAllSql">
- 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
- </sql>
- <!--查询单个-->
- <select id="queryById" resultMap="UserMap">
- select
- <include refid="UserAllSql"/>
- from user
- where id = #{id}
- </select>
- <!--新增所有列-->
- <insert id="insert" keyProperty="id" useGeneratedKeys="true">
- 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)
- 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})
- </insert>
- <!--通过主键修改数据-->
- <update id="update">
- update user
- <set>
- <if test="mobile != null and mobile != ''">
- mobile = #{mobile},
- </if>
- <if test="password != null and password != ''">
- password = #{password},
- </if>
- <if test="nickname != null and nickname != ''">
- nickname = #{nickname},
- </if>
- <if test="email != null and email != ''">
- email = #{email},
- </if>
- <if test="createTime != null">
- create_time = #{createTime},
- </if>
- <if test="number != null">
- number = #{number},
- </if>
- <if test="lvl != null">
- lvl = #{lvl},
- </if>
- <if test="type != null">
- type = #{type},
- </if>
- <if test="aid != null and aid != ''">
- aid = #{aid},
- </if>
- <if test="mid != null and mid != ''">
- mid = #{mid},
- </if>
- <if test="status != null">
- status = #{status},
- </if>
- <if test="source != null">
- source = #{source},
- </if>
- <if test="updateTime != null">
- update_time = #{updateTime},
- </if>
- <if test="companyLogoUrl != null and companyLogoUrl != ''">
- company_logo_url = #{companyLogoUrl},
- </if>
- <if test="headPortraitUrl != null and headPortraitUrl != ''">
- head_portrait_url = #{headPortraitUrl},
- </if>
- <if test="societyTag != null and societyTag != ''">
- society_tag = #{societyTag},
- </if>
- <if test="introduction != null and introduction != ''">
- introduction = #{introduction},
- </if>
- <if test="valueAddedTag != null and valueAddedTag != ''">
- value_added_tag = #{valueAddedTag},
- </if>
- <if test="organizationId != null and organizationId != ''">
- organization_id = #{organizationId},
- </if>
- <if test="shareType != null">
- share_type = #{shareType},
- </if>
- <if test="identifyName != null and identifyName != ''">
- identify_name = #{identifyName},
- </if>
- <if test="backgroundUrl != null and backgroundUrl != ''">
- background_url = #{backgroundUrl},
- </if>
- <if test="auditStatus != null">
- audit_status = #{auditStatus},
- </if>
- <if test="auditOpinion != null and auditOpinion != ''">
- audit_opinion = #{auditOpinion},
- </if>
- <if test="transferTime != null">
- transfer_time = #{transferTime},
- </if>
- <if test="informationMaintainer != null and informationMaintainer != ''">
- information_maintainer = #{informationMaintainer},
- </if>
- <if test="coreTechnology != null and coreTechnology != ''">
- core_technology = #{coreTechnology},
- </if>
- <if test="accomplishSituation != null and accomplishSituation != ''">
- accomplish_situation = #{accomplishSituation},
- </if>
- <if test="intellectualProperty != null and intellectualProperty != ''">
- intellectual_property = #{intellectualProperty},
- </if>
- <if test="creditRating != null">
- credit_rating = #{creditRating},
- </if>
- <if test="level != null">
- level = #{level},
- </if>
- <if test="authentication != null">
- authentication = #{authentication},
- </if>
- <if test="username != null and username != ''">
- username = #{username},
- </if>
- <if test="integrity != null">
- integrity = #{integrity},
- </if>
- <if test="toInviteCode != null and toInviteCode != ''">
- to_invite_code = #{toInviteCode},
- </if>
- <if test="beInviteCode != null and beInviteCode != ''">
- be_invite_code = #{beInviteCode},
- </if>
- <if test="guidance != null">
- guidance = #{guidance},
- </if>
- <if test="signBills != null">
- sign_bills = #{signBills},
- </if>
- <if test="channel != null">
- channel = #{channel},
- </if>
- <if test="newChannel != null">
- new_channel = #{newChannel},
- </if>
- <if test="signTime != null">
- sign_time = #{signTime},
- </if>
- <if test="callStatus != null">
- call_status = #{callStatus},
- </if>
- <if test="clueStatus != null">
- clue_status = #{clueStatus},
- </if>
- <if test="clueProcess != null">
- clue_process = #{clueProcess},
- </if>
- <if test="clueTime != null">
- clue_time = #{clueTime},
- </if>
- <if test="clueAid != null">
- clue_aid = #{clueAid},
- </if>
- </set>
- where id = #{id}
- </update>
- <!--通过主键删除-->
- <delete id="deleteById">
- delete
- from user
- where id = #{id}
- </delete>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.User">
- insert into user
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="mobile != null">mobile,</if>
- <if test="password != null">password,</if>
- <if test="nickname != null">nickname,</if>
- <if test="email != null">email,</if>
- <if test="createTime != null">create_time,</if>
- <if test="number != null">number,</if>
- <if test="lvl != null">lvl,</if>
- <if test="type != null">type,</if>
- <if test="aid != null">aid,</if>
- <if test="mid != null">mid,</if>
- <if test="status != null">status,</if>
- <if test="source != null">source,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="companyLogoUrl != null">company_logo_url,</if>
- <if test="headPortraitUrl != null">head_portrait_url,</if>
- <if test="societyTag != null">society_tag,</if>
- <if test="introduction != null">introduction,</if>
- <if test="valueAddedTag != null">value_added_tag,</if>
- <if test="organizationId != null">organization_id,</if>
- <if test="shareType != null">share_type,</if>
- <if test="identifyName != null">identify_name,</if>
- <if test="backgroundUrl != null">background_url,</if>
- <if test="auditStatus != null">audit_status,</if>
- <if test="auditOpinion != null">audit_opinion,</if>
- <if test="transferTime != null">transfer_time,</if>
- <if test="informationMaintainer != null">information_maintainer,</if>
- <if test="coreTechnology != null">core_technology,</if>
- <if test="accomplishSituation != null">accomplish_situation,</if>
- <if test="intellectualProperty != null">intellectual_property,</if>
- <if test="creditRating != null">credit_rating,</if>
- <if test="level != null">level,</if>
- <if test="authentication != null">authentication,</if>
- <if test="username != null">username,</if>
- <if test="integrity != null">integrity,</if>
- <if test="toInviteCode != null">to_invite_code,</if>
- <if test="beInviteCode != null">be_invite_code,</if>
- <if test="guidance != null">guidance,</if>
- <if test="signBills != null">sign_bills,</if>
- <if test="channel != null">channel,</if>
- <if test="newChannel != null">new_channel,</if>
- <if test="signTime != null">sign_time,</if>
- <if test="callStatus != null">call_status ,</if>
- <if test="clueStatus != null">clue_status ,</if>
- <if test="clueProcess != null">clue_process,
- </if>
- <if test="clueTime != null">
- clue_time ,
- </if>
- <if test="clueAid != null ">
- clue_aid ,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id,jdbcType=VARCHAR},</if>
- <if test="mobile != null">#{mobile,jdbcType=VARCHAR},</if>
- <if test="password != null">#{password,jdbcType=VARCHAR},</if>
- <if test="nickname != null">#{nickname,jdbcType=VARCHAR},</if>
- <if test="email != null">#{email,jdbcType=VARCHAR},</if>
- <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
- <if test="number != null">#{number,jdbcType=BIGINT},</if>
- <if test="lvl != null">#{lvl,jdbcType=INTEGER},</if>
- <if test="type != null">#{type,jdbcType=INTEGER},</if>
- <if test="aid != null">#{aid,jdbcType=VARCHAR},</if>
- <if test="mid != null">#{mid,jdbcType=VARCHAR},</if>
- <if test="status != null">#{status,jdbcType=INTEGER},</if>
- <if test="source != null">#{source,jdbcType=INTEGER},</if>
- <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
- <if test="companyLogoUrl != null">#{companyLogoUrl,jdbcType=VARCHAR},</if>
- <if test="headPortraitUrl != null">#{headPortraitUrl,jdbcType=VARCHAR},</if>
- <if test="societyTag != null">#{societyTag,jdbcType=VARCHAR},</if>
- <if test="introduction != null">#{introduction,jdbcType=VARCHAR},</if>
- <if test="valueAddedTag != null">#{valueAddedTag,jdbcType=VARCHAR},</if>
- <if test="organizationId != null">#{organizationId,jdbcType=VARCHAR},</if>
- <if test="shareType != null">#{shareType,jdbcType=INTEGER},</if>
- <if test="identifyName != null">#{identifyName,jdbcType=VARCHAR},</if>
- <if test="backgroundUrl != null">#{backgroundUrl,jdbcType=VARCHAR},</if>
- <if test="auditStatus != null">#{auditStatus,jdbcType=INTEGER},</if>
- <if test="auditOpinion != null">#{auditOpinion,jdbcType=VARCHAR},</if>
- <if test="transferTime != null">#{transferTime,jdbcType=TIMESTAMP},</if>
- <if test="informationMaintainer != null">#{informationMaintainer,jdbcType=VARCHAR},</if>
- <if test="coreTechnology != null">#{coreTechnology,jdbcType=VARCHAR},</if>
- <if test="accomplishSituation != null">#{accomplishSituation,jdbcType=VARCHAR},</if>
- <if test="intellectualProperty != null">#{intellectualProperty,jdbcType=VARCHAR},</if>
- <if test="creditRating != null">#{creditRating,jdbcType=INTEGER},</if>
- <if test="level != null">#{level,jdbcType=INTEGER},</if>
- <if test="authentication != null">#{authentication,jdbcType=INTEGER},</if>
- <if test="username != null">#{username,jdbcType=VARCHAR},</if>
- <if test="integrity != null">#{integrity,jdbcType=FLOAT},</if>
- <if test="toInviteCode != null">#{toInviteCode,jdbcType=VARCHAR},</if>
- <if test="beInviteCode != null">#{beInviteCode,jdbcType=VARCHAR},</if>
- <if test="guidance != null">#{guidance,jdbcType=INTEGER},</if>
- <if test="signBills != null">#{signBills,jdbcType=INTEGER},</if>
- <if test="channel != null">#{channel,jdbcType=INTEGER},</if>
- <if test="newChannel != null">#{newChannel,jdbcType=INTEGER},</if>
- <if test="signTime != null">#{signTime,jdbcType=TIMESTAMP},</if>
- <if test="callStatus != null">#{callStatus},</if>
- <if test="clueStatus != null">#{clueStatus},</if>
- <if test="clueProcess != null">#{clueProcess},
- </if>
- <if test="clueTime != null">
- #{clueTime},
- </if>
- <if test="clueAid != null">
- #{clueAid},
- </if>
- </trim>
- </insert>
- <resultMap id="UserPageHomeBo" type="com.goafanti.user.bo.UserPageHomeBo">
- <result column="uid" jdbcType="VARCHAR" property="uid" />
- <result column="lvl" jdbcType="INTEGER" property="lvl" />
- <result column="nickname" jdbcType="VARCHAR" property="nickname" />
- <result column="email" jdbcType="VARCHAR" property="email" />
- <result column="number" jdbcType="INTEGER" property="number" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="person_portrait_url" jdbcType="VARCHAR" property="personPortraitUrl" />
- <result column="logo_url" jdbcType="VARCHAR" property="logoUrl" />
- <result column="grade_name" jdbcType="VARCHAR" property="gradeName" />
- </resultMap>
- <resultMap id="UserDownLoadBo" type="com.goafanti.user.bo.UserDownLoadBo">
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="diploma_url" jdbcType="VARCHAR" property="diplomaUrl" />
- <result column="degree_diploma_url" jdbcType="VARCHAR" property="degreeDiplomaUrl" />
- <result column="professional_certificate_url" jdbcType="VARCHAR" property="professionalCertificateUrl" />
- <result column="qualification_certificate_url" jdbcType="VARCHAR" property="qualificationCertificateUrl" />
- <result column="positive_id_url" jdbcType="VARCHAR" property="positiveIdUrl" />
- <result column="opposite_id_url" jdbcType="VARCHAR" property="oppositeIdUrl" />
- </resultMap>
- <select id="selectByMobieAndType" resultMap="UserMap">
- select
- <include refid="UserAllSql" />
- from user
- where mobile = #{0} and type=#{1} and source = 0
- </select>
- <select id="selectUserPageHomeBoByUserId" parameterType="java.lang.String" resultMap="UserPageHomeBo">
- select
- u.lvl,mg.grade_name , u.nickname, u.email,
- u.number, u.type, u.head_portrait_url as person_portrait_url,
- u.company_logo_url as logo_url, u.id as uid, adc.achievement_count as achievementNum,
- adc.demand_count as demandNum
- from user u
- LEFT JOIN achievement_demand_count adc on adc.uid = u.id
- LEFT JOIN member_grade mg ON mg.member_rank=u.lvl
- where u.id = #{uid,jdbcType = VARCHAR}
- </select>
- <select id="selectUserDownLoadBoByUserId" parameterType="java.lang.String" resultMap="UserDownLoadBo">
- select u.id,i.positive_id_url ,i.opposite_id_url,c.professional_certificate_url,c.qualification_certificate_url,
- e.diploma_url, e.degree_diploma_url
- from user u
- LEFT JOIN user_identity i on u.id = i.uid
- LEFT JOIN user_career c on u.id = c.uid
- LEFT JOIN user_edu e on u.id = e.uid
- where u.id =#{id,jdbcType=VARCHAR}
- </select>
- <select id="findUserListByPage" parameterType="String" resultType="com.goafanti.user.bo.UserListBo">
- select
- u.id ,
- u.mobile,
- u.email,
- u.create_time as createTime,
- u.number ,
- i.username,
- i.audit_status as auditStatus,
- a.name as adminName,
- ad.name as managerName
- from user u
- LEFT JOIN admin a on a.id = u.aid
- LEFT JOIN admin ad on ad.id = u.mid
- LEFT JOIN user_identity i
- ON u.id = i.uid where u.type = 0
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="email != null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test="pStart != null">
- and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
- </if>
- <if test="pEnd != null">
- and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
- </if>
- <if test=" number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="username != null">
- and i.username like CONCAT ('%',#{username,jdbcType=VARCHAR},'%')
- </if>
- <if test="auditStatus != null">
- and i.audit_status= #{auditStatus,jdbcType=INTEGER}
- </if>
- order by u.number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="findUserCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from user u LEFT JOIN user_identity i
- ON u.id = i.uid
- WHERE u.type = 0
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="email != null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test="pStart != null">
- and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
- </if>
- <if test="pEnd != null">
- and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="username != null">
- and i.username like CONCAT ('%',#{username,jdbcType=VARCHAR},'%')
- </if>
- <if test="auditStatus != null">
- and i.audit_status= #{auditStatus,jdbcType=INTEGER}
- </if>
- </select>
- <select id="findOrgListByPage" parameterType="String" resultType="com.goafanti.user.bo.OrgListBo">
- select u.id ,u.mobile, u.email, u.create_time as createTime,
- u.number, o.audit_status as orgAuditStatus, a.name as adminName,
- o.unit_name as unitName, ad.name as managerName
- from user u
- LEFT JOIN admin a on a.id = u.aid
- LEFT JOIN admin ad on ad.id = u.mid
- LEFT JOIN organization_identity o
- ON u.id = o.uid
- WHERE u.type = 1
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="uid != null">
- and u.id = #{uid,jdbcType=VARCHAR}
- </if>
- <if test="email != null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test="pStart != null">
- and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
- </if>
- <if test="pEnd != null">
- and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
- </if>
- <if test=" number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="unitName != null">
- and o.unit_name = #{unitName,jdbcType=VARCHAR}
- </if>
- <if test="auditStatus != null">
- and o.audit_status= #{auditStatus,jdbcType=INTEGER}
- </if>
- order by u.number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="findOrgCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from user u LEFT JOIN organization_identity o
- ON u.id = o.uid
- WHERE u.type = 1
- <if test="uid != null">
- and u.id = #{uid,jdbcType=VARCHAR}
- </if>
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="email != null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test="pStart != null">
- and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
- </if>
- <if test="pEnd != null">
- and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
- </if>
- <if test=" number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="unitName != null">
- and o.unit_name = #{unitName,jdbcType=VARCHAR}
- </if>
- <if test="auditStatus != null">
- and o.audit_status= #{auditStatus,jdbcType=INTEGER}
- </if>
- </select>
- <select id="findUserByAidWithParamsListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
- select
- u.id ,
- u.mobile,
- u.email,
- u.create_time as createTime,
- u.number ,
- a.name as adminName,
- ma.name as managerName,
- u.type,
- i.username,
- i.audit_status as userAuditStatus
- from user u
- LEFT JOIN admin a on a.id = u.aid
- LEFT JOIN admin ma on ma.id = u.mid
- LEFT JOIN user_identity i on u.id = i.uid
- where u.type = 0
- <if test="aid != null">
- and u.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="number !=null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="mobile !=null">
- and u.mobile= #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="auditStatus !=null">
- and i.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="auditName !=null">
- and i.username like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
- </if>
- <if test="email !=null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test="startCreateTime !=null">
- and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
- </if>
- <if test="endCreateTime !=null">
- and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
- </if>
- order by u.number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="findUserByAidWithParamsCount" parameterType="String" resultType="java.lang.Integer">
- select
- count(1)
- from user u
- LEFT JOIN admin a on a.id = u.aid
- LEFT JOIN user_identity i on u.id = i.uid
- where u.type = 0
- <if test="aid != null">
- and u.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="number !=null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="mobile !=null">
- and u.mobile= #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="auditStatus !=null">
- and i.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="auditName !=null">
- and i.username like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
- </if>
- <if test="email !=null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test="startCreateTime !=null">
- and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
- </if>
- <if test="endCreateTime !=null">
- and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
- </if>
- </select>
- <select id="findOrgByAidWithParamsListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
- select
- u.id ,
- u.mobile,
- u.email,
- u.create_time as createTime,
- u.number ,
- a.name as adminName,
- ma.name as managerName,
- u.type,
- i.unit_name as unitName,
- i.audit_status as orgAuditStatus
- from user u
- LEFT JOIN admin a on a.id = u.aid
- LEFT JOIN admin ma on ma.id = u.mid
- LEFT JOIN organization_identity i on u.id = i.uid
- where u.type = 1
- <if test="aid != null">
- and u.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="number !=null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="mobile !=null">
- and u.mobile= #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="auditStatus !=null">
- and i.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="auditName !=null">
- and i.unit_name like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
- </if>
- <if test="email !=null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test="startCreateTime !=null">
- and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
- </if>
- <if test="endCreateTime !=null">
- and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
- </if>
- order by u.number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="findOrgByAidWithParamsCount" parameterType="String" resultType="java.lang.Integer">
- select
- count(1)
- from user u
- LEFT JOIN admin a on a.id = u.aid
- LEFT JOIN organization_identity i on u.id = i.uid
- where u.type = 1
- <if test="aid != null">
- and u.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="number !=null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="mobile !=null">
- and u.mobile= #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="auditStatus !=null">
- and i.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="auditName !=null">
- and i.unit_name like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
- </if>
- <if test="email !=null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test="startCreateTime !=null">
- and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
- </if>
- <if test="endCreateTime !=null">
- and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
- </if>
- </select>
- <select id="findUserByNameAndMobile" resultType="java.lang.String">
- select
- ui.username
- from user u
- left join user_identity ui on u.id = ui.uid
- where u.lvl > 0 and u.type = 0 and ui.audit_status = 5
- <if test="name != null">
- and ui.username = #{name,jdbcType=VARCHAR}
- </if>
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- </select>
- <select id="findOrgByNameAndMobile" resultType="java.lang.String">
- select
- oi.unit_name
- from user u
- left join organization_identity oi on u.id = oi.uid
- where u.lvl > 0 and u.type = 1 and oi.audit_status = 5
- <if test="name != null">
- and oi.unit_name = #{name,jdbcType=VARCHAR}
- </if>
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- </select>
- <select id="findAreaManagerUserListByPage" parameterType="String" resultType="com.goafanti.user.bo.UserListBo">
- select
- u.id ,
- u.mobile,
- u.email,
- u.create_time as createTime,
- u.number ,
- i.audit_status as auditStatus,
- i.username,
- a.name as adminName,
- ad.name as managerName
- from user u
- LEFT JOIN admin a on a.id = u.aid
- LEFT JOIN admin ad on ad.id = u.mid
- LEFT JOIN user_identity i on u.id = i.uid
- where u.type = 0
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="email != null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test="pStart != null">
- and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
- </if>
- <if test="pEnd != null">
- and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
- </if>
- <if test=" number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="username != null">
- and i.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
- </if>
- <if test="auditStatus != null">
- and i.audit_status= #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="provinceList != null">
- and i.province in
- <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
- #{plist}
- </foreach>
- </if>
- <if test="cityList != null">
- and i.city in
- <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
- #{clist}
- </foreach>
- </if>
- order by u.number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="findAreaManagerUserCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from user u LEFT JOIN user_identity i
- ON u.id = i.uid
- WHERE u.type = 0
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="email != null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test="pStart != null">
- and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
- </if>
- <if test="pEnd != null">
- and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="username != null">
- and i.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
- </if>
- <if test="auditStatus != null">
- and i.audit_status= #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="provinceList != null">
- and i.province in
- <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
- #{plist}
- </foreach>
- </if>
- <if test="cityList != null">
- and i.city in
- <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
- #{clist}
- </foreach>
- </if>
- </select>
- <select id="findAreaManagerOrgListByPage" parameterType="String" resultType="com.goafanti.user.bo.OrgListBo">
- select
- u.id ,
- u.mobile,
- u.email,
- u.create_time as createTime,
- u.number ,
- o.audit_status as orgAuditStatus,
- a.name as adminName,
- o.unit_name as unitName,
- ad.name as managerName
- from user u
- LEFT JOIN admin a on a.id = u.aid
- LEFT JOIN admin ad on ad.id = u.mid
- LEFT JOIN organization_identity o on u.id = o.uid
- WHERE u.type = 1
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="uid != null">
- and u.id = #{uid,jdbcType=VARCHAR}
- </if>
- <if test="email != null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test="pStart != null">
- and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
- </if>
- <if test="pEnd != null">
- and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
- </if>
- <if test=" number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="unitName != null">
- and o.unit_name like '%'#{unitName,jdbcType=VARCHAR}'%'
- </if>
- <if test="auditStatus != null">
- and o.audit_status= #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="provinceList != null">
- and o.licence_province in
- <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
- #{plist}
- </foreach>
- </if>
- <if test="cityList != null">
- and o.licence_city in
- <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
- #{clist}
- </foreach>
- </if>
- order by u.number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="findAreaManagerOrgCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from user u LEFT JOIN organization_identity o
- ON u.id = o.uid
- WHERE u.type = 1
- <if test="uid != null">
- and u.id = #{uid,jdbcType=VARCHAR}
- </if>
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="email != null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test="pStart != null">
- and u.create_time <![CDATA[ >= ]]> #{pStart,jdbcType=TIMESTAMP}
- </if>
- <if test="pEnd != null">
- and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
- </if>
- <if test=" number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="unitName != null">
- and o.unit_name like '%'#{unitName,jdbcType=VARCHAR}'%'
- </if>
- <if test="auditStatus != null">
- and o.audit_status= #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="provinceList != null">
- and i.province in
- <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
- #{plist}
- </foreach>
- </if>
- <if test="cityList != null">
- and i.city in
- <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
- #{clist}
- </foreach>
- </if>
- </select>
- <select id="findUserPartnerDetail" parameterType="java.lang.String" resultType="com.goafanti.user.bo.UserPartnerDetailBo">
- select
- u.id,i.username,i.work_unit as workUnit,i.professional_title as position,u.introduction as achievement,
- u.head_portrait_url as personPortraitUrl,
- i.province,
- u.introduction as personalProfile,
- ua.ability_label as abilityLabel,i.qualification,
- i.graduate_school,i.major_category,i.work_unit as workUnit,
- ic.name as engagedField
- from `user` u
- left join user_identity i on u.id=i.uid
- left join
- user_career c on u.id=c.uid
- <!-- left join user_info info on u.id=info.uid -->
- left join user_ability ua on u.id=ua.uid
- left join user_edu e on u.id=e.uid
- left join industry_category ic on i.industry=ic.id
- WHERE
- u.type = 0
- <if test="_parameter!= null">
- and u.id= #{_parameter,jdbcType=VARCHAR}
- </if>
- </select>
- <select id="findOrgPartnerDetail" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgPartnerDetailBo">
- select
- u.id,i.username,c.work_unit as work_unit,c.position,c.achievement,
- u.head_portrait_url as personPortraitUrl,
- i.province,u.introduction as personalProfile,
- ua.ability_label as abilityLabel
- from `user` u
- left join user_identity i on u.id=i.uid
- left join
- user_career c on u.id=c.uid
- <!-- left join user_info info on u.id=info.uid -->
- left join user_ability ua on u.id=ua.uid
- WHERE
- u.type = 1
- <if test="_parameter!= null">
- and u.id= #{_parameter,jdbcType=VARCHAR}
- </if>
- </select>
- <select id="findStarListByPage" parameterType="String" resultType="com.goafanti.user.bo.StarListBo">
- select
- u.id as uid,
- u.number,
- ui.username,
- uc.engaged_field as engagedField,
- uc.professional_title as professionalTitle,
- uc.work_unit as workUnit,
- adc.achievement_count as achievementNum
- from user u
- left join user_identity ui on ui.uid = u.id
- left join user_career uc on uc.uid = u.id
- left join achievement_demand_count adc on adc.uid = u.id
- where
- ui.celebrity = 1
- <if test="number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="engagedField != null">
- and uc.engaged_field like CONCAT(#{engagedField,jdbcType=VARCHAR},'%')
- </if>
- <if test="username != null">
- and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
- </if>
- <if test="professionalTitle != null">
- and uc.professional_title like CONCAT('%',#{professionalTitle,jdbcType=VARCHAR},'%')
- </if>
- <if test="workUnit != null">
- and uc.work_unit like CONCAT('%',#{workUnit,jdbcType=VARCHAR},'%')
- </if>
- ORDER BY adc.achievement_count DESC
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="findStarCount" parameterType="String" resultType="java.lang.Integer">
- select
- count(1)
- from user u
- left join user_identity ui on ui.uid = u.id
- left join user_career uc on uc.uid = u.id
- where
- ui.celebrity = 1
- <if test="number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="engagedField != null">
- and uc.engaged_field like CONCAT(#{engagedField,jdbcType=VARCHAR},'%')
- </if>
- <if test="username != null">
- and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
- </if>
- <if test="professionalTitle != null">
- and uc.professional_title like CONCAT('%',#{professionalTitle,jdbcType=VARCHAR},'%')
- </if>
- <if test="workUnit != null">
- and uc.work_unit like CONCAT('%',#{workUnit,jdbcType=VARCHAR},'%')
- </if>
- </select>
- <select id="findStarAndExpertListByPage" parameterType="String" resultType="com.goafanti.user.bo.StarAndExpertListBo">
- select
- u.id as uid,
- u.number,
- ui.username,
- uc.engaged_field as engagedField,
- uc.professional_title as professionalTitle,
- uc.work_unit as workUnit,
- adc.achievement_count as achievementNum
- from user u
- left join user_identity ui on ui.uid = u.id
- left join user_career uc on uc.uid = u.id
- left join achievement_demand_count adc on adc.uid = u.id
- where
- (ui.celebrity = 1 or ui.expert = 1)
- <if test="number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="engagedField != null">
- and uc.engaged_field like CONCAT(#{engagedField,jdbcType=VARCHAR},'%')
- </if>
- <if test="username != null">
- and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
- </if>
- <if test="professionalTitle != null">
- and uc.professional_title like CONCAT('%',#{professionalTitle,jdbcType=VARCHAR},'%')
- </if>
- <if test="workUnit != null">
- and uc.work_unit like CONCAT('%',#{workUnit,jdbcType=VARCHAR},'%')
- </if>
- ORDER BY adc.achievement_count DESC
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="findStarAndExpertCount" parameterType="String" resultType="java.lang.Integer">
- select
- count(1)
- from user u
- left join user_identity ui on ui.uid = u.id
- left join user_career uc on uc.uid = u.id
- where
- (ui.celebrity = 1 or ui.expert = 1)
- <if test="number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="engagedField != null">
- and uc.engaged_field like CONCAT(#{engagedField,jdbcType=VARCHAR},'%')
- </if>
- <if test="username != null">
- and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
- </if>
- <if test="professionalTitle != null">
- and uc.professional_title like CONCAT('%',#{professionalTitle,jdbcType=VARCHAR},'%')
- </if>
- <if test="workUnit != null">
- and uc.work_unit like CONCAT('%',#{workUnit,jdbcType=VARCHAR},'%')
- </if>
- </select>
- <select id="selectNumberByPrimaryKey" parameterType="String" resultType="java.lang.Long">
- select number
- from user
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <select id="findUserPartner" parameterType="String" resultType="com.goafanti.user.bo.UserPartnerDetailBo">
- select
- u.id,i.username,c.work_unit as work_unit,c.position,c.achievement,
- u.head_portrait_url as personPortraitUrl,
- i.province,
- u.introduction as personalProfile,
- ua.ability_label as abilityLabel,i.uid,u.type
- from `user` u
- left join user_identity i on u.id=i.uid
- left join
- user_career c on u.id=c.uid
- <!-- left join user_info info on u.id=info.uid -->
- left join user_ability ua on u.id=ua.uid
- WHERE
- u.type = 0
- limit 0,50
- </select>
- <select id="checkUser" resultMap="UserMap">
- select
- id
- from
- user
- where status <![CDATA[!= ]]> 1
- <if test="id != null and id != ''">
- and id = #{id,jdbcType=VARCHAR}
- </if>
- <if test="identifyName != null and identifyName != ''">
- and identify_name = #{identifyName,jdbcType=VARCHAR}
- </if>
- <if test="mobile != null and mobile !=''">
- and mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="type != null">
- and type = #{type,jdbcType=INTEGER}
- </if>
- <if test="source != null">
- and source = #{source,jdbcType=INTEGER}
- </if>
- <if test="nickname != null and nickname != ''">
- and nickname = #{nickname,jdbcType=INTEGER}
- </if>
- </select>
- <select id="userInterest" resultType="com.goafanti.user.bo.UserInterestBo">
- select
- t.to_uid as id,y.username as name,y.work_unit as workUnit,y.professional_title as professionalTitle,t.create_time as createTime
- from user_interest t
- LEFT join user_identity y on t.to_uid=y.uid
- LEFT join user u on t.to_uid=u.id
- where t.from_uid=#{uid,jdbcType=VARCHAR}
- </select>
- <select id="selectBaseInfo" parameterType="java.lang.String" resultType="com.goafanti.app.bo.UserBasicInfo">
- select
- a.id,
- a.mobile,
- a.nickname,
- a.email,
- a.number,
- a.type,
- a.company_logo_url as companyLogoUrl,
- a.head_portrait_url as headPortraitUrl,
- a.introduction,
- b.registration_id as registrationId,
- b.easemob_name as easemobName,
- b.easemob_pass as easemobPass
- from user a left join jpush_easemob_account b
- on a.id = b.uid
- where
- a.id = #{id,jdbcType=VARCHAR}
- </select>
- <select id="selectByNumber" parameterType="java.lang.String" resultMap="UserMap">
- select nickname,head_portrait_url from user where number = #{easemobName,jdbcType=VARCHAR}
- </select>
- <update id="updateEnteringAudit" parameterType="com.goafanti.common.model.User">
- update user
- <set>
- <if test="auditStatus != null">
- audit_status = #{auditStatus,jdbcType=INTEGER},
- </if>
- <if test="auditOpinion != null">
- audit_opinion = #{auditOpinion,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <select id="selectUserByRoleName" parameterType="java.lang.String" resultMap="UserMap">
- 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})
- </select>
- <update id="updateDimissionTransfer">
- update user
- set aid=#{transferId,jdbcType=VARCHAR},
- information_maintainer=#{transferId,jdbcType=VARCHAR},
- source=3
- where aid=#{aid,jdbcType=VARCHAR}
- </update>
- <select id="getAidAndUser" resultType="java.lang.Integer">
- select count(*) from `user`
- where aid=#{aid,jdbcType=VARCHAR} and id=#{uid,jdbcType=VARCHAR}
- </select>
- <update id="pushUserGuidance">
- update user set guidance=#{guidance} where id=#{id}
- </update>
- <update id="updateList">
- update user
- <set>
- <if test="source != null">
- source = #{source,jdbcType=INTEGER},
- </if>
- <if test="level != null">
- level= #{level,jdbcType=INTEGER},
- </if>
- <if test="aid != null">
- aid = #{aid,jdbcType=VARCHAR},
- </if>
- <if test="data ==1">
- information_maintainer = #{aid,jdbcType=VARCHAR},
- </if>
- <if test="transferTime != null">
- transfer_time = #{transferTime,jdbcType=TIMESTAMP},
- </if>
- <if test="shareType != null">
- share_type = #{shareType,jdbcType=VARCHAR}
- </if>
- </set>
- where id in
- <foreach item="item" collection="list" separator="," open="(" close=")" index="">
- #{item}
- </foreach>
- </update>
- <select id="selectByName" parameterType="java.lang.String" resultMap="UserMap">
- select
- <include refid="UserAllSql" />
- from user
- where nickname = #{name} limit 1
- </select>
- <select id="selectPrivateOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
- 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,
- a.guidance, dg3.name as area,d.intended_project intendedProject,d.business_scope businessScope,d.org_code orgCode,ic.name industry,
- date_format(um.last_sign_time,'%Y-%m-%d %H:%i:%S') lastSignTime,
- date_format(a.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
- date_format(um.last_follow_time,'%Y-%m-%d %H:%i:%S') lastFollowTime,
- if(a.transfer_time < um.last_follow_time,um.last_follow_time,a.transfer_time) as orderTime
- from user a left join admin b on a.aid=b.id left join organization_identity d on a.id = d.uid
- left join industry_category ic on d.industry=ic.id
- left join district_glossory dg1 on d.location_province = dg1.id
- left join district_glossory dg2 on d.location_city = dg2.id
- left join district_glossory dg3 on d.location_area = dg3.id
- left join user_mid um on um.aid=a.aid and um.uid=a.id
- where a.type= 1 and a.source in(1,2,3) and a.share_type = 0 and a.new_channel=0
- <if test="power ==0">
- and a.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="power ==1 or power ==2">
- and a.aid
- <if test="alist != null">
- in
- <foreach item="item" collection="alist" separator="," open="(" close=")" index="">
- #{item}
- </foreach>
- </if>
- <if test="alist == null">
- is null
- </if>
- </if>
- <if test="name != null and name != ''">
- and a.nickname like concat('%',#{name},'%')
- </if>
- <if test="startDate != null and endDate != null">
- and a.transfer_time BETWEEN #{startDate} and #{endDate}
- </if>
- <if test="province != null">
- and d.location_province = #{province,jdbcType=INTEGER}
- </if>
- <if test="city != null">
- and d.location_city = #{city,jdbcType=INTEGER}
- </if>
- <if test="area != null">
- and d.location_area = #{area,jdbcType=INTEGER}
- </if>
- <if test="level != null">
- and a.level = #{level,jdbcType=INTEGER}
- </if>
- <if test="sort != 1">
- order by orderTime
- </if>
- <if test="sort == 1">
- order by a.create_time
- </if>
- <if test="sortType == 1">
- desc
- </if>
- ,a.transfer_time desc
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="selectPrivateOrganizationCustomerCount" resultType="java.lang.Integer">
- select count(*)
- from user a left join admin b on a.aid=b.id left join organization_identity d on a.id = d.uid
- left join district_glossory dg1 on d.location_province = dg1.id
- left join district_glossory dg2 on d.location_city = dg2.id
- left join district_glossory dg3 on d.location_area = dg3.id
- left join user_mid um on um.aid=a.aid and um.uid=a.id
- where a.type= 1 and a.source in(1,2,3) and a.share_type = 0 and a.new_channel=0
- <if test="power ==0">
- and a.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="power ==1 or power ==2">
- and a.aid
- <if test="alist != null">
- in
- <foreach item="item" collection="alist" separator="," open="(" close=")" index="">
- #{item}
- </foreach>
- </if>
- <if test="alist == null">
- is null
- </if>
- </if>
- <if test="name != null and name != ''">
- and a.nickname like concat('%',#{name},'%')
- </if>
- <if test="startDate != null and endDate != null">
- and a.transfer_time BETWEEN #{startDate} and #{endDate}
- </if>
- <if test="province != null">
- and d.location_province = #{province,jdbcType=INTEGER}
- </if>
- <if test="city != null">
- and d.location_city = #{city,jdbcType=INTEGER}
- </if>
- <if test="area != null">
- and d.location_area = #{area,jdbcType=INTEGER}
- </if>
- <if test="level != null">
- and a.level = #{level,jdbcType=INTEGER}
- </if>
- </select>
- <select id="findMainProductsList" resultType="com.goafanti.customer.bo.OutUserMianProducts">
- select oi.id ,u.id uid, u.nickname userName, oi.business_scope businessScope,
- um.update_name updateName,um.update_aid updateAid,u.share_type shareType,
- <if test="shiroType ==2">
- a.name adminName,d.name depName,dg.name province,
- </if>
- date_format(u.transfer_time ,'%Y-%m-%d %H:%i:%s')transferTimes,
- date_format(um.date_update_time,'%Y-%m-%d %H:%i:%s')dateUpdateTimes
- from `user` u
- <if test="shiroType==0">
- inner join (select b.buyer_id from t_order_task a left join t_order_new b
- on a.order_no = b.order_no where a.main = 1 and a.split_status in (0, 1)
- and a.task_receiver = #{aid} group by b.buyer_id) t0 on t0.buyer_id = u.id
- </if>
- left join organization_identity oi on u.id = oi.uid left join user_mid um on u.id=um.uid
- <if test="shiroType==2">
- left join admin a on u.aid=a.id left join department d on a.department_id =d.id
- left join district_glossory dg on oi.location_province =dg.id
- </if>
- where u.`type` =1 and u.status=0 and u.new_channel=0
- <if test="shiroType==1">
- and u.information_maintainer = #{aid}
- </if>
- <if test="shiroType==2">
- <if test="adminName !=null">
- and a.name like concat('%', #{adminName},'%')
- </if>
- <if test="depId !=null">
- and d.id= #{depId}
- </if>
- </if>
- <if test="shareType !=null">
- and u.share_type = #{shareType}
- </if>
- <if test="userName != null">
- and u.nickname like concat('%',#{userName},'%')
- </if>
- <if test="key !=null">
- and oi.business_scope like concat('%',#{key},'%')
- </if>
- <if test="startTime !=null and endTime !=null">
- and u.transfer_time between #{startTime} and #{endTime}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="findMainProductsCount" resultType="java.lang.Integer">
- select count(*) from `user` u
- <if test="shiroType==0">
- inner join (select b.buyer_id from t_order_task a left join t_order_new b
- on a.order_no = b.order_no where a.main = 1 and a.split_status in (0, 1)
- and a.task_receiver = #{aid} group by b.buyer_id) t0 on t0.buyer_id = u.id
- </if>
- left join organization_identity oi on u.id = oi.uid
- <if test="shiroType==2">
- <if test="adminName !=null or depId !=null">
- left join admin a on u.aid=a.id left join department d on a.department_id =d.id
- </if>
- </if>
- where u.`type` =1 and u.status=0 and u.new_channel=0
- <if test="shiroType==1">
- and u.information_maintainer = #{aid}
- </if>
- <if test="shiroType==2">
- <if test="adminName !=null">
- and a.name like concat('%', #{adminName},'%')
- </if>
- <if test="depId !=null">
- and d.id= #{depId}
- </if>
- </if>
- <if test="shareType !=null">
- and u.share_type = #{shareType}
- </if>
- <if test="userName != null">
- and u.nickname like concat('%',#{userName},'%')
- </if>
- <if test="key !=null">
- and oi.business_scope like concat('%',#{key},'%')
- </if>
- <if test="startTime !=null and endTime !=null">
- and u.transfer_time between #{startTime} and #{endTime}
- </if>
- </select>
- <select id="selectUserLastSignList" resultType="com.goafanti.customer.bo.OutUserLastSignBo">
- select a.share_type shareType ,a.nickname ,b.name ,c.contacts ,c.contact_mobile contactMobile,d.task_names taskNames ,
- date_format(d.last_follow_time,'%Y-%m-%d %H:%i:%S')lastFollowTimeStr,
- date_format(a.transfer_time,'%Y-%m-%d %H:%i:%S') transferTimeStr
- from `user` a left join admin b on a.aid=b.id left join department dep on b.department_id =dep.id
- left join organization_identity c on a.id=c.uid left join user_mid d on a.id=d.uid
- where 1=1
- and a.share_type in (0,2,3,4)
- <if test="purview==0">
- and dep.province in (11) is not true
- </if>
- <if test="purview==1">
- and dep.province in (11)
- and b.id in ('734092ad-6564-4021-b7ab-aab5af3a1537') is not true
- </if>
- <if test="nickname !=null">
- and a.nickname like concat('%',#{nickname},'%')
- </if>
- <if test="shareType != null">
- and a.share_type= #{shareType}
- </if>
- <if test="aid !=null">
- and a.aid= #{aid}
- </if>
- <if test="lastTime !=null">
- and d.last_follow_time < #{lastTime}
- </if>
- order by d.last_follow_time desc
- <if test="page_sql !=null">
- ${page_sql}
- </if>
- </select>
- <select id="selectUserLastSignCount" resultType="java.lang.Integer">
- select count(*)
- from `user` a left join admin b on a.aid=b.id left join department dep on b.department_id =dep.id
- left join user_mid d on a.id=d.uid
- where 1=1
- and a.share_type in (0,2,3,4)
- <if test="purview==0">
- and dep.province in (11) is not true
- </if>
- <if test="purview==1">
- and dep.province in (11)
- and b.id in ('734092ad-6564-4021-b7ab-aab5af3a1537') is not true
- </if>
- <if test="nickname !=null">
- and a.nickname like concat('%',#{nickname},'%')
- </if>
- <if test="shareType != null">
- and a.share_type= #{shareType}
- </if>
- <if test="aid !=null">
- and a.aid= #{aid}
- </if>
- <if test="lastTime !=null">
- and d.last_follow_time < #{lastTime}
- </if>
- </select>
- <update id="updateUserShareType">
- update user
- set share_type = 0,transfer_time = now()
- where id in
- <foreach collection="list" item="item" separator="," open="(" close=")">
- #{item.uid}
- </foreach>
- </update>
- <select id="selectSignReleaseUser" resultType="com.goafanti.customer.bo.LockingReleaseBo">
- select
- u.id uid,u.aid,0 type,u.share_type shareType,u.nickname userName,u.new_channel newChannel
- from user u left join user_mid um on u.id=um.uid
- where u.channel=0 and u.share_type in (2)
- and u.aid = #{id}
- and datediff(now(),if(u.transfer_time < um.last_follow_time,um.last_follow_time,u.transfer_time))>30
- </select>
- <select id="selectUserClueList" resultType="com.goafanti.customer.bo.OutUserClueList">
- select a.id,a.nickname ,b.contacts ,b.contact_mobile contactMobile,c.name adminName,
- a.clue_process clueProcess,a.clue_time clueTime
- from `user` a left join organization_identity b on a.id =b.uid
- left join admin c on a.aid=c.id
- where a.clue_status =1
- <include refid="selectUserClueListSql"/>
- <if test="page_sql !=null">
- ${page_sql}
- </if>
- </select>
- <sql id="selectUserClueListSql">
- <if test="shiroType==1">
- <if test="aid !=null">
- and a.clue_aid= #{aid}
- </if>
- </if>
- <if test="shiroType==2">
- and a.clue_process in (1)
- <if test="aid !=null">
- and a.aid= #{aid}
- </if>
- </if>
- <if test="clueProcess !=null">
- and a.clue_process= #{clueProcess}
- </if>
- <if test="startTime !=null and endTime != null">
- and a.clue_time between #{startTime} and #{endTime}
- </if>
- <if test="userName!=null">
- and a.nickname like concat('%',#{userName},'%')
- </if>
- </sql>
- <select id="selectUserClueCount" resultType="java.lang.Integer">
- select count(*) from `user` a
- where clue_status =1
- <if test="aid !=null">
- and a.aid= #{aid}
- </if>
- <if test="clueProcess !=null">
- and a.clue_process= #{clueProcess}
- </if>
- <if test="startTime !=null and endTime != null">
- and a.clue_time between #{startTime} and #{endTime}
- </if>
- </select>
- </mapper>
|