|
|
@@ -1105,30 +1105,32 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAdminCustomerDetailList" resultType="com.goafanti.admin.bo.AdminCustomerDetailBo">
|
|
|
-select a.id,a.nickname as name,a.source,c.name contacts,c.mobile as contactMobile,
|
|
|
- a.create_time as createTime,b.last_follow_time as followTime
|
|
|
- from user a
|
|
|
- left join (select uid,last_follow_time from user_mid where aid= #{aid}) b on a.id=b.uid
|
|
|
- left join (select uid,name ,mobile from organization_contact_book where major=1 limit 1 ) c on a.id=c.uid
|
|
|
- <if test="type==5 or type==6">
|
|
|
+ select a.id,a.nickname as name,a.source,d.name contacts,d.mobile as contactMobile,d.department contactsDep,d.`position` contactsPosition,
|
|
|
+ a.create_time as createTime,b.last_follow_time as followTime,c.location_province locationProvince, c.location_city locationCity,
|
|
|
+ c.location_area locationArea,c.business_scope businessScope , c.intended_project intendedProject
|
|
|
+ from user a left join (select uid,last_follow_time from user_mid where aid= #{aid}) b on a.id=b.uid
|
|
|
+ left join organization_identity c on a.id=c.uid left join (select y.id,y.uid,y.name ,y.mobile ,y.department ,y.`position`from (
|
|
|
+ select uid,max(id)id from organization_contact_book where major =1 and aid = #{aid} group by uid )x
|
|
|
+ left join organization_contact_book y on x.id=y.id) d on a.id =d.uid
|
|
|
+ <if test="type==5 or type==6">
|
|
|
left join (select aid,uid from public_release where clock_in =1
|
|
|
and aid= #{aid,jdbcType=VARCHAR}
|
|
|
<if test="startTime != null and endTime != null">
|
|
|
and clock_in_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- )d on a.id=d.uid
|
|
|
+ )e on a.id=e.uid
|
|
|
</if>
|
|
|
where a.type=1
|
|
|
<if test="type != 5 and type !=6">
|
|
|
and a.aid= #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="type == 5 or type ==6">
|
|
|
- and d.aid= #{aid,jdbcType=VARCHAR}
|
|
|
+ and e.aid= #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="type == 0 or type == 1">
|
|
|
and a.share_type = 0
|
|
|
</if>
|
|
|
- <if test="type !=1 and type!=4 and type!=6">
|
|
|
+ <if test="type ==0 or type==3 or type==5 or type==7">
|
|
|
and a.channel=0
|
|
|
</if>
|
|
|
<if test="type == 1 or type==4 or type==6">
|
|
|
@@ -1164,20 +1166,20 @@ select a.id,a.nickname as name,a.source,c.name contacts,c.mobile as contactMobil
|
|
|
<if test="startTime != null and endTime != null">
|
|
|
and clock_in_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- )d on a.id=d.uid
|
|
|
+ )e on a.id=d.uid
|
|
|
</if>
|
|
|
where a.type=1
|
|
|
<if test="type != 5 and type !=6">
|
|
|
and a.aid= #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="type == 5 or type ==6">
|
|
|
- and d.aid= #{aid,jdbcType=VARCHAR}
|
|
|
+ and e.aid= #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="type == 0 or type == 1">
|
|
|
and a.share_type = 0
|
|
|
</if>
|
|
|
- <if test="type !=1 and type!=4 and type!=6">
|
|
|
- and a.channel=0
|
|
|
+ <if test="type ==0 or type==3 or type==5 or type==7">
|
|
|
+ and a.channel=0
|
|
|
</if>
|
|
|
<if test="type == 1 or type==4 or type==6">
|
|
|
and a.channel=1
|