select
a.id as uid,
a.identify_name as name,
date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
dg1.name as province,
dg2.name as city,
dg3.name as area,
d.name as adminName
from user a
left 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 admin d on a.aid = d.id
where a.type = 0 and a.status != 1
and a.aid = #{aid,jdbcType=VARCHAR}
and a.identify_name like concat('%',#{name},'%')
and a.transfer_time > #{startDate}
and a.transfer_time < #{endDate}
and b.province = #{province,jdbcType=INTEGER}
and b.city = #{city,jdbcType=INTEGER}
and b.area = #{area,jdbcType=INTEGER}
${page_sql}
select
count(0)
from user a
left 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 admin d on a.aid = d.id
where a.type = 0 and a.status != 1
and a.aid = #{aid,jdbcType=VARCHAR}
and a.identify_name like concat('%',#{name},'%')
and a.transfer_time > #{startDate}
and a.transfer_time < #{endDate}
and b.province = #{province,jdbcType=INTEGER}
and b.city = #{city,jdbcType=INTEGER}
and b.area = #{area,jdbcType=INTEGER}
select t0.id as uid,
t0.aid,
date_format(t0.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime,
date_format(t0.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
t0.identify_name as name,
t0.society_tag as societyTag,
date_format(t1.last_follow_time,'%Y-%m-%d %H:%i:%S') as lastFollowTime,
date_format(t2.last_sign_time,'%Y-%m-%d %H:%i:%S') as lastSignTime,
b.contacts,
b.contact_mobile as contactMobile,
dg1.name as province,
dg2.name as city,
dg3.name as area,
ifnull(t1.last_follow_time,t0.transfer_time) as orderTime,
c.name as industry,
d.name as adminName
from
(select id,aid,type,share_type,create_time,transfer_time,identify_name,society_tag from user where aid = #{aid} and type = 0 and share_type = 0 and status != 1)t0
left join
(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
on t0.id = t1.uid left join
(select aid,uid,max(lock_time) as last_sign_time from user_lock_release where aid = #{aid} group by uid)t2
on t0.id = t2.uid
left join user_identity b on t0.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 t0.aid = d.id where 1=1
and t0.identify_name like concat('%',#{name},'%')
and t0.transfer_time > #{startDate}
and t0.transfer_time < #{endDate}
and b.province = #{province,jdbcType=INTEGER}
and b.city = #{city,jdbcType=INTEGER}
and b.area = #{area,jdbcType=INTEGER}
order by orderTime
${page_sql}
select count(0)
from
(select id,aid,type,share_type,transfer_time,identify_name,society_tag from user where aid = #{aid} and type = 0 and share_type = 0 and status != 1)t0
left join user_identity b on t0.id = b.uid where 1=1
and t0.identify_name like concat('%',#{name},'%')
and t0.transfer_time > #{startDate}
and t0.transfer_time < #{endDate}
and b.province = #{province,jdbcType=INTEGER}
and b.city = #{city,jdbcType=INTEGER}
and b.area = #{area,jdbcType=INTEGER}
select
a.id as uid,
a.aid,
a.identify_name as name,
a.create_time as createTime,
a.transfer_time as transferTime,
b.contacts,
b.contact_mobile as contactMobile,
dg1.name as province,
dg2.name as city,
dg3.name as area
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
where
a.type = 0 and a.share_type = 1 and a.status != 1
and a.aid = #{aid,jdbcType=VARCHAR}
and a.identify_name like concat('%',#{name},'%')
and a.transfer_time > #{startDate}
and a.transfer_time < #{endDate}
and b.province = #{province,jdbcType=INTEGER}
and b.city = #{city,jdbcType=INTEGER}
and b.area = #{area,jdbcType=INTEGER}
order by a.create_time
${page_sql}
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
where
a.type = 0 and a.share_type = 1 and a.status != 1
and a.aid = #{aid,jdbcType=VARCHAR}
and a.identify_name like concat('%',#{name},'%')
and a.transfer_time > #{startDate}
and a.transfer_time < #{endDate}
and b.province = #{province,jdbcType=INTEGER}
and b.city = #{city,jdbcType=INTEGER}
and b.area = #{area,jdbcType=INTEGER}
select
t0.uid as uid,
date_format(t0.update_time,'%Y-%m-%d %H:%i:%S') as lastSignTime,
date_format(t1.last_follow_time,'%Y-%m-%d %H:%i:%S') as lastFollowTime,
t2.society_tag as societyTag,
t2.identify_name as name,
t2.share_type as shareType,
date_format(t2.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime,
dg1.name as province,
dg2.name as city,
dg3.name as area,
b.contacts,
b.contact_mobile as contactMobile,
c.name as industry,
d.name as adminName
from
(select uid,aid,max(lock_time) as update_time
from user_lock_release
where type=1 and aid= #{aid,jdbcType=VARCHAR}
group by uid)t0
left join
(select uid,aid,max(create_time) as last_follow_time from user_follow where aid =#{aid,jdbcType=VARCHAR} group by uid)t1
on t0.uid = t1.uid
inner join
(select id,aid,share_type,society_tag,identify_name,transfer_time from user where type = 0 and status != 1)t2
on t0.uid = t2.id
left join user_identity b on t0.uid = 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 t2.aid = d.id where 1 = 1
and t2.identify_name like concat('%',#{name},'%')
and t2.share_type = #{shareType,jdbcType=VARCHAR}
and t2.transfer_time > #{startDate}
and t2.transfer_time < #{endDate}
and b.province = #{province,jdbcType=INTEGER}
and b.city = #{city,jdbcType=INTEGER}
and b.area = #{area,jdbcType=INTEGER}
${page_sql}
select
count(0)
from
(select uid,aid,max(lock_time) as update_time
from user_lock_release
where type=1 and aid= #{aid,jdbcType=VARCHAR}
group by uid)t0
inner join
(select id,aid,share_type,society_tag,identify_name,transfer_time from user where type = 0 and status != 1)t2
on t0.uid = t2.id
left join user_identity b on t0.uid = b.uid
where 1 = 1
and t2.identify_name like concat('%',#{name},'%')
and t2.share_type = #{shareType,jdbcType=VARCHAR}
and t2.transfer_time > #{startDate}
and t2.transfer_time < #{endDate}
and b.province = #{province,jdbcType=INTEGER}
and b.city = #{city,jdbcType=INTEGER}
and b.area = #{area,jdbcType=INTEGER}
select DISTINCT
a.id as uid,
a.nickname as name,
date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
dg1.name as province,
dg2.name as city,
dg3.name as area,
a.aid,
a.sign_bills signBills,
a.share_type as shareType,
a.channel ,
a.information_maintainer as mid
from `user` a
left join user_names un on a.id=un.uid
left 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 admin d on a.aid = d.id
where a.type = 1 and a.status =0
and un.name = #{name}
and un.name like concat('%', #{name},'%')
and a.aid = #{aid,jdbcType=VARCHAR}
and d.department_id=#{departmentId,jdbcType=VARCHAR}
and a.transfer_time > #{startDate}
and a.transfer_time < #{endDate}
and b.location_province = #{province,jdbcType=INTEGER}
and b.location_city = #{city,jdbcType=INTEGER}
and b.location_area = #{area,jdbcType=INTEGER}
${page_sql}
select
count(0)
from(select a.id from `user` a
left join user_names un on a.id=un.uid
left join organization_identity b on a.id = b.uid
INNER join (select id
from admin
where department_id=#{departmentId,jdbcType=VARCHAR}) d on a.aid = d.id
where a.type = 1 and a.status =0
and un.name = #{name}
and un.name like concat('%', #{name},'%')
and a.aid = #{aid,jdbcType=VARCHAR}
and a.transfer_time > #{startDate}
and a.transfer_time < #{endDate}
and b.location_province = #{province,jdbcType=INTEGER}
and b.location_city = #{city,jdbcType=INTEGER}
and b.location_area = #{area,jdbcType=INTEGER}
group by a.id)x
select
a.id as uid,
a.nickname as name,
a.create_time as createTime,
a.transfer_time as transferTime,
dg1.name as province,
dg2.name as city,
dg3.name as area
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
where a.type = 1 and a.share_type = 1 and a.status = 0 and a.source in(1,2,3)
and a.aid = #{aid,jdbcType=VARCHAR}
and a.nickname like concat('%',#{name},'%')
and a.transfer_time > #{startDate}
and a.transfer_time < #{endDate}
and b.location_province = #{province,jdbcType=INTEGER}
and b.location_city = #{city,jdbcType=INTEGER}
and b.location_area = #{area,jdbcType=INTEGER}
order by a.transfer_time desc
order by a.transfer_time
${page_sql}
select
count(0)
from user a
inner join organization_identity b on a.id = b.uid
where a.type = 1 and a.share_type = 1 and a.status = 0 and a.source in(1,2,3)
and a.aid = #{aid,jdbcType=VARCHAR}
and a.nickname like concat('%',#{name},'%')
and a.transfer_time > #{startDate}
and a.transfer_time < #{endDate}
and b.location_province = #{province,jdbcType=INTEGER}
and b.location_city = #{city,jdbcType=INTEGER}
and b.location_area = #{area,jdbcType=INTEGER}
select
a.id as uid,
a.society_tag as societyTag,
a.nickname as name,
a.share_type as shareType,
date_format(a.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime,
dg1.name as province,
dg2.name as city,
dg3.name as area,
c.name as industry,
a.channel,
b.intended_project intendedProject,
b.business_scope businessScope,
d.name as adminName
from user a
left 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.share_type =2
and a.aid = #{aid}
and a.channel= #{channel}
and a.nickname like concat('%',#{name},'%')
and a.share_type = #{shareType,jdbcType=VARCHAR}
and a.transfer_time > #{startDate}
and a.transfer_time < #{endDate}
and b.location_province = #{province,jdbcType=INTEGER}
and b.location_city = #{city,jdbcType=INTEGER}
and b.location_area = #{area,jdbcType=INTEGER}
order by a.transfer_time desc,a.`number`
${page_sql}
select count(0) from user a
left join organization_identity b on a.id = b.uid
where a.share_type =2
and a.aid = #{aid}
and a.channel= #{channel}
and a.identify_name like concat('%',#{name},'%')
and a.share_type = #{shareType,jdbcType=VARCHAR}
and a.transfer_time > #{startDate}
and a.transfer_time < #{endDate}
and b.location_province = #{province,jdbcType=INTEGER}
and b.location_city = #{city,jdbcType=INTEGER}
and b.location_area = #{area,jdbcType=INTEGER}
select id,nickname as name from user where identify_name like
concat('%',#{identifyName},'%') and status 1 and audit_status = 1
select count(0) from user where identify_name = #{identifyName,jdbcType=VARCHAR}
and status 1
select a.id as uid, a.society_tag as societyTag, a.company_logo_url as companyLogoUrl, a.introduction, a.identify_name as identifyName,
a.nickname, 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.org_code as orgCode, b.org_code_url as orgCodeUrl, b.business_scope as businessScope,
b.sales_target salesTarget, b.id, b.contacts, b.contact_mobile as contactMobile, b.licence_number as licenceNumber, a.aid as aid,
d.name as adminName, a.information_maintainer as informationMaintainer, c.name as informationMaintainerName, a.core_technology as coreTechnology,
a. accomplish_situation as accomplishSituation, a.intellectual_property as intellectualProperty, b.year_sales_amount as yearSalesAmount,
b.last_year_research_amount as lastYearResearchAmount, b.assets, b.qualification, b.cooperation_situation as cooperationSituation,
a.credit_rating as creditRating, e.poject_application_url as pojectApplicationUrl
from user a inner join organization_identity b on a.id = b.uid
left join admin d on d.id = a.aid left join admin c on c.id = a.information_maintainer
left join organization_application_info e on a.id=e.uid where
a.id = #{uid,jdbcType=VARCHAR}
select
a.id as uid,
a.identify_name as identifyName,
a.society_tag as societyTag,
a.head_portrait_url as headPortraitUrl,
a.introduction,
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.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 a.id as followId, a.aid,date_format( a.create_time,'%Y-%m-%d %H:%i:%S') as followTime, a.contact_type as contactType,
a.result,a.guidance, b.nickname,b.identify_name as identifyName, c.name as contacts, c.mobile as contactMobile,pr.supplement ,pr.id prid,
d.name as adminName,date_format(a.guidance_time,'%Y-%m-%d %H:%i:%S') as guidanceTime,a.guidance_name guidanceName,
pr.plan ,pr.next_plan nextPlan ,pr.expected_effect expectedEffect
,e.id as ufbId,e.follow_situation as followSituation,e.customer_status as customerStatus
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 left join public_release pr on a.id =pr.ufid
inner join user_follow_business e on a.id = e.follow_id
where a.effective = 0
and a.uid = #{uid,jdbcType=VARCHAR}
and a.aid = #{aid,jdbcType=VARCHAR}
and e.business_project_id = #{businessProjectId,jdbcType=VARCHAR}
order by a.create_time desc
${page_sql}
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
inner join user_follow_business e on a.id = e.follow_id
where a.effective = 0
and a.uid = #{uid,jdbcType=VARCHAR}
and a.aid = #{aid,jdbcType=VARCHAR}
and e.business_project_id = #{businessProjectId,jdbcType=VARCHAR}
select
id,
mobile,
nickname,
create_time as createTime,
type,
source,
email,
identify_name as identifyName,
status,
guidance
from
user
where id = #{uid,jdbcType=VARCHAR}
select a.id,a.name,a.mobile,a.email,a.qq,a.wechat,a.department,a.position,a.major,a.fixed_tel fixedTel,ad.name aname,b.location_province,
d1.name provinceName,d2.name cityName,d3.name areaName,date_format(a.create_time,'%Y-%m-%d')createTimes,a.aid
from organization_contact_book a left join admin ad on a.aid=ad.id
left join organization_identity b on a.uid=b.uid left join district_glossory d1 on b.location_province=d1.id
left join district_glossory d2 on b.location_city=d2.id left join district_glossory d3 on b.location_area=d3.id
where a.uid = #{uid,jdbcType=VARCHAR}
and a.aid= #{aid,jdbcType=VARCHAR}
order by a.create_time desc
select id,name,mobile,major,sex,department,position,wechat,qq from organization_contact_book
where uid = #{uid,jdbcType=VARCHAR}
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 contactMobile,
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 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
and create_time > #{sDate,jdbcType=DATE}
and create_time < #{eDate,jdbcType=DATE}
and business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
group by aid
)a
left join admin b on a.aid = b.id
left join department c on b.department_id = c.id
where c.dep_no like concat(#{depNo,jdbcType=VARCHAR},'%')
${page_sql}
select count(0) from (
select
aid
from user_business where 1=1
and create_time > #{sDate,jdbcType=DATE}
and create_time < #{eDate,jdbcType=DATE}
and business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
group by aid
)a
left join admin b on a.aid = b.id
left join department c on b.department_id = c.id
where c.dep_no like concat(#{depNo,jdbcType=VARCHAR},'%')
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
and create_time > #{sDate,jdbcType=DATE}
and create_time < #{eDate,jdbcType=DATE}
and business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
group by aid
)a
left join admin b on a.aid = b.id
left join department c on b.department_id = c.id
where c.dep_no like concat(#{depNo,jdbcType=VARCHAR},'%')
${page_sql}
select count(0) from (
select
aid
from user_business where 1=1
and create_time > #{sDate,jdbcType=DATE}
and create_time < #{eDate,jdbcType=DATE}
and business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
group by aid
)a
left join admin b on a.aid = b.id
left join department c on b.department_id = c.id
where c.dep_no like concat(#{depNo,jdbcType=VARCHAR},'%')
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,
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
and create_time > #{sDate,jdbcType=DATE}
and create_time < #{eDate,jdbcType=DATE}
group by aid
)x
left join admin b on x.aid = b.id
left join department 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
where c.dep_no like concat(#{depNo,jdbcType=VARCHAR},'%')
select count(0) from (
select
aid
from user_follow where 1=1
and create_time > #{sDate,jdbcType=DATE}
and create_time < #{eDate,jdbcType=DATE}
group by aid
)x
left join admin b on x.aid = b.id
left join department c on b.department_id = c.id
where c.dep_no like concat(#{depNo,jdbcType=VARCHAR},'%')
select
a.id as ufbId,
a.follow_situation as followSituation,
a.customer_status as customerStatus,
a.remarks,
a.business_project_id as businessProjectId,
b.bname as businessProjectName,
c.cname as businessVarietiesName
from
user_follow_business a
left join business_project b on a.business_project_id = b.id
left join business_category c on b.cid = c.id
where
a.follow_id = #{followId,jdbcType=VARCHAR}
select
c.bname as businessName,
b.identify_name as identifyName,
a.id as businessId,
a.business_project_id as businessProjectId,
a.create_time as createTime,
a.update_time as updateTime,
a.follow_situation as followSituation,
a.customer_status as customerStatus,
a.remarks,
d.name as adminName
from
user_business a inner join user b on
a.uid = b.id left join business_project c on
a.business_project_id = c.id left join admin d on
a.aid = d.id
where 1 = 1
and a.aid = #{aid,jdbcType=VARCHAR}
and a.uid = #{uid,jdbcType=VARCHAR}
and a.business_project_id = #{businessProjectId,jdbcType=VARCHAR}
and b.identify_name like concat('%', #{identifyName},'%')
and a.follow_situation = #{followSituation,jdbcType=INTEGER}
and a.customer_status = #{customerStatus,jdbcType=INTEGER}
and d.name = #{adminName,jdbcType=VARCHAR}
and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
order by a.create_time desc
${page_sql}
select
count(*)
from
user_business a inner join user b on
a.uid = b.id left join business_project c on
a.business_project_id = c.id left join admin d on
a.aid = d.id
where 1 = 1
and a.aid = #{aid,jdbcType=VARCHAR}
and a.uid = #{uid,jdbcType=VARCHAR}
and a.business_project_id = #{businessProjectId,jdbcType=VARCHAR}
and b.identify_name like concat('%', #{identifyName},'%')
and a.follow_situation = #{followSituation,jdbcType=INTEGER}
and a.customer_status = #{customerStatus,jdbcType=INTEGER}
and d.name = #{adminName,jdbcType=VARCHAR}
and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
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_project_id = c.id left join admin d on
a.aid = d.id
left join department dm on dm.id = d.department_id
where 1 = 1
and (b.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
and a.uid = #{uid,jdbcType=VARCHAR}
and a.business_project_id = #{businessProjectId,jdbcType=VARCHAR}
and b.identify_name like concat('%', #{identifyName},'%')
and a.follow_situation = #{followSituation,jdbcType=INTEGER}
and a.customer_status = #{customerStatus,jdbcType=INTEGER}
and d.name = #{adminName,jdbcType=VARCHAR}
and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
order by a.create_time desc
${page_sql}
select
count(0)
from
user_business a inner join user b on
a.uid = b.id left join business_glossory c on
a.business_project_id = c.id left join admin d on
a.aid = d.id
left join department dm on dm.id = d.department_id
where 1 = 1
and (b.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
and a.uid = #{uid,jdbcType=VARCHAR}
and a.business_project_id = #{businessProjectId,jdbcType=VARCHAR}
and b.identify_name like concat('%', #{identifyName},'%')
and a.follow_situation = #{followSituation,jdbcType=INTEGER}
and a.customer_status = #{customerStatus,jdbcType=INTEGER}
and d.name = #{adminName,jdbcType=VARCHAR}
and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
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.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 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
and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
and a.identify_name like concat('%',#{name},'%')
and a.share_type = #{shareType,jdbcType=INTEGER}
and a.status = #{status,jdbcType=INTEGER}
and a.business_audit = #{businessAudit,jdbcType=INTEGER}
and a.is_member = #{isMember,jdbcType=INTEGER}
and a.lvl = #{lvl,jdbcType=INTEGER}
and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
and a.society_tag = #{societyTag,jdbcType=VARCHAR}
and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
and b.province = #{province,jdbcType=INTEGER}
and b.city = #{city,jdbcType=INTEGER}
and b.area = #{area,jdbcType=INTEGER}
and b.industry = #{industry,jdbcType=INTEGER}
and b.expert = #{expert,jdbcType=INTEGER}
and b.international = #{international,jdbcType=INTEGER}
and b.audit_status = #{auditStatus,jdbcType=INTEGER}
${page_sql}
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 dm on dm.id = d.department_id
where a.type = 0 and a.status != 1 and a.audit_status = 1
and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
and a.identify_name like concat('%',#{name},'%')
and a.share_type = #{shareType,jdbcType=VARCHAR}
and a.status = #{status,jdbcType=INTEGER}
and a.business_audit = #{businessAudit,jdbcType=INTEGER}
and a.is_member = #{isMember,jdbcType=INTEGER}
and a.lvl = #{lvl,jdbcType=INTEGER}
and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
and a.society_tag = #{societyTag,jdbcType=VARCHAR}
and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
and b.province = #{province,jdbcType=INTEGER}
and b.city = #{city,jdbcType=INTEGER}
and b.area = #{area,jdbcType=INTEGER}
and b.industry = #{industry,jdbcType=INTEGER}
and b.expert = #{expert,jdbcType=INTEGER}
and b.international = #{international,jdbcType=INTEGER}
and b.audit_status = #{auditStatus,jdbcType=INTEGER}
select
a.id as uid,
a.type,
a.status,
date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
a.nickname as name,
a.society_tag as societyTag,
share_type as shareType,
b.contacts,
b.contact_mobile as contactMobile,
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 dm on dm.id = d.department_id
where a.type = 1 and a.status != 1 and a.audit_status = 1 and a.share_type in (0,2,3)
and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
and a.nickname like concat('%',#{name},'%')
and a.status = #{status,jdbcType=INTEGER}
and a.society_tag = #{societyTag,jdbcType=VARCHAR}
and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
and b.location_province = #{province,jdbcType=INTEGER}
and b.location_city = #{city,jdbcType=INTEGER}
and b.location_area = #{area,jdbcType=INTEGER}
${page_sql}
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 dm on dm.id = d.department_id
where a.type = 1 and a.status != 1 and a.audit_status = 1 and a.share_type in (0,2,3)
and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
and a.nickname like concat('%',#{name},'%')
and a.status = #{status,jdbcType=INTEGER}
and a.society_tag = #{societyTag,jdbcType=VARCHAR}
and a.create_time > STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
and a.create_time < STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
and b.location_province = #{province,jdbcType=INTEGER}
and b.location_city = #{city,jdbcType=INTEGER}
and b.location_area = #{area,jdbcType=INTEGER}
select d.name as adminName,d.id as aid
from admin d left join department dm on dm.id = d.department_id
where d.department_id=(select department_id from admin where id=#{aid,jdbcType=INTEGER})
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
and u.aid = #{aid,jdbcType=VARCHAR}
and u.nickname = #{name,jdbcType=VARCHAR}
and a.name = #{adminName,jdbcType=VARCHAR}
${page_sql}
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
and u.aid = #{aid,jdbcType=VARCHAR}
and u.nickname = #{name,jdbcType=VARCHAR}
and a.name = #{adminName,jdbcType=VARCHAR}
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,u.society_tag as societyTag
from user u left join admin a on u.aid=a.id
where u.audit_status=2 and u.status != 1
and u.aid = #{aid,jdbcType=VARCHAR}
and u.nickname = #{name,jdbcType=VARCHAR}
and a.name = #{adminName,jdbcType=VARCHAR}
${page_sql}
select
count(0)
from user u left join admin a on u.aid=a.id
where u.audit_status=2 and u.status != 1
and u.aid = #{aid,jdbcType=VARCHAR}
and u.nickname = #{name,jdbcType=VARCHAR}
and a.name = #{adminName,jdbcType=VARCHAR}
update user
set
nickname = #{nickname,jdbcType=VARCHAR},
mobile = #{mobile,jdbcType=VARCHAR},
society_tag = #{societyTag,jdbcType=VARCHAR},
audit_status=1
where id = #{id,jdbcType=VARCHAR}
select
a.id,
a.uid,
a.aid,
date_format( a.lock_time, '%Y-%m-%d %H:%i:%S' ) as lockTime,
a.business_project_id as businessProjectId,
b.bname as businessProjectName,
d.name as salesmanName
from
user_lock_release a left join business_project b on
a.business_project_id = b.id left join business_category c on
b.cid = c.id left join admin d on
a.aid = d.id
where 1 = 1
and a.uid = #{uid}
and a.aid = #{aid}
and a.business_project_id = #{businessProjectId}
and a.type = #{type}
and a.status = #{status}
select b.id,b.nickname as name from
(select uid from user_lock_release where type = 0 and status = 0 and aid = #{aid} group by uid) a
inner join user b on a.uid = b.id
where b.status != 1 and b.channel =0 and b.nickname like concat('%',#{name},'%')
select b.id,b.nickname as name from user b
where b.status != 1
and b.channel=1
and b.share_type=2
and b.aid = #{aid} and b.nickname like concat('%',#{name},'%')
update user a,user_lock_release b set a.share_type = 1,a.transfer_time = #{time}
,b.status=2,b.release_time= #{time}
where b.status=1 and b.`type`=0 and a.id=b.uid
select
aid,
count(0) as yearFollowNo,
ifnull(sum(case when contact_type = 0 then 1 else 0 end) ,0)as yearVisitNo,
ifnull(sum(case when contact_type = 1 then 1 else 0 end) ,0)as yearTelNo
from user_follow where 1=1
and aid = #{id,jdbcType=VARCHAR}
and create_time > #{dailyStart,jdbcType=VARCHAR}
and create_time < #{dailyEnd,jdbcType=VARCHAR}
GROUP BY aid
select
b.department_id,
count( 0 ) as yearFollowNo,
ifnull(
sum( case when a.contact_type = 0 then 1 else 0 end ),
0
) as yearVisitNo,
ifnull(
sum( case when a.contact_type = 1 then 1 else 0 end ),
0
) as yearTelNo
from user_follow a left join admin b on a.aid =b.id
where
1 = 1
and b.department_id = #{depId,jdbcType=VARCHAR}
and a.create_time > #{dailyStart,jdbcType=VARCHAR}
and a.create_time < #{dailyEnd,jdbcType=VARCHAR}
GROUP BY b.department_id
select
count( 0 ) as yearFollowNo,
ifnull(
sum( case when a.contact_type = 0 then 1 else 0 end ),
0
) as yearVisitNo,
ifnull(
sum( case when a.contact_type = 1 then 1 else 0 end ),
0
) as yearTelNo
from user_follow a left join admin b on a.aid =b.id
where
1 = 1
and b.department_id = #{depId,jdbcType=VARCHAR}
and a.create_time > #{dailyStart,jdbcType=VARCHAR}
and a.create_time < #{dailyEnd,jdbcType=VARCHAR}
select a.id,a.nickname as name,c.name as province,c1.name as city,c2.name as area,b.contacts,b.contact_mobile as contactMobile,
b.business_scope businessScope,date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,d.name as industry,
a.credit_rating as creditRating,a.integrity as dataGrade
from user a left join organization_identity b
on a.id=b.uid left join district_glossory c
on b.location_province=c.id left join district_glossory c1
on b.location_city=c1.id left join district_glossory c2
on b.location_area=c2.id left join industry_category d on b.industry = d.id
left join (select aid,uid,contact_type from user_follow where aid= #{aid,jdbcType=VARCHAR} and contact_type=0 GROUP by uid) e on a.id=e.uid and a.aid=e.aid
where a.status=0 and a.`type` =1 and a.new_channel=0
and a.information_maintainer = #{aid,jdbcType=VARCHAR}
and a.`type`=#{type,jdbcType=VARCHAR}
and (e.contact_type !=0 or e.contact_type is null)
and e.contact_type=0
and a.nickname like concat('%',#{name,jdbcType=VARCHAR},'%')
and b.business_scope like concat('%',#{businessScope},'%')
and a.share_type= #{shareType}
and b.location_province= #{province,jdbcType=VARCHAR}
and b.location_city=#{city,jdbcType=VARCHAR}
and b.location_area= #{area,jdbcType=VARCHAR}
and a.create_time > #{startDate}
and a.create_time < #{endDate}
and a.integrity !=1
and a.integrity =1
order by a.create_time desc,a.nickname desc
${page_sql}
select count(*)
from user a left join organization_identity b
on a.id=b.uid
left join (select aid,uid,contact_type from user_follow where aid= #{aid,jdbcType=VARCHAR} and contact_type=0 GROUP by uid) e on a.id=e.uid and a.aid=e.aid
where a.status=0 and a.`type` =1 and a.new_channel=0
and a.information_maintainer = #{aid,jdbcType=VARCHAR}
and a.`type`=#{type,jdbcType=VARCHAR}
and (e.contact_type !=0 or e.contact_type is null)
and e.contact_type=0
and a.nickname like concat('%',#{name,jdbcType=VARCHAR},'%')
and b.business_scope like concat('%',#{businessScope},'%')
and a.share_type= #{shareType}
and b.location_province= #{province,jdbcType=VARCHAR}
and b.location_city=#{city,jdbcType=VARCHAR}
and b.location_area= #{area,jdbcType=VARCHAR}
and a.create_time > #{startDate}
and a.create_time < #{endDate}
and a.integrity !=1
and a.integrity =1
select x.id,
x.name,
x.province,
x.city,
x.area ,
x.contacts,
x.contact_mobile as contactMobile,
date_format( x.create_time, '%Y-%m-%d %H:%i:%S' ) as createTime,
x.industry as industry,
y.name as iname,
x.integrity as dataGrade,
x.credit_rating as creditRating
from(
select
a.id,
a.nickname as name,
c.name as province,
c1.name as city,
c2.name as area,
b.contacts,
b.contact_mobile,
a.create_time,
d.name as industry,
a.credit_rating ,
a.information_maintainer,
a.integrity
from
user a left join organization_identity b on
a.id = b.uid left join district_glossory c
on b.location_province=c.id left join district_glossory c1
on b.location_city=c1.id left join district_glossory c2
on b.location_area=c2.id left join industry_category d
on b.industry = d.id
where a.status=0
and a.`type`=#{type,jdbcType=VARCHAR}
and a.nickname like concat('%',#{name,jdbcType=VARCHAR},'%')
and b.location_province= #{province,jdbcType=VARCHAR}
and b.location_city=#{city,jdbcType=VARCHAR}
and b.location_area= #{area,jdbcType=VARCHAR}
and a.create_time > #{startDate}
and a.create_time < #{endDate}
and a.integrity !=1
and a.integrity =1
order by a.create_time,a.nickname desc
)x
inner join(
select id ,name from admin a
inner join (select department_id as depId from admin where id= #{aid,jdbcType=VARCHAR})b on a.department_id=b.depId
) y on y.id = x.information_maintainer
${page_sql}
select count(0)
from user a left join organization_identity b
on a.id=b.uid inner join (select id from admin a
inner join (select department_id as depId from admin where id= #{aid,jdbcType=VARCHAR} )b on a.department_id=b.depId) y
on y.id=a.information_maintainer
where 1=1 and a.status=0
and a.`type`=#{type,jdbcType=VARCHAR}
and a.nickname like concat('%',#{name,jdbcType=VARCHAR},'%')
and b.location_province= #{province,jdbcType=VARCHAR}
and b.location_city=#{city,jdbcType=VARCHAR}
and b.location_area= #{area,jdbcType=VARCHAR}
and a.create_time > #{startDate}
and a.create_time < #{endDate}
and a.integrity !=1
and a.integrity =1
select count(a.id)
from user a left join organization_identity b
on a.id=b.uid
where b.industry is not null
and b.business_scope is not null
and b.registered_capital is not null and b.registered_capital !=0
and b.location_province is not null and b.location_province !=0
and b.cooperation_situation is not null and b.cooperation_situation !=''
and b.qualification is not null and b.qualification !=''
and b.assets is not null and b.assets !=''
and b.last_year_research_amount is not null and b.last_year_research_amount !=''
and b.year_sales_amount is not null and b.year_sales_amount !=''
and a.core_technology is not null and a.core_technology !=''
and a.accomplish_situation is not null and a.accomplish_situation !=''
and a.credit_rating is not null and a.credit_rating !=''
and a.id=#{uid,jdbcType=VARCHAR}
select a.name ,c.name as depName,ifnull(d.count,0) as signUser,ifnull(e.count,0) as fullUser,
ifnull(f.count,0) as dayFullUser,ifnull(g.count,0) as dayNewUser,ifnull(h.count,0) as countUser,
ifnull(i.count,0) as signFullUser
from admin a inner join (select uid from user_role x
inner join(select id from `role` where role_name in ('营销员','营销经理','营销管理员')) y
on x.rid=y.id)b on a.id =b.uid left join department c on a.department_id=c.id
left join (select x.aid,count(1)as count from (select aid,uid from user_lock_release
where type=1 and status=0 group by aid,uid)x group by aid)d on a.id=d.aid
left join (select aid,count(1) as count from user where integrity=1 and type=1 and status=0 and share_type=0 group by aid) e on a.id=e.aid
left join (select aid,count(1) as count
from user where integrity=1 and type=1 and status=0 and share_type=0 and to_days(update_time)=to_days(now()) group by aid) f on a.id=f.aid
left join (select aid,count(1) as count
from user where type=1 and status=0 and share_type=0 and to_days(create_time)=to_days(now()) group by aid) g on a.id=g.aid
left join (select aid,count(1) as count
from user where type=1 and status=0 and share_type=0 group by aid) h on a.id=h.aid
left join (select x.aid,count(1)as count from (select x1.aid,x1.uid from user_lock_release x1
left join user y on x1.uid=y.id where x1.type=1
and x1.status=0 and y.integrity=1 group by aid,uid)x group by aid) i on a.id=i.aid
where a.status='正常'
and a.department_id= #{depId,jdbcType=VARCHAR}
select sum(z.signUser) as signUser,sum(z.fullUser) as fullUser,sum(z.dayFullUser) as dayFullUser,
sum(z.dayNewUser) as dayNewUser,sum(z.countUser) as countUser,sum(z.signFullUser) as signFullUser from (select a.name ,c.name as depName,ifnull(d.count,0) as signUser,ifnull(e.count,0) as fullUser,
ifnull(f.count,0) as dayFullUser,ifnull(g.count,0) as dayNewUser,ifnull(h.count,0) as countUser,
ifnull(i.count,0) as signFullUser
from admin a inner join (select uid from user_role x
inner join(select id from `role` where role_name in ('营销员','营销经理','营销管理员')) y
on x.rid=y.id)b on a.id =b.uid left join department c on a.department_id=c.id
left join (select x.aid,count(1)as count from (select aid,uid from user_lock_release
where type=1 and status=0 group by aid,uid)x group by aid)d on a.id=d.aid
left join (select aid,count(1) as count from user where integrity=1 and type=1 and status=0 and share_type=0 group by aid) e on a.id=e.aid
left join (select aid,count(1) as count
from user where integrity=1 and type=1 and status=0 and share_type=0 and to_days(update_time)=to_days(now()) group by aid) f on a.id=f.aid
left join (select aid,count(1) as count
from user where type=1 and status=0 and share_type=0 and to_days(create_time)=to_days(now()) group by aid) g on a.id=g.aid
left join (select aid,count(1) as count
from user where type=1 and status=0 and share_type=0 group by aid) h on a.id=h.aid
left join (select x.aid,count(1)as count from (select x1.aid,x1.uid from user_lock_release x1
left join user y on x1.uid=y.id where x1.type=1
and x1.status=0 and y.integrity=1 group by aid,uid)x group by aid) i on a.id=i.aid
where a.status='正常'
and a.department_id= #{depId,jdbcType=VARCHAR}
)z
select count(*) from `user`
where aid= #{aid,jdbcType=VARCHAR}
and source=2
and share_type=0
and to_days(transfer_time)=to_days(now())
select t0.id as uid,
t0.aid,
date_format(t0.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime,
date_format(t0.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
t0.identify_name as name,
t0.society_tag as societyTag,
t0.level,
date_format(t1.last_follow_time,'%Y-%m-%d %H:%i:%S') as lastFollowTime,
date_format(t2.last_sign_time,'%Y-%m-%d %H:%i:%S') as lastSignTime,
b.contacts,
b.contact_mobile as contactMobile,
dg1.name as province,
dg2.name as city,
dg3.name as area,
c.name as industry,
if(t0.transfer_time < t1.last_follow_time,t1.last_follow_time,t0.transfer_time) as orderTime,
d.name as adminName
from
(select id,aid,type,share_type,transfer_time,create_time,identify_name,society_tag,level from user where aid = #{params.aid} and type = 1 and share_type = 0 and status != 1)t0
left join
(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{params.aid} group by uid)t1
on t0.id = t1.uid left join
(select aid,uid,max(lock_time) as last_sign_time from user_lock_release where aid = #{params.aid} group by uid)t2
on t0.id = t2.uid
left join organization_identity b on t0.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 t0.aid = d.id where 1=1
and t0.aid = #{params.aid,jdbcType=VARCHAR}
and t0.identify_name like concat('%',#{params.name},'%')
and t0.transfer_time > #{params.startDate}
and t0.transfer_time < #{params.endDate}
and b.location_province = #{params.province,jdbcType=INTEGER}
and b.location_city = #{params.city,jdbcType=INTEGER}
and b.location_area = #{params.area,jdbcType=INTEGER}
and t0.level = #{params.level,jdbcType=INTEGER}
order by orderTime
order by t0.create_time
desc
select count(*) from `user`
where aid= #{aid,jdbcType=VARCHAR}
and source in(1,2,3) and share_type=0 and channel =0
select role_type from user_role ur left join `role` r on ur.rid =r.id
where ur.uid = #{aid,jdbcType=VARCHAR} order by role_type desc limit 1
select count(*) from `user`
where id= #{uid,jdbcType=VARCHAR}
and share_type=2
update user set share_type =2,sign_bills =1,aid = #{aid}
where id= #{uid}
INSERT INTO `user` (id, mobile, password,
nickname,identify_name,username,
share_type,type,society_tag,channel,source,status)VALUES
(#{item.uid,jdbcType=VARCHAR}, #{item.contactMobile,jdbcType=VARCHAR},#{item.password,jdbcType=VARCHAR},
#{item.userName},#{item.userName},#{item.userName},
#{item.shareType,jdbcType=TIMESTAMP}, 1,#{item.societyTag},1,1 ,#{item.userStatus})
select a.id,a.uid,b.nickname userName,a.aid,a.status,date_format(a.distribution_time,'%Y-%m-%d %H:%i:%S')distributionTimes,
a.distribution_time distributionTime,date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes ,c.contacts ,
c.contact_mobile contactMobile,e.name channelName,b.society_tag societyTag ,d1.name province,d2.name city,
f.name adminName ,b.guidance,a.recovery,a.remarks,c.intended_project intendedProject,c.business_scope businessScope
from user_channel a
left join user b on a.uid=b.id left join organization_identity c on a.uid =c.uid
left join district_glossory d1 on c.location_province =d1.id
left join district_glossory d2 on c.location_city =d2.id
left join admin e on a.aid =e.id
left join admin f on b.aid=f.id
where 1=1
and a.status = #{status}
and a.status in(1,2,7)
and b.aid= #{sid}
and a.aid= #{aid}
and a.status in (0,1,2,6,7)
and a.aid= #{aid}
and a.status in (0,1,2,6,7)
and a.aid= #{aid}
and a.status in (0,1,2,6,7)
and a.maid= #{maid}
and a.aid= #{aid}
and a.status =8
and a.aid= #{aid}
and a.status in(0,6)
and a.aid= #{aid}
and a.status in(1,2)
and a.aid= #{aid}
and a.status =7
and a.aid= #{aid}
and c.location_province= #{province}
and c.location_city= #{city}
and b.nickname like concat('%',#{name},'%')
and a.create_time between #{startTime} and #{endTime}
order by a.status ,a.create_time desc,a.id
${page_sql}
select count(*) from user_channel a
left join user b on a.uid=b.id left join organization_identity c on a.uid =c.uid
where 1=1
and a.status = #{status}
and a.status in(1,2,7)
and b.aid= #{sid}
and a.aid= #{aid}
and a.status in (0,1,2,6,7)
and a.aid= #{aid}
and a.status in (0,1,2,6,7)
and a.aid= #{aid}
and a.status in (0,1,2,6,7)
and a.maid= #{maid}
and a.aid= #{aid}
and a.status =8
and a.aid= #{aid}
and a.status in(0,6)
and a.aid= #{aid}
and a.status in(1,2)
and a.aid= #{aid}
and a.status =7
and a.aid= #{aid}
and c.location_province= #{province}
and c.location_city= #{city}
and b.nickname like concat('%',#{name},'%')
and a.create_time between #{startTime} and #{endTime}
update user set aid = #{aid},information_maintainer= #{aid},transfer_time=now()
where id in(
#{item}
)
update user a ,user_channel b,user_lock_release c
set
b.status = 6,b.recovery=1,
a.share_type = 1,b.status = 8,
a.transfer_time = now(), c.release_time = now(),
c.status = 2
where a.id=b.uid and a.id=c.uid and a.aid=c.aid and c.status =0 and c.`type` =0
and b.status in (0,1,2) and a.id in(
#{item.uid}
)
select b.aid from user_channel a
left join user b on a.uid =b.id
where a.status=8 and a.uid = #{uid}
select b.name,b.id aid,a.counts,a.wfp unallocated,a.yfp allocated,a.yqd sign,a.ysf common
from admin b
left join (select t1.aid,sum(tj)counts ,sum(t1.wfp)wfp,sum(t1.yfp)yfp,sum(t1.yqd)yqd,sum(t1.ysf)ysf from
(select x.aid,x.uid,
if(x.status=8,0,1) tj,
case x.status when 0 then 1 when 6 then 1 else 0 end as wfp,
case x.status when 1 then 1 when 2 then 1 else 0 end as yfp,
case x.status when 7 then 1 else 0 end as yqd,
case x.status when 8 then 1 else 0 end as ysf
from user_channel x left join user y on x.uid =y.id
where 1=1 and x.status in (0,1,2,6,7,8)
and x.create_time between #{startTime} and #{endTime}
and x.distribution_time between #{startTime} and #{endTime}
and x.sign_time between #{startTime} and #{endTime}
)t1 group by t1.aid)a on a.aid=b.id left join user_role ur on b.id=ur.uid
left join `role` r on r.id=ur.rid where r.role_type=80
${page_sql}
select count(*) from admin b left join user_role ur on b.id=ur.uid
left join `role` r on r.id=ur.rid
where r.role_type=80
select id,nickname name from `user` where nickname like concat('%',#{name},'%')
select id,nickname name from `user` where nickname like concat('%',#{name},'%')
${page_sql}
select count(*) from `user` where nickname like concat('%',#{name},'%')
select id,name ,province ,name_mobile nameMobile from user_now
select
a.id id,a.aid,a.nickname name,b.name aName,dg1.name as province,dg2.name as city,
dg3.name as area,date_format(um.last_sign_time,'%Y-%m-%d %H:%i:%S') lastSignTime,
date_format(a.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime,a.introduction ,
date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
date_format(um.last_follow_time,'%Y-%m-%d %H:%i:%S') lastFollowTime ,
if(a.transfer_time < um.last_follow_time,um.last_follow_time,a.transfer_time) as orderTime,
um.channel_type type
from user a left join admin b on a.aid=b.id left join organization_identity d on a.id = d.uid
left join district_glossory dg1 on d.location_province = dg1.id
left join district_glossory dg2 on d.location_city = dg2.id
left join district_glossory dg3 on d.location_area = dg3.id
left join user_mid um on um.aid=a.aid and um.uid=a.id
where a.type= 1 and a.source in(1,2,3) and a.new_channel=1
and a.share_type = #{shareType}
and a.new_channel = #{newChannel}
and a.nickname like concat ('%',#{name},'%')
and a.aid= #{aid}
and d.location_province= #{province}
and d.location_city= #{city}
and d.location_area= #{area}
and um.channel_type= #{type}
and a.transfer_time between #{startDate} and #{endDate}
order by orderTime,a.transfer_time,a.create_time desc
${page_sql}
select
count(*)
from user a left join admin b on a.aid=b.id left join organization_identity d on a.id = d.uid
left join user_mid um on um.aid=a.aid and um.uid=a.id
where a.type= 1 and a.source in(1,2,3)
and a.share_type = #{shareType}
and a.new_channel = #{newChannel}
and a.nickname like concat ('%',#{name},'%')
and a.aid= #{aid}
and d.location_province= #{province}
and d.location_city= #{city}
and d.location_area= #{area}
and um.channel_type= #{type}
and a.transfer_time between #{startDate} and #{endDate}