Commit ddc65be9 by jianan

【ydlife】-【客户管理】-7

parent c5ba57fd
...@@ -945,7 +945,9 @@ ...@@ -945,7 +945,9 @@
from from
(select distinct t.customer_id (select distinct t.customer_id
from ag_acl_policyholder t from ag_acl_policyholder t
left join ag_po_order o on o.id = t.order_id
where 1 = 1 where 1 = 1
and o.status = 3
and t.type = 2 and t.type = 2
and t.order_id in and t.order_id in
<foreach close=")" collection="list" index="index" item="item" open="(" separator=","> <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
...@@ -965,7 +967,9 @@ ...@@ -965,7 +967,9 @@
from from
(select h.customer_id, group_concat(distinct h.relation_type ORDER BY h.relation_type) relation_type (select h.customer_id, group_concat(distinct h.relation_type ORDER BY h.relation_type) relation_type
from ag_acl_policyholder h from ag_acl_policyholder h
left join ag_po_order o on o.id = h.order_id
where h.type = 3 where h.type = 3
and o.status = 3
and h.order_id in and h.order_id in
(select t1.order_id from ag_acl_policyholder t1 where t1.customer_id = #{customerId,jdbcType=BIGINT} and t1.type = 2) (select t1.order_id from ag_acl_policyholder t1 where t1.customer_id = #{customerId,jdbcType=BIGINT} and t1.type = 2)
GROUP BY h.customer_id GROUP BY h.customer_id
...@@ -985,7 +989,7 @@ ...@@ -985,7 +989,7 @@
o.order_price as orderPrice, o.order_price as orderPrice,
o.plan_id as planId, o.plan_id as planId,
o.product_id as productId , o.product_id as productId ,
IF(o.effective_start_date &lt;= NOW() and o.effective_end_date &gt;= NOW(),'有效','无效') isValid, IF(o.effective_end_date &gt;= NOW(),'有效','无效') isValid,
a.name planName, a.name planName,
b.name productName b.name productName
</sql> </sql>
...@@ -1023,10 +1027,11 @@ ...@@ -1023,10 +1027,11 @@
select h.customer_id id, select h.customer_id id,
h.name, h.name,
h.mobile_no , h.mobile_no ,
IF(h.gender = 1,'男','女') gender, (case h.gender when 1 then '男' when 2 then '女' else h.gender END) gender,
h.birth_date h.birth_date,
h.relation_type
from ag_acl_policyholder h from ag_acl_policyholder h
where h.name is not null and h.birth_date is not null where h.name is not null and h.birth_date is not null and h.relation_type is not null
<if test="customerId != null"> <if test="customerId != null">
and h.customer_id = #{customerId,jdbcType=BIGINT} and h.customer_id = #{customerId,jdbcType=BIGINT}
</if> </if>
......
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