<iftest='tabType =="9" || (callbackLog != null and callbackLog != "") || (customerSourceType2 != null and customerSourceType2 != "" )'>
inner join (
SELECT
c3.manager_id,c3.phone
FROM
customer_callback_log c2 right join customer c3 on c2.customer_id = c3.id
where 1=1
and c3.cityCode=#{cityCode}
AND c3.is_delete = 0
AND ( c3.isWaitCall = 0 OR c3.isWaitCall IS NULL )
AND c3.manager_id IS NOT NULL
AND c3.STATUS IN ( 11, 0, 99 )
<iftest='tabType =="9"'>
and c3.customer_source_type=7
</if>
<iftest="customerSourceType2 != null and customerSourceType2 != '' ">
and EXISTS (
select customer_source_type from customer c8
where c8.manager_id=c3.manager_id and c8.phone=c3.phone
and c8.customer_source_type=#{customerSourceType2}
)
</if>
<iftest="callbackLog != null and callbackLog != '' ">
and c2.content like CONCAT('%', #{callbackLog},'%')
</if>
group by c3.manager_id,c3.phone
) t1 on c.manager_id=t1.manager_id and c.phone=t1.phone
</if>
<iftest="(projectName != null and projectName != '') or (projectStatus != null and projectStatus != '')">
LEFT JOIN (
SELECT c1.manager_id, c1.phone FROM customer c1 inner join customer_project p1 on c1.id=p1.customer_id
WHERE 1=1 and (c1.manager_id = #{userId} OR c1.manager_id IN ( SELECT id FROM user WHERE depturlpath LIKE ( SELECT concat( depturlpath, '/%' ) FROM user WHERE id = #{userId} ) ))
and c1.cityCode = #{cityCode} AND c1.is_delete = 0 AND c1.STATUS IN ( 11, 0, 99 ) AND ( c1.isWaitCall = 0 OR c1.isWaitCall IS NULL )
<iftest="projectName != null and projectName != '' ">
and p1.house_name LIKE CONCAT( '%', #{projectName}, '%' )
</if>
<iftest="projectStatus != null and projectStatus != '' ">
and p1.STATUS = #{projectStatus}
</if>
<iftest="phone != null and phone != '' ">
AND (c1.phone LIKE CONCAT('%', #{phone},'%') OR c1.bak_phone1 LIKE CONCAT('%', #{phone},'%') OR
c1.bak_phone2 LIKE CONCAT('%', #{phone},'%') OR c1.bak_phone3 LIKE CONCAT('%', #{phone},'%') )
</if>
group by c1.manager_id,c1.phone
)t2 on c.manager_id = t2.manager_id AND c.phone = t2.phone
</if>
<iftest="labelIdList != null and labelIdList.size() > 0 ">
inner join (select distinct customerId from customer_label cl where cl.labelId in
<iftest="sourceName != null and sourceName != '' ">
left join (
SELECT ct1.manager_id, ct1.phone FROM customer ct1 WHERE 1=1
and ct1.cityCode=#{cityCode} and ct1.is_delete = 0 AND ct1.STATUS IN ( 11, 0, 99 )
and (ct1.manager_id=#{userId} OR ct1.manager_id IN ( SELECT id FROM user WHERE depturlpath LIKE ( SELECT concat( depturlpath, '/%' ) FROM user WHERE id = #{userId} ) ))
AND ct1.act_source LIKE concat( '%', #{sourceName}, '%' )
group by ct1.manager_id,ct1.phone
) t4 on c.manager_id = t4.manager_id AND c.phone = t4.phone
</if>
<iftest="customTimeTypeTwo != null and customTimeTypeTwo != '' ">
left join (
select ct2.manager_id,ct2.phone
from customer ct2 inner join customer_status_log csl on ct2.id=csl.customer_id
where csl.is_delete = 0 and csl.to_status_id = 1
AND csl.create_time >=#{customTimeStart}
AND csl.create_time <=#{customTimeEnd}
group by ct2.manager_id,ct2.phone
) t5 on c.manager_id = t5.manager_id AND c.phone = t5.phone
</if>
<iftest="customTimeTypeThree != null and customTimeTypeThree != '' ">
left join (
select ct2.manager_id,ct2.phone
from customer ct2 inner join customer_status_log csl on ct2.id=csl.customer_id
where csl.is_delete = 0 and csl.to_status_id = 2
AND csl.occur_time >=#{customTimeStart}
AND csl.occur_time <=#{customTimeEnd}
group by ct2.manager_id,ct2.phone
) t5 on c.manager_id = t5.manager_id AND c.phone = t5.phone
</if>
<iftest="customTimeTypeFour != null and customTimeTypeFour != '' ">
left join (
select ct2.manager_id,ct2.phone
from customer ct2 inner join customer_status_log csl on ct2.id=csl.customer_id
where csl.is_delete = 0 and csl.to_status_id = 3
AND csl.occur_time >=#{customTimeStart}
AND csl.occur_time <=#{customTimeEnd}
group by ct2.manager_id,ct2.phone
) t5 on c.manager_id = t5.manager_id AND c.phone = t5.phone
</if>
<iftest="customTimeTypeFive != null and customTimeTypeFive != '' ">
left join (
select ct2.manager_id,ct2.phone
from customer ct2 inner join customer_status_log csl on ct2.id=csl.customer_id
where csl.is_delete = 0 and csl.to_status_id = 4
AND csl.occur_time >=#{customTimeStart}
AND csl.occur_time <=#{customTimeEnd}
group by ct2.manager_id,ct2.phone
) t5 on c.manager_id = t5.manager_id AND c.phone = t5.phone
</if>
<iftest="customTimeTypeSix != null and customTimeTypeSix != '' ">
left join (
select ct2.manager_id,ct2.phone
from customer ct2 inner join customer_status_log csl on ct2.id=csl.customer_id
where csl.is_delete = 0 and csl.to_status_id = 5
AND csl.occur_time >=#{customTimeStart}
AND csl.occur_time <=#{customTimeEnd}
group by ct2.manager_id,ct2.phone
) t5 on c.manager_id = t5.manager_id AND c.phone = t5.phone
</if>
<iftest='tabType =="9" || (callbackLog != null and callbackLog != "") || (customerSourceType2 != null and customerSourceType2 != "" )'>
inner join (
SELECT
c3.manager_id,c3.phone
FROM
customer_callback_log c2 right join customer c3 on c2.customer_id = c3.id
where 1=1
and c3.cityCode=#{cityCode}
AND c3.is_delete = 0
AND ( c3.isWaitCall = 0 OR c3.isWaitCall IS NULL )
AND c3.manager_id IS NOT NULL
AND c3.STATUS IN ( 11, 0, 99 )
<iftest='tabType =="9"'>
and c3.customer_source_type=7
</if>
<iftest="customerSourceType2 != null and customerSourceType2 != '' ">
and EXISTS (
select customer_source_type from customer c8
where c8.manager_id=c3.manager_id and c8.phone=c3.phone
and c8.customer_source_type=#{customerSourceType2}
)
</if>
<iftest="callbackLog != null and callbackLog != '' ">
and c2.content like CONCAT('%', #{callbackLog},'%')
</if>
group by c3.manager_id,c3.phone
) t1 on c.manager_id=t1.manager_id and c.phone=t1.phone
</if>
<iftest="(projectName != null and projectName != '') or (projectStatus != null and projectStatus != '')">
LEFT JOIN (
SELECT c1.manager_id, c1.phone FROM customer c1 inner join customer_project p1 on c1.id=p1.customer_id
WHERE 1=1 and (c1.manager_id = #{userId} OR c1.manager_id IN ( SELECT id FROM user WHERE depturlpath LIKE ( SELECT concat( depturlpath, '/%' ) FROM user WHERE id = #{userId} ) ))
and c1.cityCode = #{cityCode} AND c1.is_delete = 0 AND c1.STATUS IN ( 11, 0, 99 ) AND ( c1.isWaitCall = 0 OR c1.isWaitCall IS NULL )
<iftest="projectName != null and projectName != '' ">
and p1.house_name LIKE CONCAT( '%', #{projectName}, '%' )
</if>
<iftest="projectStatus != null and projectStatus != '' ">
and p1.STATUS = #{projectStatus}
</if>
<iftest="phone != null and phone != '' ">
AND (c1.phone LIKE CONCAT('%', #{phone},'%') OR c1.bak_phone1 LIKE CONCAT('%', #{phone},'%') OR
c1.bak_phone2 LIKE CONCAT('%', #{phone},'%') OR c1.bak_phone3 LIKE CONCAT('%', #{phone},'%') )
</if>
group by c1.manager_id,c1.phone
)t2 on c.manager_id = t2.manager_id AND c.phone = t2.phone
</if>
<iftest="labelIdList != null and labelIdList.size() > 0 ">
inner join (select distinct customerId from customer_label cl where cl.labelId in
<iftest="sourceName != null and sourceName != '' ">
left join (
SELECT ct1.manager_id, ct1.phone FROM customer ct1 WHERE 1=1
and ct1.cityCode=#{cityCode} and ct1.is_delete = 0 AND ct1.STATUS IN ( 11, 0, 99 )
and (ct1.manager_id=#{userId} OR ct1.manager_id IN ( SELECT id FROM user WHERE depturlpath LIKE ( SELECT concat( depturlpath, '/%' ) FROM user WHERE id = #{userId} ) ))
AND ct1.act_source LIKE concat( '%', #{sourceName}, '%' )
group by ct1.manager_id,ct1.phone
) t4 on c.manager_id = t4.manager_id AND c.phone = t4.phone
</if>
<iftest="customTimeTypeTwo != null and customTimeTypeTwo != '' ">
left join (
select ct2.manager_id,ct2.phone
from customer ct2 inner join customer_status_log csl on ct2.id=csl.customer_id
where csl.is_delete = 0 and csl.to_status_id = 1
AND csl.create_time >=#{customTimeStart}
AND csl.create_time <=#{customTimeEnd}
group by ct2.manager_id,ct2.phone
) t5 on c.manager_id = t5.manager_id AND c.phone = t5.phone
</if>
<iftest="customTimeTypeThree != null and customTimeTypeThree != '' ">
left join (
select ct2.manager_id,ct2.phone
from customer ct2 inner join customer_status_log csl on ct2.id=csl.customer_id
where csl.is_delete = 0 and csl.to_status_id = 2
AND csl.occur_time >=#{customTimeStart}
AND csl.occur_time <=#{customTimeEnd}
group by ct2.manager_id,ct2.phone
) t5 on c.manager_id = t5.manager_id AND c.phone = t5.phone
</if>
<iftest="customTimeTypeFour != null and customTimeTypeFour != '' ">
left join (
select ct2.manager_id,ct2.phone
from customer ct2 inner join customer_status_log csl on ct2.id=csl.customer_id
where csl.is_delete = 0 and csl.to_status_id = 3
AND csl.occur_time >=#{customTimeStart}
AND csl.occur_time <=#{customTimeEnd}
group by ct2.manager_id,ct2.phone
) t5 on c.manager_id = t5.manager_id AND c.phone = t5.phone
</if>
<iftest="customTimeTypeFive != null and customTimeTypeFive != '' ">
left join (
select ct2.manager_id,ct2.phone
from customer ct2 inner join customer_status_log csl on ct2.id=csl.customer_id
where csl.is_delete = 0 and csl.to_status_id = 4
AND csl.occur_time >=#{customTimeStart}
AND csl.occur_time <=#{customTimeEnd}
group by ct2.manager_id,ct2.phone
) t5 on c.manager_id = t5.manager_id AND c.phone = t5.phone
</if>
<iftest="customTimeTypeSix != null and customTimeTypeSix != '' ">
left join (
select ct2.manager_id,ct2.phone
from customer ct2 inner join customer_status_log csl on ct2.id=csl.customer_id
where csl.is_delete = 0 and csl.to_status_id = 5
AND csl.occur_time >=#{customTimeStart}
AND csl.occur_time <=#{customTimeEnd}
group by ct2.manager_id,ct2.phone
) t5 on c.manager_id = t5.manager_id AND c.phone = t5.phone
</if>
where 1=1
<iftest='tabType =="9" || (callbackLog != null and callbackLog != "") || (customerSourceType2 != null and customerSourceType2 != "" )'>
and t1.phone is not null
...
...
@@ -333,7 +333,6 @@
or (customTimeTypeFive != null and customTimeTypeFive != '') or (customTimeTypeSix != null and customTimeTypeSix != '')">
and t5.phone is not null
</if>
<iftest="cityCode != null and cityCode != '' ">
AND c.cityCode = #{cityCode}
</if>
...
...
@@ -376,10 +375,6 @@
<iftest="bindTimeEnd != null and bindTimeEnd != '' ">
AND c.bind_time <=#{bindTimeEnd}
</if>
<!--<if test="customerSourceType2 != null and customerSourceType2 != '' ">-->
<iftest="projectStatus != null and projectStatus !=''">
LEFT JOIN (
SELECT c1.manager_id, c1.phone FROM customer c1 inner join customer_project p1 on c1.id=p1.customer_id
WHERE 1=1 and (c1.manager_id = #{userId} OR c1.manager_id IN ( SELECT id FROM user WHERE depturlpath LIKE ( SELECT concat( depturlpath, '/%' ) FROM user WHERE id = #{userId} ) ))
and c1.cityCode = #{cityCode} AND c1.is_delete = 0 AND c1.STATUS IN ( 11, 0, 99 ) AND ( c1.isWaitCall = 0 OR c1.isWaitCall IS NULL )
<iftest="projectStatus != null and projectStatus !=''">
LEFT JOIN (
SELECT c1.manager_id, c1.phone FROM customer c1 inner join customer_project p1 on c1.id=p1.customer_id
WHERE 1=1 and (c1.manager_id = #{userId} OR c1.manager_id IN ( SELECT id FROM user WHERE depturlpath LIKE ( SELECT concat( depturlpath, '/%' ) FROM user WHERE id = #{userId} ) ))
and c1.cityCode = #{cityCode} AND c1.is_delete = 0 AND c1.STATUS IN ( 11, 0, 99 ) AND ( c1.isWaitCall = 0 OR c1.isWaitCall IS NULL )
<iftest="projectStatus != null and projectStatus != '' ">
and p1.STATUS = #{projectStatus}
</if>
group by c1.manager_id,c1.phone
)t2 on cm.manager_id = t2.manager_id AND cm.phone = t2.phone
</if>
<iftest="projectStatus != null and projectStatus != '' ">
and p1.STATUS = #{projectStatus}
</if>
group by c1.manager_id,c1.phone
)t2 on cm.manager_id = t2.manager_id AND cm.phone = t2.phone
</if>
where cm.manager_Id = #{managerId}
<iftest="buyIntention != null and buyIntention !='' and buyIntention !='23'">
AND ( c3.isWaitCall = 0 OR c3.isWaitCall IS NULL )
AND c3.manager_id IS NOT NULL
AND c3.STATUS IN ( 11, 0, 99 )
AND c2.content LIKE CONCAT( '%', #{callbackLog}, '%' )
GROUP BY
c3.manager_id,
c3.phone
) t1 ON cm.manager_id = t1.manager_id
AND cm.phone = t1.phone
<iftest="projectStatus != null and projectStatus != '' ">
LEFT JOIN (
SELECT c1.manager_id, c1.phone FROM customer c1 inner join customer_project p1 on c1.id=p1.customer_id
WHERE 1=1 and (c1.manager_id = #{userId} OR c1.manager_id IN ( SELECT id FROM user WHERE depturlpath LIKE ( SELECT concat( depturlpath, '/%' ) FROM user WHERE id = #{userId} ) ))
and c1.cityCode = #{cityCode} AND c1.is_delete = 0 AND c1.STATUS IN ( 11, 0, 99 ) AND ( c1.isWaitCall = 0 OR c1.isWaitCall IS NULL )
and p1.STATUS = #{projectStatus}
<iftest="phone != null and phone != '' ">
AND (c1.phone LIKE CONCAT('%', #{phone},'%') OR c1.bak_phone1 LIKE CONCAT('%', #{phone},'%') OR
c1.bak_phone2 LIKE CONCAT('%', #{phone},'%') OR c1.bak_phone3 LIKE CONCAT('%', #{phone},'%') )
</if>
GROUP BY c1.manager_id,c1.phone
)t3 on cm.manager_id = t3.manager_id AND cm.phone = t3.phone
</if>
from customer_merge cm left JOIN (
SELECT
c3.manager_id,
c3.phone
FROM
customer_callback_log c2
right JOIN customer c3 ON c2.customer_id = c3.id
WHERE
1 = 1
AND c3.cityCode =#{cityCode}
AND c3.is_delete = 0
AND ( c3.isWaitCall = 0 OR c3.isWaitCall IS NULL )
AND c3.manager_id IS NOT NULL
AND c3.STATUS IN ( 11, 0, 99 )
AND c2.content LIKE CONCAT( '%', #{callbackLog}, '%' )
GROUP BY
c3.manager_id,
c3.phone
) t1 ON cm.manager_id = t1.manager_id
AND cm.phone = t1.phone
<iftest="projectStatus != null and projectStatus != '' ">
LEFT JOIN (
SELECT c1.manager_id, c1.phone FROM customer c1 inner join customer_project p1 on c1.id=p1.customer_id
WHERE 1=1 and (c1.manager_id = #{userId} OR c1.manager_id IN ( SELECT id FROM user WHERE depturlpath LIKE ( SELECT concat( depturlpath, '/%' ) FROM user WHERE id = #{userId} ) ))
and c1.cityCode = #{cityCode} AND c1.is_delete = 0 AND c1.STATUS IN ( 11, 0, 99 ) AND ( c1.isWaitCall = 0 OR c1.isWaitCall IS NULL )
and p1.STATUS = #{projectStatus}
<iftest="phone != null and phone != '' ">
AND (c1.phone LIKE CONCAT('%', #{phone},'%') OR c1.bak_phone1 LIKE CONCAT('%', #{phone},'%') OR
c1.bak_phone2 LIKE CONCAT('%', #{phone},'%') OR c1.bak_phone3 LIKE CONCAT('%', #{phone},'%') )
</if>
GROUP BY c1.manager_id,c1.phone
)t3 on cm.manager_id = t3.manager_id AND cm.phone = t3.phone
</if>
where 1=1
and t1.phone is not null
<iftest="projectStatus != null and projectStatus != '' ">
and t3.phone is not null
</if>
AND cm.cityCode =#{cityCode}
and cm.is_delete=0
and cm.status in (0,11,99)
and (cm.isWaitCall is null or cm.isWaitCall=0)
and cm.manager_Id = #{managerId}
<iftest="buyIntention != null and buyIntention !='' and buyIntention !='23'">
and cm.buy_intention=#{buyIntention}
</if>
<iftest="buyIntention =='23'">
and (cm.buy_intention IS NULL OR cm.buy_intention = '')
</if>
<iftest="isStar != null and isStar !=''">
and cm.starCustomer=#{isStar}
</if>
<iftest="projectStatus != null and projectStatus !=''">
AND cm.id in ( SELECT customer_id FROM customer_project cp WHERE cp.STATUS = #{projectStatus} )
</if>
and t1.phone is not null
<iftest="projectStatus != null and projectStatus != '' ">
and t3.phone is not null
</if>
AND cm.cityCode =#{cityCode}
and cm.is_delete=0
and cm.status in (0,11,99)
and (cm.isWaitCall is null or cm.isWaitCall=0)
and cm.manager_Id = #{managerId}
<iftest="buyIntention != null and buyIntention !='' and buyIntention !='23'">
and cm.buy_intention=#{buyIntention}
</if>
<iftest="buyIntention =='23'">
and (cm.buy_intention IS NULL OR cm.buy_intention = '')
</if>
<iftest="isStar != null and isStar !=''">
and cm.starCustomer=#{isStar}
</if>
<iftest="projectStatus != null and projectStatus !=''">
AND cm.id in ( SELECT customer_id FROM customer_project cp WHERE cp.STATUS = #{projectStatus} )
<iftest="projectStatus != null and projectStatus !=''">
LEFT JOIN (
SELECT c1.manager_id, c1.phone FROM customer c1 inner join customer_project p1 on c1.id=p1.customer_id
WHERE 1=1 and (c1.manager_id = #{userId} OR c1.manager_id IN ( SELECT id FROM user WHERE depturlpath LIKE ( SELECT concat( depturlpath, '/%' ) FROM user WHERE id = #{userId} ) ))
and c1.cityCode = #{cityCode} AND c1.is_delete = 0 AND c1.STATUS IN ( 11, 0, 99 ) AND ( c1.isWaitCall = 0 OR c1.isWaitCall IS NULL )
<iftest="projectStatus != null and projectStatus !=''">
LEFT JOIN (
SELECT c1.manager_id, c1.phone FROM customer c1 inner join customer_project p1 on c1.id=p1.customer_id
WHERE 1=1 and (c1.manager_id = #{userId} OR c1.manager_id IN ( SELECT id FROM user WHERE depturlpath LIKE ( SELECT concat( depturlpath, '/%' ) FROM user WHERE id = #{userId} ) ))
and c1.cityCode = #{cityCode} AND c1.is_delete = 0 AND c1.STATUS IN ( 11, 0, 99 ) AND ( c1.isWaitCall = 0 OR c1.isWaitCall IS NULL )
<iftest="projectStatus != null and projectStatus != '' ">
and p1.STATUS = #{projectStatus}
</if>
group by c1.manager_id,c1.phone
)t2 on cm.manager_id = t2.manager_id AND cm.phone = t2.phone
</if>
<iftest="projectStatus != null and projectStatus != '' ">
and p1.STATUS = #{projectStatus}
</if>
group by c1.manager_id,c1.phone
)t2 on cm.manager_id = t2.manager_id AND cm.phone = t2.phone
</if>
where cm.manager_Id = #{managerId}
<iftest="buyIntention != null and buyIntention !='' and buyIntention !='23'">
AND ( c3.isWaitCall = 0 OR c3.isWaitCall IS NULL )
AND c3.manager_id IS NOT NULL
AND c3.STATUS IN ( 11, 0, 99 )
AND c2.content LIKE CONCAT( '%', #{callbackLog}, '%' )
GROUP BY
c3.manager_id,
c3.phone
) t1 ON cm.manager_id = t1.manager_id AND cm.phone = t1.phone
<iftest="projectStatus != null and projectStatus != '' ">
LEFT JOIN (
SELECT c1.manager_id, c1.phone FROM customer c1 inner join customer_project p1 on c1.id=p1.customer_id
WHERE 1=1 and (c1.manager_id = #{userId} OR c1.manager_id IN ( SELECT id FROM user WHERE depturlpath LIKE ( SELECT concat( depturlpath, '/%' ) FROM user WHERE id = #{userId} ) ))
and c1.cityCode = #{cityCode} AND c1.is_delete = 0 AND c1.STATUS IN ( 11, 0, 99 ) AND ( c1.isWaitCall = 0 OR c1.isWaitCall IS NULL )
and p1.STATUS = #{projectStatus}
<iftest="phone != null and phone != '' ">
AND (c1.phone LIKE CONCAT('%', #{phone},'%') OR c1.bak_phone1 LIKE CONCAT('%', #{phone},'%') OR
c1.bak_phone2 LIKE CONCAT('%', #{phone},'%') OR c1.bak_phone3 LIKE CONCAT('%', #{phone},'%') )
</if>
GROUP BY c1.manager_id,c1.phone
)t3 on cm.manager_id = t3.manager_id AND cm.phone = t3.phone
</if>
SELECT
c3.manager_id,
c3.phone
FROM
customer_callback_log c2
right JOIN customer c3 ON c2.customer_id = c3.id
WHERE
1 = 1
AND c3.cityCode =#{cityCode}
AND c3.is_delete = 0
AND ( c3.isWaitCall = 0 OR c3.isWaitCall IS NULL )
AND c3.manager_id IS NOT NULL
AND c3.STATUS IN ( 11, 0, 99 )
AND c2.content LIKE CONCAT( '%', #{callbackLog}, '%' )
GROUP BY
c3.manager_id,
c3.phone
) t1 ON cm.manager_id = t1.manager_id AND cm.phone = t1.phone
<iftest="projectStatus != null and projectStatus != '' ">
LEFT JOIN (
SELECT c1.manager_id, c1.phone FROM customer c1 inner join customer_project p1 on c1.id=p1.customer_id
WHERE 1=1 and (c1.manager_id = #{userId} OR c1.manager_id IN ( SELECT id FROM user WHERE depturlpath LIKE ( SELECT concat( depturlpath, '/%' ) FROM user WHERE id = #{userId} ) ))
and c1.cityCode = #{cityCode} AND c1.is_delete = 0 AND c1.STATUS IN ( 11, 0, 99 ) AND ( c1.isWaitCall = 0 OR c1.isWaitCall IS NULL )
and p1.STATUS = #{projectStatus}
<iftest="phone != null and phone != '' ">
AND (c1.phone LIKE CONCAT('%', #{phone},'%') OR c1.bak_phone1 LIKE CONCAT('%', #{phone},'%') OR
c1.bak_phone2 LIKE CONCAT('%', #{phone},'%') OR c1.bak_phone3 LIKE CONCAT('%', #{phone},'%') )
</if>
GROUP BY c1.manager_id,c1.phone
)t3 on cm.manager_id = t3.manager_id AND cm.phone = t3.phone
</if>
where 1=1
and t1.phone is not null
<iftest="projectStatus != null and projectStatus != '' ">