|
|
@@ -338,6 +338,7 @@
|
|
|
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
|
|
|
@@ -345,7 +346,7 @@
|
|
|
left join admin d on a.aid = d.id
|
|
|
where a.type = 1 and a.status != 1
|
|
|
<if test="role == 0">
|
|
|
- and a.nickname = #{name}
|
|
|
+ and un.name = #{name}
|
|
|
</if>
|
|
|
<if test="role == 1">
|
|
|
and a.nickname like concat('%', #{name},'%')
|
|
|
@@ -379,6 +380,7 @@
|
|
|
select
|
|
|
count(0)
|
|
|
from user a
|
|
|
+ left join user_names un on a.id=un.uid
|
|
|
left join organization_identity b on a.id = b.uid
|
|
|
<if test="departmentId != null and departmentId !=''">
|
|
|
INNER join (select id
|
|
|
@@ -387,11 +389,11 @@
|
|
|
</if>
|
|
|
where a.type = 1 and a.status != 1
|
|
|
<if test="role == 0">
|
|
|
- and a.identify_name = #{name}
|
|
|
+ and un.name = #{name}
|
|
|
</if>
|
|
|
<if test="role == 1">
|
|
|
- and a.identify_name like concat('%', #{name},'%')
|
|
|
- </if>
|
|
|
+ and a.nickname like concat('%', #{name},'%')
|
|
|
+ </if>
|
|
|
<if test="aid != null and aid !=''">
|
|
|
and a.aid = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -495,7 +497,7 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- and a.identify_name like concat('%',#{name},'%')
|
|
|
+ and a.nickname like concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
and a.transfer_time > #{startDate}
|
|
|
@@ -537,7 +539,7 @@
|
|
|
and a.aid = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- and a.identify_name like concat('%',#{name},'%')
|
|
|
+ and a.nickname like concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
and a.transfer_time > #{startDate}
|
|
|
@@ -582,7 +584,7 @@
|
|
|
and a.aid = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- and a.identify_name like concat('%',#{name},'%')
|
|
|
+ and a.nickname like concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
and a.transfer_time > #{startDate}
|
|
|
@@ -687,7 +689,7 @@
|
|
|
</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
|
|
|
+ select id,nickname as name from user where identify_name like
|
|
|
concat('%',#{identifyName},'%') and status <![CDATA[!= ]]> 1 and audit_status = 1
|
|
|
</select>
|
|
|
|
|
|
@@ -794,7 +796,7 @@
|
|
|
|
|
|
<select id="selectFollowHistoryList" resultType="com.goafanti.customer.bo.FollowListBo">
|
|
|
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.identify_name as identifyName, c.name as contacts, c.mobile as contactMobile,
|
|
|
+ a.result,a.guidance, b.nickname,b.identify_name as identifyName, c.name as contacts, c.mobile as contactMobile,
|
|
|
d.name as adminName,date_format(a.guidance_time,'%Y-%m-%d %H:%i:%S') as guidanceTime
|
|
|
<if test="businessProjectId != null and businessProjectId != ''"><!-- 客户甲项目A所有的跟进记录 -->
|
|
|
,e.id as ufbId,e.follow_situation as followSituation,e.customer_status as customerStatus
|
|
|
@@ -862,7 +864,7 @@
|
|
|
|
|
|
<select id="findCustomerContacts" parameterType="java.lang.String" resultType="com.goafanti.common.model.OrganizationContactBook">
|
|
|
select a.id,a.name,a.mobile,a.email,a.qq,a.wechat,a.department,a.position,a.major,a.fixed_tel fixedTel,a.aname,b.location_province,
|
|
|
- d1.name provinceName,d2.name cityName,d3.name areaName,date_format(a.create_time,'%Y-%m-%d')createTimes,aid
|
|
|
+ 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 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
|
|
|
@@ -1427,7 +1429,7 @@
|
|
|
a.type,
|
|
|
a.status,
|
|
|
date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
|
|
|
- a.identify_name as name,
|
|
|
+ a.nickname as name,
|
|
|
a.society_tag as societyTag,
|
|
|
share_type as shareType,
|
|
|
b.contacts,
|
|
|
@@ -1449,7 +1451,7 @@
|
|
|
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},'%')
|
|
|
+ and a.nickname like concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="shareType != null">
|
|
|
and a.share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
@@ -1491,7 +1493,7 @@
|
|
|
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},'%')
|
|
|
+ and a.nickname like concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="shareType != null">
|
|
|
and a.share_type = #{shareType,jdbcType=VARCHAR}
|
|
|
@@ -1637,14 +1639,14 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectPrivateCustomerByName" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerSimpleBo">
|
|
|
- select b.id,b.identify_name as name from
|
|
|
+ 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.identify_name like concat('%',#{name},'%')
|
|
|
+ where b.status != 1 and b.channel =0 and b.nickname like concat('%',#{name},'%')
|
|
|
</select>
|
|
|
|
|
|
<select id="selectSignedCustomerByName" resultType="com.goafanti.customer.bo.CustomerSimpleBo">
|
|
|
- select b.id,b.identify_name as name from user b
|
|
|
+ select b.id,b.nickname as name from user b
|
|
|
where b.status != 1
|
|
|
<if test="type==2">
|
|
|
and b.channel=1
|
|
|
@@ -1652,7 +1654,7 @@
|
|
|
<if test="type==1">
|
|
|
and b.share_type=2
|
|
|
</if>
|
|
|
- and b.aid = #{aid} and b.identify_name like concat('%',#{name},'%')
|
|
|
+ and b.aid = #{aid} and b.nickname like concat('%',#{name},'%')
|
|
|
</select>
|
|
|
|
|
|
<update id="updateReleaseLock" parameterType="java.lang.String">
|