Commit bec68df2 by jianan

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

parent 106943fa
...@@ -9,4 +9,5 @@ public class CustomerHolder { ...@@ -9,4 +9,5 @@ public class CustomerHolder {
private String mobileNo;//客户电话 private String mobileNo;//客户电话
private String gender;//客户性别 private String gender;//客户性别
private String birthDate;//客户生日 private String birthDate;//客户生日
private String relationType;//投被保人关系
} }
...@@ -23,6 +23,7 @@ public class CustomerPolicyInfo implements Comparable<CustomerPolicyInfo>{ ...@@ -23,6 +23,7 @@ public class CustomerPolicyInfo implements Comparable<CustomerPolicyInfo>{
private Long planId; private Long planId;
private Long productId; private Long productId;
private Long fortuneId; private Long fortuneId;
private String isValid;// 保单状态,有效,无效
public Long getOrderId() { public Long getOrderId() {
return orderId; return orderId;
...@@ -154,4 +155,11 @@ public class CustomerPolicyInfo implements Comparable<CustomerPolicyInfo>{ ...@@ -154,4 +155,11 @@ public class CustomerPolicyInfo implements Comparable<CustomerPolicyInfo>{
} }
} }
public String getIsValid() {
return isValid;
}
public void setIsValid(String isValid) {
this.isValid = isValid;
}
} }
...@@ -934,6 +934,7 @@ ...@@ -934,6 +934,7 @@
<result column="mobile_no" jdbcType="VARCHAR" property="mobileNo" typeHandler="com.yd.util.deshandler.DESTypeHandler"/> <result column="mobile_no" jdbcType="VARCHAR" property="mobileNo" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>
<result column="gender" jdbcType="VARCHAR" property="gender"/> <result column="gender" jdbcType="VARCHAR" property="gender"/>
<result column="birth_date" jdbcType="VARCHAR" property="birthDate"/> <result column="birth_date" jdbcType="VARCHAR" property="birthDate"/>
<result column="relation_type" jdbcType="VARCHAR" property="relationType"/>
</resultMap> </resultMap>
<select id="queryThisPractitiionerAllPolicyHolderList" resultMap="customerHolder"> <select id="queryThisPractitiionerAllPolicyHolderList" resultMap="customerHolder">
select c.id, select c.id,
...@@ -959,16 +960,19 @@ ...@@ -959,16 +960,19 @@
c.name, c.name,
c.mobile_no , c.mobile_no ,
IF(c.gender = 1,'男','女') gender, IF(c.gender = 1,'男','女') gender,
c.birth_date c.birth_date,
t.relation_type
from from
(select DISTINCT h.customer_id (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
where h.type = 3 where h.type = 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
) t ) t
left join ag_acl_customer c on t.customer_id = c.id left join ag_acl_customer c on t.customer_id = c.id
</select> </select>
<select id="queryPolicyListByHolderCustomerId" resultType="com.yd.dal.entity.order.CustomerPolicyInfo"> <select id="queryPolicyListByHolderCustomerId" resultType="com.yd.dal.entity.order.CustomerPolicyInfo">
SELECT SELECT
o.id as orderId, o.id as orderId,
...@@ -983,10 +987,15 @@ ...@@ -983,10 +987,15 @@
f.order_price as orderPrice, f.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,
a.name planName,
b.name productName,
f.id as fortuneId f.id as fortuneId
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id and o.status = 3 and o.order_price FROM ag_acl_customer_fortune f
&gt; 0 and o.insurer_id != 888 INNER JOIN ag_po_order o ON f.order_id = o.id and o.status = 3 and o.order_price &gt; 0 and o.insurer_id != 888 and o.policy_no is not null
inner JOIN ag_acl_policyholder p ON o.id = p.order_id and p.type = 2 inner JOIN ag_acl_policyholder p ON o.id = p.order_id and p.type = 2
left join ag_product_plan a on o.plan_id = a.id
left join ag_product b on o.product_id = b.id
WHERE p.customer_id = #{customerId,jdbcType=BIGINT} WHERE p.customer_id = #{customerId,jdbcType=BIGINT}
</select> </select>
......
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