Commit d5c60328 authored by yanghao's avatar yanghao

fix: #195 客户业绩类型字段,判断条件变更

parent 33f4286a
......@@ -765,7 +765,11 @@
-- 捞取时间置为空
a.catch_time = null,
-- 移交客户重置报价延期次数为0
a.create_offer_postpone_num = 0
a.create_offer_postpone_num = 0,
-- 20240809修改 zendao #195 客户业绩类型字段,判断条件变更
-- 新客户置为1
a.is_new = (case when a.status = 3 then 0 else 1 end)
WHERE id in
<foreach item='customer' index='index' collection='customerList' open='(' separator=',' close=')'>
#{customer.id}
......@@ -828,8 +832,6 @@
a.is_in_open_sea = 0,
a.enter_open_sea_time = null,
-- 客户经理
a.customer_service = #{loginUserId},
-- 确认接收置为true #2201 公海池捞取客户后,捞取客户直接进入我的客户
a.is_customer_service_confirmed = 1,
-- 分配时间
......@@ -843,7 +845,14 @@
a.status = if(a.status = 2, 1, a.status),
-- 预计进入公海池时间
a.estimate_enter_open_sea_time = #{estimateEnterOpenSeaTime}
a.estimate_enter_open_sea_time = #{estimateEnterOpenSeaTime},
-- 20240809修改 zendao #195 客户业绩类型字段,判断条件变更
-- 不同客户经理更新为新客户; 同一客户经理,成交为老客户,非已成交状态为新客户
a.is_new = (case when a.customer_service != #{loginUserId} then 1 else (if(a.status = 3, 0, 1)) end),
-- 客户经理 (这个要放到后面,因为前面有用到这条件)
a.customer_service = #{loginUserId}
WHERE id = #{customerId}
</update>
......@@ -853,9 +862,9 @@
update ecw_customer a
set a.is_new = 0
where a.deleted = 0 and a.is_new = 1 and a.id = #{customerId}
and exists(
select 1 from ecw_target_log where deleted = 0 and customer_id = a.id
)
-- 20240809修改 zendao #195 客户业绩类型字段,判断条件变更
and a.status = 3
-- and exists(select 1 from ecw_target_log where deleted = 0 and customer_id = a.id)
</update>
<sql id="orderQuery">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment