| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266 |
- <?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">
- <select id="selectPersonalCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
- select
- a.id as uid,
- a.type,
- a.status,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
- a.business_audit as businessAudit,
- a.current_member_status as currentMemberStatus,
- a.identify_name as name,
- a.lvl,a.is_member as isMember,
- a.society_tag as societyTag,
- a.share_type as shareType,
- b.contacts,
- b.contact_mobile as contactMobile,
- b.international,
- b.expert,
- b.audit_status as auditStatus,
- dg1.name as province,
- dg2.name as city,
- dg3.name as area,
- c.name as industry,
- d.name as adminName,
- b.expert_audit as expertAudit
- from user a inner join user_identity b on a.id = b.uid
- left join district_glossory dg1 on b.province = dg1.id
- left join district_glossory dg2 on b.city = dg2.id
- left join district_glossory dg3 on b.area = dg3.id
- left join industry_category c on b.industry = c.id
- left join admin d on a.aid = d.id
- where a.type = 0 and a.status != 1 and a.audit_status = 1
- <if test="aid != null and aid !=''">
- and a.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="expertAudit != null and expertAudit !=''">
- and b.expert_audit = #{expertAudit,jdbcType=VARCHAR}
- </if>
- <if test="name != null and name != ''">
- and a.identify_name like concat('%',#{name},'%')
- </if>
- <if test="shareType != null">
- and a.share_type = #{shareType,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and a.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="businessAudit != null">
- and a.business_audit = #{businessAudit,jdbcType=INTEGER}
- </if>
- <if test="isMember != null">
- and a.is_member = #{isMember,jdbcType=INTEGER}
- </if>
- <if test="lvl != null">
- and a.lvl = #{lvl,jdbcType=INTEGER}
- </if>
- <if test="currentMemberStatus != null">
- and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
- </if>
- <if test="societyTag != null and societyTag != ''">
- and a.society_tag = #{societyTag,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and startDate != ''">
- and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endDate != null and endDate != ''">
- and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="province != null">
- and b.province = #{province,jdbcType=INTEGER}
- </if>
- <if test="city != null">
- and b.city = #{city,jdbcType=INTEGER}
- </if>
- <if test="area != null">
- and b.area = #{area,jdbcType=INTEGER}
- </if>
- <if test="industry != null">
- and b.industry = #{industry,jdbcType=INTEGER}
- </if>
- <if test="expert != null">
- and b.expert = #{expert,jdbcType=INTEGER}
- </if>
- <if test="international != null">
- and b.international = #{international,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and b.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="selectPersonalCustomerCount" resultType="java.lang.Integer">
- select count(0)
- from user a inner join user_identity b on a.id = b.uid
- left join district_glossory dg1 on b.province = dg1.id
- left join district_glossory dg2 on b.city = dg2.id
- left join district_glossory dg3 on b.area = dg3.id
- left join industry_category c on b.industry = c.id
- left join admin d on a.aid = d.id
- where a.type = 0 and a.status != 1 and a.audit_status = 1
- AND a.audit_status=1
- <if test="aid != null and aid !=''">
- and a.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="name != null and name != ''">
- and a.identify_name like concat('%',#{name},'%')
- </if>
- <if test="shareType != null">
- and a.share_type = #{shareType,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and a.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="businessAudit != null">
- and a.business_audit = #{businessAudit,jdbcType=INTEGER}
- </if>
- <if test="isMember != null">
- and a.is_member = #{isMember,jdbcType=INTEGER}
- </if>
- <if test="lvl != null">
- and a.lvl = #{lvl,jdbcType=INTEGER}
- </if>
- <if test="currentMemberStatus != null">
- and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
- </if>
- <if test="societyTag != null and societyTag != ''">
- and a.society_tag = #{societyTag,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and startDate != ''">
- and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endDate != null and endDate != ''">
- and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="province != null">
- and b.province = #{province,jdbcType=INTEGER}
- </if>
- <if test="city != null">
- and b.city = #{city,jdbcType=INTEGER}
- </if>
- <if test="area != null">
- and b.area = #{area,jdbcType=INTEGER}
- </if>
- <if test="industry != null">
- and b.industry = #{industry,jdbcType=INTEGER}
- </if>
- <if test="expert != null">
- and b.expert = #{expert,jdbcType=INTEGER}
- </if>
- <if test="international != null">
- and b.international = #{international,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and b.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- </select>
- <select id="selectOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
- select
- a.id as uid,
- a.type,
- a.status,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
- a.business_audit as businessAudit,
- a.current_member_status as currentMemberStatus,
- a.identify_name as name,
- a.lvl,
- a.is_member as isMember,
- a.society_tag as societyTag,
- share_type as shareType,
- b.contacts,
- b.contact_mobile as contactMobile,
- b.international,
- b.listed,
- b.high_tech_zone as highTechZone,
- b.audit_status as auditStatus,
- dg1.name as province,
- dg2.name as city,
- dg3.name as area,
- c.name as industry,
- d.name as adminName
- from user a inner join organization_identity b on a.id = b.uid
- left join district_glossory dg1 on b.location_province = dg1.id
- left join district_glossory dg2 on b.location_city = dg2.id
- left join district_glossory dg3 on b.location_area = dg3.id
- left join industry_category c on b.industry = c.id
- left join admin d on a.aid = d.id
- where a.type = 1 and a.status != 1 and a.audit_status = 1
- <if test="aid != null and aid !=''">
- and a.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="name != null and name != ''">
- and a.identify_name like concat('%',#{name},'%')
- </if>
- <if test="shareType != null">
- and a.share_type = #{shareType,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and a.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="businessAudit != null">
- and a.business_audit = #{businessAudit,jdbcType=INTEGER}
- </if>
- <if test="isMember != null">
- and a.is_member = #{isMember,jdbcType=INTEGER}
- </if>
- <if test="currentMemberStatus != null">
- and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
- </if>
- <if test="lvl != null">
- and a.lvl = #{lvl,jdbcType=INTEGER}
- </if>
- <if test="societyTag != null and societyTag != ''">
- and a.society_tag = #{societyTag,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and startDate != ''">
- and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endDate != null and endDate != ''">
- and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="province != null">
- and b.location_province = #{province,jdbcType=INTEGER}
- </if>
- <if test="city != null">
- and b.location_city = #{city,jdbcType=INTEGER}
- </if>
- <if test="area != null">
- and b.location_area = #{area,jdbcType=INTEGER}
- </if>
- <if test="industry != null">
- and b.industry = #{industry,jdbcType=INTEGER}
- </if>
- <if test="listed != null">
- and b.listed = #{listed,jdbcType=INTEGER}
- </if>
- <if test="highTechZone != null">
- and b.high_tech_zone = #{highTechZone,jdbcType=INTEGER}
- </if>
- <if test="international != null">
- and b.international = #{international,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and b.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="selectOrganizationCustomerCount" resultType="java.lang.Integer">
- select
- count(0)
- from user a inner join organization_identity b on a.id = b.uid
- where a.type = 1 and a.status != 1 and a.audit_status = 1
- <if test="aid != null and aid !=''">
- and a.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="name != null and name != ''">
- and a.identify_name like concat('%',#{name},'%')
- </if>
- <if test="shareType != null">
- and a.share_type = #{shareType,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and a.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="businessAudit != null">
- and a.business_audit = #{businessAudit,jdbcType=INTEGER}
- </if>
- <if test="currentMemberStatus != null">
- and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
- </if>
- <if test="isMember != null">
- and a.is_member = #{isMember,jdbcType=INTEGER}
- </if>
- <if test="societyTag != null and societyTag != ''">
- and a.society_tag = #{societyTag,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and startDate != ''">
- and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endDate != null and endDate != ''">
- and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="province != null">
- and b.location_province = #{province,jdbcType=INTEGER}
- </if>
- <if test="city != null">
- and b.location_city = #{city,jdbcType=INTEGER}
- </if>
- <if test="area != null">
- and b.location_area = #{area,jdbcType=INTEGER}
- </if>
- <if test="industry != null">
- and b.industry = #{industry,jdbcType=INTEGER}
- </if>
- <if test="listed != null">
- and b.listed = #{listed,jdbcType=INTEGER}
- </if>
- <if test="highTechZone != null">
- and b.high_tech_zone = #{highTechZone,jdbcType=INTEGER}
- </if>
- <if test="international != null">
- and b.international = #{international,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and b.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- </select>
-
- <select id="findCustomerByName" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerSimpleBo">
- select id,identify_name as name from user where identify_name like
- concat('%',#{identifyName},'%') and status <![CDATA[!= ]]> 1 and audit_status = 1
- </select>
-
- <select id="judgeCustomerByName" resultType="java.lang.Integer">
- select count(0) from user where identify_name = #{identifyName,jdbcType=VARCHAR}
- and status <![CDATA[!= ]]> 1
- </select>
-
- <select id="findOrganizationCustomerDetail" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerOrganizationDetailBo">
- select
- a.id as uid,
- a.society_tag as societyTag,
- a.company_logo_url as companyLogoUrl,
- a.introduction,
- a.identify_name as identifyName,
- a.business_audit as businessAudit,
- b.industry,
- b.location_province as locationProvince,
- b.location_city as locationCity,
- b.location_area as locationArea,
- b.postal_address as postalAddress,
- b.contacts_fixed_tel as contactsFixedTel,
- b.contacts_fax as contactsFax,
- b.registered_capital registeredCapital,
- b.enterprise_scale as enterpriseScale,
- b.legal_person as legalPerson,
- b.legal_person_id_card as legalPersonIdCard,
- b.legal_person_tel as legalPersonTel,
- b.legal_person_email as legalPersonEmail,
- b.high_tech_zone highTechZone,
- b.listed,
- b.international,
- b.org_code as orgCode,
- b.org_code_url as orgCodeUrl,
- b.business_scope as businessScope,
- b.id,
- b.contacts,
- b.contact_mobile as contactMobile,
- b.audit_status as auditStatus,
- b.licence_number as licenceNumber,
- a.aid as aid,d.name as adminName
- from
- user a inner join organization_identity b on a.id = b.uid
- left join admin d on d.id = a.aid
- where
- a.id = #{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="findPersonalCustomerDetail" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerPersonalDetailBo">
- select
- a.id as uid,
- a.identify_name as identifyName,
- a.society_tag as societyTag,
- a.head_portrait_url as headPortraitUrl,
- a.introduction,
- a.business_audit as businessAudit,
- b.id,
- b.industry,
- b.sex,
- b.date_of_birth_year as dateOfBirthYear,
- b.date_of_birth_month as dateOfBirthMonth,
- b.id_number as idNumber,
- b.province,
- b.city,
- b.area,
- b.positive_id_url as positiveIdUrl,
- b.opposite_id_url as oppositeIdUrl,
- b.postal_address as postalAddress,
- b.contact_mobile as contactMobile,
- b.fixed_tel as fixedTel,
- b.email,
- b.expert,
- b.international,
- b.contacts,
- b.contact_mobile as contactMobile,
- b.qq,
- b.professional_title as professionalTitle,
- b.work_unit as workUnit,
- b.education,
- b.major_category as majorCategory,
- b.qualification,
- b.audit_status as auditStatus,
- b.graduate_school as graduateSchool,
- b.consultation_price as consultationPrice,
- b.expert_audit as expertAudit,
- b.release_status as releaseStatus,
- a.aid as aid,d.name as adminName
- from
- user a inner join user_identity b on
- a.id = b.uid
- left join admin d on d.id = a.aid
- where
- a.id = #{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="selectFollowHistoryList" resultType="com.goafanti.customer.bo.FollowListBo">
- select
- a.id as followId,
- a.create_time as followTime,
- a.contact_type as contactType,
- a.result,
- b.identify_name as identifyName,
- c.name as contacts,
- c.mobile as contactMobile,
- d.name as adminName
- <if test="businessGlossoryId != null and businessGlossoryId != ''"><!-- 客户甲项目A所有的跟进记录 -->
- ,e.id as ufbId,e.follow_situation as followSituation,e.customer_status as customerStatus
- </if>
- from user_follow a
- left join user b on a.uid = b.id
- left join organization_contact_book c on a.ocb_id = c.id
- left join admin d on a.aid = d.id
- <if test="businessGlossoryId != null and businessGlossoryId != ''"><!-- 客户甲项目A所有的跟进记录 -->
- inner join user_follow_business e on a.id = e.follow_id
- </if>
- where a.effective = 0
- <if test="uid != null and uid != ''">
- and a.uid = #{uid,jdbcType=VARCHAR}
- </if>
- <if test="aid != null and aid != ''">
- and a.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="businessGlossoryId != null and businessGlossoryId != ''"><!-- 客户甲项目A所有的跟进记录 -->
- and e.business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="selectFollowHistoryCount" resultType="java.lang.Integer">
- select
- count(0)
- from user_follow a
- left join user b on a.uid = b.id
- left join organization_contact_book c on a.ocb_id = c.id
- left join admin d on a.aid = d.id
- <if test="businessGlossoryId != null and businessGlossoryId != ''"><!-- 客户甲项目A所有的跟进记录 -->
- inner join user_follow_business e on a.id = e.follow_id
- </if>
- where a.effective = 0
- <if test="uid != null and uid != ''">
- and a.uid = #{uid,jdbcType=VARCHAR}
- </if>
- <if test="aid != null and aid != ''">
- and a.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="businessGlossoryId != null and businessGlossoryId != ''"><!-- 客户甲项目A所有的跟进记录 -->
- and e.business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="findUserAccountDetail" parameterType="java.lang.String" resultType="com.goafanti.common.model.User">
- select
- id,
- mobile,
- nickname,
- create_time as createTime,
- type,
- source,
- email,
- is_member as isMember,
- lvl,
- current_member_status currentMemberStatus,
- business_audit as businessAudit,
- identify_name as identifyName,
- status
- from
- user
- where id = #{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="findCustomerContacts" parameterType="java.lang.String" resultType="com.goafanti.common.model.OrganizationContactBook">
- select id,name,mobile,email,qq,wechat,depatrment,position from organization_contact_book
- where uid = #{uid,jdbcType=VARCHAR} and aid = #{aid,jdbcType=VARCHAR}
- </select>
-
- <select id="findAllContacts" parameterType="java.lang.String" resultType="com.goafanti.common.model.OrganizationContactBook">
- select id,name,mobile from organization_contact_book
- where uid = #{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="findFollowById" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.FollowBusinessBo">
- select
- a.id as followId,
- a.uid,
- a.ocb_id as ocbId,
- a.contact_type as contactType,
- a.result,
- a.create_time as followTime,
- b.identify_name as identifyName,
- c.name as contacts,
- c.mobile as contactType,
- d.name as adminName
- from
- user_follow a
- left join user b on a.uid = b.id
- left join organization_contact_book c on a.ocb_id = c.id
- left join admin d on a.aid = d.id
- where a.id = #{followId,jdbcType=VARCHAR}
- </select>
- <select id="customerStatisticsList" resultType="com.goafanti.customer.bo.StatisticBo">
- select a.*,b.name as adminName,c.name as departmentName from (
- select
- aid,
- sum(case when customer_status = 0 then 1 else 0 end) as newNo, <!-- 新客户 -->
- sum(case when customer_status = 1 then 1 else 0 end) as intentionNo, <!-- 意向客户 -->
- sum(case when customer_status = 2 then 1 else 0 end) as pointNo, <!-- 重点客户 -->
- sum(case when customer_status = 3 then 1 else 0 end) as interviewNo, <!-- 面谈客户 -->
- sum(case when customer_status = 4 then 1 else 0 end) as signNo, <!-- 签单客户 -->
- sum(case when customer_status = 5 then 1 else 0 end) as refuseNo, <!-- 拒绝客户 -->
- sum(case when customer_status = 6 then 1 else 0 end) as stopNo <!-- 停止跟进 -->
- from user_business where 1=1
- <if test="sDate != null">
- and create_time > #{sDate,jdbcType=DATE}
- </if>
- <if test="eDate != null">
- and create_time < #{eDate,jdbcType=DATE}
- </if>
- <if test="businessGlossoryId != null">
- and business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
- </if>
- group by aid
- )a
- left join admin b on a.aid = b.id
- left join department_management c on b.department_id = c.id
- <if test="depNo != null">
- where c.dep_no like concat(#{depNo,jdbcType=VARCHAR},'%')
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="customerStatisticsCount" resultType="java.lang.Integer">
- select count(0) from (
- select
- aid
- from user_business where 1=1
- <if test="sDate != null">
- and create_time > #{sDate,jdbcType=DATE}
- </if>
- <if test="eDate != null">
- and create_time < #{eDate,jdbcType=DATE}
- </if>
- <if test="businessGlossoryId != null">
- and business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
- </if>
- group by aid
- )a
- left join admin b on a.aid = b.id
- left join department_management c on b.department_id = c.id
- <if test="depNo !=null">
- where c.dep_no like concat(#{depNo,jdbcType=VARCHAR},'%')
- </if>
- </select>
-
- <select id="businessStatisticList" resultType="com.goafanti.customer.bo.StatisticBo">
- select a.*,b.name as adminName,c.name as departmentName from (
- select
- aid,
- sum(case when follow_situation = 0 then 1 else 0 end) as sendMaterialNo, <!-- 已发项目介绍资料 -->
- sum(case when follow_situation = 1 then 1 else 0 end) as interviewNo, <!-- 已约面谈 -->
- sum(case when follow_situation = 2 then 1 else 0 end) as sendProspectusNo, <!-- 已发合同计划书 -->
- sum(case when follow_situation = 3 then 1 else 0 end) as quoteNo, <!-- 已报价 -->
- sum(case when follow_situation = 4 then 1 else 0 end) as sendContractNo, <!-- 已发合同 -->
- sum(case when follow_situation = 5 then 1 else 0 end) as signContractNo, <!-- 已签合同 -->
- sum(case when follow_situation = 6 then 1 else 0 end) as onVisaNo, <!-- 面谈中 -->
- sum(case when follow_situation = 7 then 1 else 0 end) as visaNo <!-- 已面签 -->
- from user_business where 1=1
- <if test="sDate != null">
- and create_time > #{sDate,jdbcType=DATE}
- </if>
- <if test="eDate != null">
- and create_time < #{eDate,jdbcType=DATE}
- </if>
- <if test="businessGlossoryId != null">
- and business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
- </if>
- group by aid
- )a
- left join admin b on a.aid = b.id
- left join department_management c on b.department_id = c.id
- <if test="depNo !=null">
- where c.dep_no like concat(#{depNo,jdbcType=VARCHAR},'%')
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
-
- <select id="businessStatisticCount" resultType="java.lang.Integer">
- select count(0) from (
- select
- aid
- from user_business where 1=1
- <if test="sDate != null">
- and create_time > #{sDate,jdbcType=DATE}
- </if>
- <if test="eDate != null">
- and create_time < #{eDate,jdbcType=DATE}
- </if>
- <if test="businessGlossoryId != null">
- and business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
- </if>
- group by aid
- )a
- left join admin b on a.aid = b.id
- left join department_management c on b.department_id = c.id
- <if test="depNo !=null">
- where c.dep_no like concat(#{depNo,jdbcType=VARCHAR},'%')
- </if>
- </select>
-
- <select id="followStatisticList" resultType="com.goafanti.customer.bo.StatisticBo">
- select x.*,b.name as adminName,c.name as departmentName,y.* from (
- select
- count(0) as followNo,
- aid,
- sum(case when contact_type = 0 then 1 else 0 end) as visitNo, <!-- 外出 -->
- sum(case when contact_type = 1 then 1 else 0 end) as telNo, <!-- 电话 -->
- sum(case when contact_type = 2 then 1 else 0 end) as qqNo, <!-- QQ -->
- sum(case when contact_type = 3 then 1 else 0 end) as wxNo, <!-- 微信 -->
- sum(case when contact_type = 4 then 1 else 0 end) as emailNo, <!-- 邮件 -->
- sum(case when contact_type = 5 then 1 else 0 end) as letterNo <!-- 书信 -->
- from user_follow where 1=1
- <if test="sDate != null">
- and create_time > #{sDate,jdbcType=DATE}
- </if>
- <if test="eDate != null">
- and create_time < #{eDate,jdbcType=DATE}
- </if>
- group by aid
- )x
- left join admin b on x.aid = b.id
- left join department_management c on b.department_id = c.id
- left join
- (
- select
- count( 0 ) as customerNo,
- aid
- from
- (
- select
- aid,
- uid
- from
- user_follow
-
- group by
- aid,
- uid
- ) a
- group by
- aid
- )y on x.aid = y.aid
- <if test="depNo !=null">
- where c.dep_no like concat(#{depNo,jdbcType=VARCHAR},'%')
- </if>
- </select>
-
- <select id="followStatisticCount" resultType="java.lang.Integer">
- select count(0) from (
- select
- aid
- from user_follow where 1=1
- <if test="sDate != null">
- and create_time > #{sDate,jdbcType=DATE}
- </if>
- <if test="sDate != null">
- and create_time < #{eDate,jdbcType=DATE}
- </if>
- group by aid
- )x
- left join admin b on x.aid = b.id
- left join department_management c on b.department_id = c.id
- <if test="depNo !=null">
- where c.dep_no like concat(#{depNo,jdbcType=VARCHAR},'%')
- </if>
- </select>
-
- <select id="findBusinessByFollowId" parameterType="java.lang.String" resultType="com.goafanti.common.model.UserBusiness">
- select
- a.id,
- a.follow_situation as followSituation,
- a.customer_status as customerStatus,
- a.remarks,
- a.business_glossory_id as businessGlossoryId
- from
- user_follow_business a
- where a.follow_id = #{followId,jdbcType=VARCHAR}
- </select>
-
- <select id="selectBusinessList" resultType="com.goafanti.customer.bo.BusinessListBo">
- select
- c.name as businessName,
- b.identify_name as identifyName,
- a.id as businessId,
- a.create_time as createTime,
- a.update_time as updateTime,
- a.follow_situation as followSituation,
- a.customer_status as customerStatus,
- d.name as adminName
- from
- user_business a inner join user b on
- a.uid = b.id left join business_glossory c on
- a.business_glossory_id = c.id left join admin d on
- a.aid = d.id
- where 1 = 1
- <if test="aid != null and aid != ''">
- and a.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="uid != null and uid !=''">
- and a.uid = #{uid,jdbcType=VARCHAR}
- </if>
- <if test="businessGlossoryId !=null and businessGlossoryId != ''">
- and a.business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
- </if>
- <if test="identifyName != null and identifyName != ''">
- and b.identify_name like concat('%', #{identifyName},'%')
- </if>
- <if test="followSituation != null">
- and a.follow_situation = #{followSituation,jdbcType=INTEGER}
- </if>
- <if test="customerStatus != null">
- and a.customer_status = #{customerStatus,jdbcType=INTEGER}
- </if>
- <if test="adminName != null and adminName != ''">
- and d.name = #{adminName,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and startDate != ''">
- and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endDate != null and endDate != ''">
- and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
-
- <select id="selectBusinessCount" parameterType="com.goafanti.customer.bo.BusinessListBo" resultType="java.lang.Integer">
- select
- count(0)
- from
- user_business a inner join user b on
- a.uid = b.id left join business_glossory c on
- a.business_glossory_id = c.id left join admin d on
- a.aid = d.id
- where 1 = 1
- <if test="aid != null and aid != ''">
- and a.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="uid != null and uid !=''">
- and a.uid = #{uid,jdbcType=VARCHAR}
- </if>
- <if test="businessGlossoryId !=null and businessGlossoryId != ''">
- and a.business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
- </if>
- <if test="identifyName != null and identifyName != ''">
- and b.identify_name like concat('%', #{identifyName},'%')
- </if>
- <if test="followSituation != null">
- and a.follow_situation = #{followSituation,jdbcType=INTEGER}
- </if>
- <if test="customerStatus != null">
- and a.customer_status = #{customerStatus,jdbcType=INTEGER}
- </if>
- <if test="adminName != null and adminName != ''">
- and d.name = #{adminName,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and startDate != ''">
- and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endDate != null and endDate != ''">
- and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
- </if>
- </select>
-
- <select id="selectBusinessManageList" resultType="com.goafanti.customer.bo.BusinessListBo">
- select
- c.name as businessName,
- b.identify_name as identifyName,
- a.id as businessId,
- a.create_time as createTime,
- a.update_time as updateTime,
- a.follow_situation as followSituation,
- a.customer_status as customerStatus,
- d.name as adminName
- from
- user_business a inner join user b on
- a.uid = b.id left join business_glossory c on
- a.business_glossory_id = c.id left join admin d on
- a.aid = d.id
- LEFT JOIN department_management dm on dm.id = d.department_id
- where 1 = 1
- <if test="aid != null and aid != ''">
- and (b.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
- </if>
- <if test="uid != null and uid !=''">
- and a.uid = #{uid,jdbcType=VARCHAR}
- </if>
- <if test="businessGlossoryId !=null and businessGlossoryId != ''">
- and a.business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
- </if>
- <if test="identifyName != null and identifyName != ''">
- and b.identify_name like concat('%', #{identifyName},'%')
- </if>
- <if test="followSituation != null">
- and a.follow_situation = #{followSituation,jdbcType=INTEGER}
- </if>
- <if test="customerStatus != null">
- and a.customer_status = #{customerStatus,jdbcType=INTEGER}
- </if>
- <if test="adminName != null and adminName != ''">
- and d.name = #{adminName,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and startDate != ''">
- and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endDate != null and endDate != ''">
- and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
-
- <select id="selectBusinessManageCount" parameterType="com.goafanti.customer.bo.BusinessListBo" resultType="java.lang.Integer">
- select
- count(0)
- from
- user_business a inner join user b on
- a.uid = b.id left join business_glossory c on
- a.business_glossory_id = c.id left join admin d on
- a.aid = d.id
- LEFT JOIN department_management dm on dm.id = d.department_id
- where 1 = 1
- <if test="aid != null and aid != ''">
- and (b.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
- </if>
- <if test="uid != null and uid !=''">
- and a.uid = #{uid,jdbcType=VARCHAR}
- </if>
- <if test="businessGlossoryId !=null and businessGlossoryId != ''">
- and a.business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
- </if>
- <if test="identifyName != null and identifyName != ''">
- and b.identify_name like concat('%', #{identifyName},'%')
- </if>
- <if test="followSituation != null">
- and a.follow_situation = #{followSituation,jdbcType=INTEGER}
- </if>
- <if test="customerStatus != null">
- and a.customer_status = #{customerStatus,jdbcType=INTEGER}
- </if>
- <if test="adminName != null and adminName != ''">
- and d.name = #{adminName,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and startDate != ''">
- and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endDate != null and endDate != ''">
- and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
- </if>
- </select>
-
- <select id="selectManagePersonalCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
- select
- a.id as uid,
- a.type,
- a.status,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
- a.business_audit as businessAudit,
- a.current_member_status as currentMemberStatus,
- a.identify_name as name,
- a.lvl,a.is_member as isMember,
- a.society_tag as societyTag,
- a.share_type as shareType,
- b.contacts,
- b.contact_mobile as contactMobile,
- b.international,
- b.expert,
- b.audit_status as auditStatus,
- dg1.name as province,
- dg2.name as city,
- dg3.name as area,
- c.name as industry,
- d.name as adminName,
- b.expert_audit as expertAudit,
- b.release_status as releaseStatus
- from user a inner join user_identity b on a.id = b.uid
- left join district_glossory dg1 on b.province = dg1.id
- left join district_glossory dg2 on b.city = dg2.id
- left join district_glossory dg3 on b.area = dg3.id
- left join industry_category c on b.industry = c.id
- left join admin d on a.aid = d.id
- LEFT JOIN department_management dm on dm.id = d.department_id
- where a.type = 0 and a.status != 1 and a.audit_status = 1
- and a.share_type =0
- <if test="aid != null and aid !=''">
- and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
- </if>
- <if test="name != null and name != ''">
- and a.identify_name like concat('%',#{name},'%')
- </if>
- <if test="shareType != null">
- and a.share_type = #{shareType,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and a.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="businessAudit != null">
- and a.business_audit = #{businessAudit,jdbcType=INTEGER}
- </if>
- <if test="isMember != null">
- and a.is_member = #{isMember,jdbcType=INTEGER}
- </if>
- <if test="lvl != null">
- and a.lvl = #{lvl,jdbcType=INTEGER}
- </if>
- <if test="currentMemberStatus != null">
- and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
- </if>
- <if test="societyTag != null and societyTag != ''">
- and a.society_tag = #{societyTag,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and startDate != ''">
- and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endDate != null and endDate != ''">
- and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="province != null">
- and b.province = #{province,jdbcType=INTEGER}
- </if>
- <if test="city != null">
- and b.city = #{city,jdbcType=INTEGER}
- </if>
- <if test="area != null">
- and b.area = #{area,jdbcType=INTEGER}
- </if>
- <if test="industry != null">
- and b.industry = #{industry,jdbcType=INTEGER}
- </if>
- <if test="expert != null">
- and b.expert = #{expert,jdbcType=INTEGER}
- </if>
- <if test="international != null">
- and b.international = #{international,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and b.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <select id="selectManagePersonalCustomerCount" resultType="java.lang.Integer">
- select count(0)
- from user a inner join user_identity b on a.id = b.uid
- left join admin d on a.aid = d.id
- LEFT JOIN department_management dm on dm.id = d.department_id
- where a.type = 0 and a.status != 1 and a.audit_status = 1
- <if test="aid != null and aid !=''">
- and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
- </if>
- <if test="name != null and name != ''">
- and a.identify_name like concat('%',#{name},'%')
- </if>
- <if test="shareType != null">
- and a.share_type = #{shareType,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and a.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="businessAudit != null">
- and a.business_audit = #{businessAudit,jdbcType=INTEGER}
- </if>
- <if test="isMember != null">
- and a.is_member = #{isMember,jdbcType=INTEGER}
- </if>
- <if test="lvl != null">
- and a.lvl = #{lvl,jdbcType=INTEGER}
- </if>
- <if test="currentMemberStatus != null">
- and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
- </if>
- <if test="societyTag != null and societyTag != ''">
- and a.society_tag = #{societyTag,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and startDate != ''">
- and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endDate != null and endDate != ''">
- and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="province != null">
- and b.province = #{province,jdbcType=INTEGER}
- </if>
- <if test="city != null">
- and b.city = #{city,jdbcType=INTEGER}
- </if>
- <if test="area != null">
- and b.area = #{area,jdbcType=INTEGER}
- </if>
- <if test="industry != null">
- and b.industry = #{industry,jdbcType=INTEGER}
- </if>
- <if test="expert != null">
- and b.expert = #{expert,jdbcType=INTEGER}
- </if>
- <if test="international != null">
- and b.international = #{international,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and b.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- </select>
-
- <select id="selectManageOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
- select
- a.id as uid,
- a.type,
- a.status,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
- a.business_audit as businessAudit,
- a.current_member_status as currentMemberStatus,
- a.identify_name as name,
- a.lvl,
- a.is_member as isMember,
- a.society_tag as societyTag,
- share_type as shareType,
- b.contacts,
- b.contact_mobile as contactMobile,
- b.international,
- b.listed,
- b.high_tech_zone as highTechZone,
- b.audit_status as auditStatus,
- dg1.name as province,
- dg2.name as city,
- dg3.name as area,
- c.name as industry,
- d.name as adminName
- from user a inner join organization_identity b on a.id = b.uid
- left join district_glossory dg1 on b.location_province = dg1.id
- left join district_glossory dg2 on b.location_city = dg2.id
- left join district_glossory dg3 on b.location_area = dg3.id
- left join industry_category c on b.industry = c.id
- left join admin d on a.aid = d.id
- LEFT JOIN department_management dm on dm.id = d.department_id
- where a.type = 1 and a.status != 1 and a.audit_status = 1
- <if test="aid != null and aid !=''">
- and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
- </if>
- <if test="name != null and name != ''">
- and a.identify_name like concat('%',#{name},'%')
- </if>
- <if test="shareType != null">
- and a.share_type = #{shareType,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and a.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="businessAudit != null">
- and a.business_audit = #{businessAudit,jdbcType=INTEGER}
- </if>
- <if test="isMember != null">
- and a.is_member = #{isMember,jdbcType=INTEGER}
- </if>
- <if test="currentMemberStatus != null">
- and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
- </if>
- <if test="lvl != null">
- and a.lvl = #{lvl,jdbcType=INTEGER}
- </if>
- <if test="societyTag != null and societyTag != ''">
- and a.society_tag = #{societyTag,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and startDate != ''">
- and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endDate != null and endDate != ''">
- and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="province != null">
- and b.location_province = #{province,jdbcType=INTEGER}
- </if>
- <if test="city != null">
- and b.location_city = #{city,jdbcType=INTEGER}
- </if>
- <if test="area != null">
- and b.location_area = #{area,jdbcType=INTEGER}
- </if>
- <if test="industry != null">
- and b.industry = #{industry,jdbcType=INTEGER}
- </if>
- <if test="listed != null">
- and b.listed = #{listed,jdbcType=INTEGER}
- </if>
- <if test="highTechZone != null">
- and b.high_tech_zone = #{highTechZone,jdbcType=INTEGER}
- </if>
- <if test="international != null">
- and b.international = #{international,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and b.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
-
- <select id="selectManageOrganizationCustomerCount" resultType="java.lang.Integer">
- select
- count(0)
- from user a inner join organization_identity b on a.id = b.uid
- left join admin d on a.aid = d.id
- LEFT JOIN department_management dm on dm.id = d.department_id
- where a.type = 1 and a.status != 1 and a.audit_status = 1
- <if test="aid != null and aid !=''">
- and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
- </if>
- <if test="name != null and name != ''">
- and a.identify_name like concat('%',#{name},'%')
- </if>
- <if test="shareType != null">
- and a.share_type = #{shareType,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and a.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="businessAudit != null">
- and a.business_audit = #{businessAudit,jdbcType=INTEGER}
- </if>
- <if test="currentMemberStatus != null">
- and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
- </if>
- <if test="isMember != null">
- and a.is_member = #{isMember,jdbcType=INTEGER}
- </if>
- <if test="societyTag != null and societyTag != ''">
- and a.society_tag = #{societyTag,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and startDate != ''">
- and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endDate != null and endDate != ''">
- and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="province != null">
- and b.location_province = #{province,jdbcType=INTEGER}
- </if>
- <if test="city != null">
- and b.location_city = #{city,jdbcType=INTEGER}
- </if>
- <if test="area != null">
- and b.location_area = #{area,jdbcType=INTEGER}
- </if>
- <if test="industry != null">
- and b.industry = #{industry,jdbcType=INTEGER}
- </if>
- <if test="listed != null">
- and b.listed = #{listed,jdbcType=INTEGER}
- </if>
- <if test="highTechZone != null">
- and b.high_tech_zone = #{highTechZone,jdbcType=INTEGER}
- </if>
- <if test="international != null">
- and b.international = #{international,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and b.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- </select>
-
- <select id="findAdminName" resultType="com.goafanti.customer.bo.CustomerListOut">
- select d.name as adminName,d.id as aid
- from admin d left join department_management dm on dm.id = d.department_id
- where d.department_id=(select department_id from admin where id=#{aid,jdbcType=INTEGER})
- </select>
-
- <select id="findEnteringAuditList" resultType="com.goafanti.customer.bo.CustomerListOut">
- select u.id as uid,u.nickname as name,u.mobile as contactMobile,a.name as adminName,u.create_time as createTime,u.audit_status as auditStatus
- from user u left join admin a on u.aid=a.id
- where u.audit_status=0 and u.status != 1 and u.share_type=0
- <if test="aid != null and aid !=''">
- and u.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="name != null and name != ''">
- and u.nickname = #{name,jdbcType=VARCHAR}
- </if>
- <if test="adminName != null and adminName != ''">
- and a.name = #{adminName,jdbcType=VARCHAR}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findEnteringAuditCount" resultType="java.lang.Integer">
- select
- count(0)
- from user u left join admin a on u.aid=a.id
- where u.audit_status=0 and u.status != 1 and u.share_type=0
- <if test="aid != null and aid !=''">
- and u.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="name != null and name != ''">
- and u.nickname = #{name,jdbcType=VARCHAR}
- </if>
- <if test="adminName != null and adminName != ''">
- and a.name = #{adminName,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="findEnteringAuditIsNoList" resultType="com.goafanti.customer.bo.CustomerListOut">
- select u.id as uid,u.nickname as name,u.mobile as contactMobile,a.name as adminName,u.create_time as createTime,
- u.audit_status as auditStatus,u.audit_opinion as auditOpinion
- from user u left join admin a on u.aid=a.id
- where u.audit_status=2 and u.status != 1
- <if test="aid != null and aid !=''">
- and u.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="name != null and name != ''">
- and u.nickname = #{name,jdbcType=VARCHAR}
- </if>
- <if test="adminName != null and adminName != ''">
- and a.name = #{adminName,jdbcType=VARCHAR}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findEnteringAuditIsNoCount" resultType="java.lang.Integer">
- select
- count(0)
- from user u left join admin a on u.aid=a.id
- where u.audit_status=2 and u.status != 1
- <if test="aid != null and aid !=''">
- and u.aid = #{aid,jdbcType=VARCHAR}
- </if>
- <if test="name != null and name != ''">
- and u.nickname = #{name,jdbcType=VARCHAR}
- </if>
- <if test="adminName != null and adminName != ''">
- and a.name = #{adminName,jdbcType=VARCHAR}
- </if>
- </select>
- </mapper>
|