Commit c7299c35 by jianan

【ydlife】-【客户管理】-查询出车险2

parent 5c93c4a3
......@@ -2104,8 +2104,14 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
if (practitioner != null) {
Long customerId = practitioner.getCustomerId();
List<CustomerPolicyInfo> policyInfos = poOrderDALService.findPolicyInfoByCustomerId(customerId, null);
if (CollectionUtils.isNotEmpty(policyInfos)) {
List<CustomerHolder> list = aclPolicyholderMapper.queryThisPractitiionerAllPolicyHolderList(policyInfos);
List<Long> vehiclePolicyOrderIdList = poOrderDALService.findVehiclePolicyInfoByCustomerId(customerId);
List<Long> orderIdList = new ArrayList<>();
for (CustomerPolicyInfo policyInfo : policyInfos) {
orderIdList.add(policyInfo.getOrderId());
}
orderIdList.addAll(vehiclePolicyOrderIdList);
if (CollectionUtils.isNotEmpty(orderIdList)) {
List<CustomerHolder> list = aclPolicyholderMapper.queryThisPractitiionerAllPolicyHolderList(orderIdList);
resp.setList(list);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
......
......@@ -25,7 +25,7 @@ public interface AclPolicyholderMapper {
List<CustomerHolder> queryInsuredListByHolderCustomerId(Long customerId);
List<CustomerHolder> queryThisPractitiionerAllPolicyHolderList(List<CustomerPolicyInfo> policyInfos);
List<CustomerHolder> queryThisPractitiionerAllPolicyHolderList(List<Long> orderIdList);
List<CustomerPolicyInfo> queryPolicyListByHolderCustomerId(Long customerId);
}
\ No newline at end of file
......@@ -30,4 +30,6 @@ public interface PoOrderMapper {
PoOrder findByIdAndStatus(@Param("id")Long orderId, @Param("status")int status);
List<PoOrder> findByIds(List<Long> orderIds);
List<Long> findVehiclePolicyInfoByCustomerId(Long customerId);
}
\ No newline at end of file
......@@ -71,4 +71,9 @@ public class PoOrderDALServiceImpl implements PoOrderDALService {
public List<PoOrder> findByIds(List<Long> orderIds) {
return poOrderMapper.findByIds(orderIds);
}
@Override
public List<Long> findVehiclePolicyInfoByCustomerId(Long customerId) {
return poOrderMapper.findVehiclePolicyInfoByCustomerId(customerId);
}
}
......@@ -27,4 +27,6 @@ public interface PoOrderDALService {
void update(PoOrder poOrder);
List<PoOrder> findByIds(List<Long> orderIds);
List<Long> findVehiclePolicyInfoByCustomerId(Long customerId);
}
......@@ -949,7 +949,7 @@
and t.type = 2
and t.order_id in
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
#{item.orderId}
#{item}
</foreach>
) h left join ag_acl_customer c on h.customer_id = c.id
</select>
......
......@@ -1151,4 +1151,11 @@
</foreach>
</select>
<select id="findVehiclePolicyInfoByCustomerId" resultType="java.lang.Long">
select o.id
from ag_po_quotation_vehicle_relation v
left join ag_po_order o on o.quotation_id = v.quotation_id
where v.customer_id = #{customerId,jdbcType=BIGINT}
</select>
</mapper>
\ No newline at end of file
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