| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268 |
- <?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
- 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 b.expert_audit=2
- <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.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>
|