Commit 098fcfba by jianan

新单跟进11-聚合查询

parent c663ff31
...@@ -451,6 +451,18 @@ public class ApiPolicyFollowController { ...@@ -451,6 +451,18 @@ public class ApiPolicyFollowController {
return Result.success(policyFollowService.getPolicyFollowVO(policyFollow)); return Result.success(policyFollowService.getPolicyFollowVO(policyFollow));
} }
@GetMapping("/detail/{policyBizId}")
@Operation(summary = "根据 policyBizId 获取新单跟进聚合详情")
public Result<PolicyFollowAggregateDto> getPolicyFollowAggregate(@PathVariable String policyBizId) {
try {
PolicyFollowAggregateDto result = policyFollowService.getPolicyFollowAggregate(policyBizId);
return Result.success(result);
} catch (Exception e) {
log.error("获取新单跟进聚合详情失败, policyBizId: {}", policyBizId, e);
return Result.fail("查询失败: " + e.getMessage());
}
}
/** /**
* 分页获取新单跟进列表(仅管理员可用) * 分页获取新单跟进列表(仅管理员可用)
* *
......
package com.yd.csf.service.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
@Configuration
@EnableAsync
public class AsyncConfig {
/**
* 异步聚合查询线程池
*/
@Bean("asyncQueryExecutor")
public Executor asyncQueryExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// 核心线程数(根据CPU核心数动态设置)
executor.setCorePoolSize(Runtime.getRuntime().availableProcessors());
// 最大线程数
executor.setMaxPoolSize(Runtime.getRuntime().availableProcessors() * 2);
// 队列容量
executor.setQueueCapacity(100);
// 线程名前缀
executor.setThreadNamePrefix("async-query-");
// 拒绝策略:由调用线程处理(保证不会丢失任务)
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// 等待任务完成再关闭
executor.setWaitForTasksToCompleteOnShutdown(true);
executor.setAwaitTerminationSeconds(60);
// 空闲线程存活时间
executor.setKeepAliveSeconds(60);
executor.initialize();
return executor;
}
/**
* 通用异步任务线程池
*/
@Bean("commonAsyncExecutor")
public Executor commonAsyncExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(5);
executor.setMaxPoolSize(10);
executor.setQueueCapacity(50);
executor.setThreadNamePrefix("common-async-");
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
executor.setWaitForTasksToCompleteOnShutdown(true);
executor.setAwaitTerminationSeconds(30);
executor.setKeepAliveSeconds(30);
executor.initialize();
return executor;
}
}
\ No newline at end of file
package com.yd.csf.service.dao;
import com.yd.csf.service.model.PolicyBeneficiary;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author Zhang Jianan
* @description 针对表【policy_beneficiary(受益人信息表)】的数据库操作Mapper
* @createDate 2025-10-31 11:43:16
* @Entity generator.domain.PolicyBeneficiary
*/
public interface PolicyBeneficiaryMapper extends BaseMapper<PolicyBeneficiary> {
}
package com.yd.csf.service.dao;
import com.yd.csf.service.model.PolicyInsurant;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author Zhang Jianan
* @description 针对表【policy_insurant(保单受保人信息表)】的数据库操作Mapper
* @createDate 2025-10-31 13:29:18
* @Entity generator.domain.PolicyInsurant
*/
public interface PolicyInsurantMapper extends BaseMapper<PolicyInsurant> {
}
package com.yd.csf.service.dao;
import com.yd.csf.service.model.PolicyPolicyholder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author Zhang Jianan
* @description 针对表【policy_policyholder(保单投保人信息表)】的数据库操作Mapper
* @createDate 2025-10-31 11:43:10
* @Entity generator.domain.PolicyPolicyholder
*/
public interface PolicyPolicyholderMapper extends BaseMapper<PolicyPolicyholder> {
}
package com.yd.csf.service.dao;
import com.yd.csf.service.model.PolicySecondHolder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author Zhang Jianan
* @description 针对表【policy_second_holder(第二持有人信息表)】的数据库操作Mapper
* @createDate 2025-10-31 13:29:23
* @Entity generator.domain.PolicySecondHolder
*/
public interface PolicySecondHolderMapper extends BaseMapper<PolicySecondHolder> {
}
package com.yd.csf.service.dto;
import com.yd.csf.service.model.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 新单跟进聚合查询结果DTO
*/
@Data
public class PolicyFollowAggregateDto implements Serializable {
/**
* 新单跟进业务ID
*/
@Schema(description = "新单跟进业务ID")
private String policyBizId;
/**
* 保单产品计划(保单)
*/
@Schema(description = "保单产品计划(保单)")
private Policy policy;
/**
* 保单投保人
*/
@Schema(description = "保单投保人")
private List<PolicyPolicyholder> policyPolicyholderList;
/**
* 保单受保人
*/
@Schema(description = "保单受保人")
private List<PolicyInsurant> policyInsurantList;
/**
* 保单受益人
*/
@Schema(description = "保单受益人")
private List<PolicyBeneficiary> policyBeneficiaryList;
/**
* 保单第二持有人
*/
@Schema(description = "保单第二持有人")
private List<PolicySecondHolder> policySecondHolderList;
// todo 健康问卷
// private Object policyholderInfo;
// 错误信息(如果有查询失败的情况)
private String errorMessage;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.csf.service.enums;
import org.apache.commons.lang3.ObjectUtils;
public enum PolicyStatusEnum {
INFORCE("生效中", "INFORCE"),
LAPSED("保单失效", "LAPSED"),
MATURED("期满终止", "MATURED"),
;
//字典项标签(名称)
private String itemLabel;
//字典项值
private String itemValue;
//构造函数
PolicyStatusEnum(String itemLabel, String itemValue) {
this.itemLabel = itemLabel;
this.itemValue = itemValue;
}
/**
* 根据 itemLabel 获取枚举
*
* @param itemLabel
* @return
*/
public static PolicyStatusEnum getEnumByItemLabel(String itemLabel) {
if (ObjectUtils.isEmpty(itemLabel)) {
return null;
}
for (PolicyStatusEnum anEnum : PolicyStatusEnum.values()) {
if (anEnum.itemLabel.equals(itemLabel)) {
return anEnum;
}
}
return null;
}
public String getItemLabel() {
return itemLabel;
}
public String getItemValue() {
return itemValue;
}
/**
* 根据 value 获取枚举
*
* @param value
* @return
*/
public static PolicyStatusEnum getEnumByValue(String value) {
if (ObjectUtils.isEmpty(value)) {
return null;
}
for (PolicyStatusEnum anEnum : PolicyStatusEnum.values()) {
if (anEnum.getItemValue().equals(value)) {
return anEnum;
}
}
return null;
}
}
...@@ -38,6 +38,11 @@ public class Policy implements Serializable { ...@@ -38,6 +38,11 @@ public class Policy implements Serializable {
private String userBizId; private String userBizId;
/** /**
* 产品业务id
*/
private String planBizId;
/**
* 产品代码 * 产品代码
*/ */
private String productCode; private String productCode;
...@@ -48,7 +53,7 @@ public class Policy implements Serializable { ...@@ -48,7 +53,7 @@ public class Policy implements Serializable {
private String productName; private String productName;
/** /**
* 产品类别 * 产品险种
*/ */
private String productCate; private String productCate;
...@@ -63,6 +68,11 @@ public class Policy implements Serializable { ...@@ -63,6 +68,11 @@ public class Policy implements Serializable {
private String insurerBizId; private String insurerBizId;
/** /**
* 地区
*/
private String region;
/**
* 保單持有人 * 保單持有人
*/ */
private String policyHolder; private String policyHolder;
...@@ -73,11 +83,16 @@ public class Policy implements Serializable { ...@@ -73,11 +83,16 @@ public class Policy implements Serializable {
private String insured; private String insured;
/** /**
* 供款年期 * 供款年期(字典)
*/ */
private Integer paymentTerm; private Integer paymentTerm;
/** /**
* 付款频率(字典)
*/
private String paymentFrequency;
/**
* 期交保费 * 期交保费
*/ */
private BigDecimal paymentPremium; private BigDecimal paymentPremium;
...@@ -123,11 +138,41 @@ public class Policy implements Serializable { ...@@ -123,11 +138,41 @@ public class Policy implements Serializable {
private Integer isPrepaid; private Integer isPrepaid;
/** /**
* 预付额
*/
private String deductibles;
/**
* 预缴年期 * 预缴年期
*/ */
private Integer prepaidTerm; private Integer prepaidTerm;
/** /**
* 首期付款方式(字典)
*/
private String initialPaymentMethod;
/**
* 续期付款方式(字典)
*/
private String renewalPaymentMethod;
/**
* 红利分配方式(字典)
*/
private String dividendDistributionMethod;
/**
* 保单日期回溯: 0-否, 1-是(字典)
*/
private Integer isBacktrack;
/**
* 是否参加递增保障权益: 0-否, 1-是(字典)
*/
private Integer isJoin;
/**
* 对账公司 * 对账公司
*/ */
private String reconciliationCompany; private String reconciliationCompany;
......
package com.yd.csf.service.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* 受益人信息表
* @TableName policy_beneficiary
*/
@TableName(value ="policy_beneficiary")
@Data
public class PolicyBeneficiary implements Serializable {
/**
*
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 保单受益人信息表唯一业务ID
*/
private String policyBeneficiaryBizId;
/**
* 新单跟进业务ID
*/
private String policyBizId;
/**
* 保单号
*/
private String policyNo;
/**
* 客户类型(字典)(个人或者公司)
*/
private String customerType;
/**
* 与受保人关系(字典)
*/
private String insurantRel;
/**
* 受益比例
*/
private BigDecimal benefitRatio;
/**
* 名字
*/
private String name;
/**
* 名字-英文
*/
private String nameEn;
/**
* 性别(字典)
*/
private String gender;
/**
* 证件类型(字典)
*/
private String documentType;
/**
* 证件号码
*/
private String idNumber;
/**
* 护照号码
*/
private String passportNumber;
/**
* 出生日期
*/
private Date birthTime;
/**
* 公司名称
*/
private String companyName;
/**
* 公司名称(英文)
*/
private String companyNameEn;
/**
* 公司商业登记号码
*/
private String companyBusinessNo;
/**
* 公司注册日期
*/
private Date companyRegisterTime;
/**
* 公司注册地区(字典)
*/
private String companyRegisterRegion;
/**
* 公司电话区号
*/
private String companyMobileCode;
/**
* 公司电话
*/
private String companyMobile;
/**
* 公司邮箱
*/
private String companyEmail;
/**
* 公司登记地址
*/
private String companyEnterAddress;
/**
* 通讯地址
*/
private String mailingAddress;
/**
* 授权代表姓名中文-名字
*/
private String authNameCn;
/**
* 授权代表姓名英文-名字
*/
private String authNameEn;
/**
* 授权代表职称
*/
private String authProfessional;
/**
* 授权代表电话区号
*/
private String authMobileCode;
/**
* 授权代表电话
*/
private String authMobile;
/**
* 地址列表(json串)
*/
private String addressList;
/**
* 通用备注
*/
private String remark;
/**
* 删除标识: 0-正常, 1-删除
*/
private Integer isDeleted;
/**
* 创建人ID
*/
private String creatorId;
/**
* 更新人ID
*/
private String updaterId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.csf.service.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* 保单受保人信息表
* @TableName policy_insurant
*/
@TableName(value ="policy_insurant")
@Data
public class PolicyInsurant implements Serializable {
/**
*
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 受保人信息表唯一业务ID
*/
private String policyInsurantBizId;
/**
* 新单跟进业务ID
*/
private String policyBizId;
/**
* 保单号
*/
private String policyNo;
/**
* 客户类型(字典)
*/
private String customerType;
/**
* 关联客户信息表唯一业务ID(冗余字段)
*/
private String customerBizId;
/**
* 关联客户编号(和客户信息表唯一业务ID是一对,唯一,冗余字段)
*/
private String customerNo;
/**
* 与投保人关系(字典)
*/
private String policyholderRel;
/**
* 名字
*/
private String name;
/**
* 名字-英文
*/
private String nameEn;
/**
* 性别(字典)
*/
private String gender;
/**
* 证件类型(字典)
*/
private String documentType;
/**
* 证件号码
*/
private String idNumber;
/**
* 出生日期
*/
private Date birthday;
/**
* 年龄
*/
private String age;
/**
* 居住地址
*/
private String residentialAddress;
/**
* 通讯地址
*/
private String mailingAddress;
/**
* 移动电话区号
*/
private String mobileCode;
/**
* 移动电话
*/
private String mobile;
/**
* 邮箱
*/
private String email;
/**
* 公司名称
*/
private String companyName;
/**
* 公司地址
*/
private String companyAddress;
/**
* 行业
*/
private String industry;
/**
* 职位
*/
private String position;
/**
* 风险偏好(字典)
*/
private String riskAppetite;
/**
* 是否VIP: 0-否, 1-是(字典)
*/
private Integer isVip;
/**
* vip备注
*/
private String vipRemark;
/**
* 称谓(字典)
*/
private String appellation;
/**
* 是否区分吸烟(字典)
*/
private String smokingAllowed;
/**
* 出生地(省市)
*/
private String birthplace;
/**
* 国籍
*/
private String nationality;
/**
* 护照号码
*/
private String passportNo;
/**
* 通行证号码
*/
private String passNo;
/**
* 身高
*/
private String height;
/**
* 体重
*/
private String weight;
/**
* BMI
*/
private String bmi;
/**
* 受雇于现职年期
*/
private BigDecimal currentTenure;
/**
* 总负债额
*/
private BigDecimal totalDebt;
/**
* 受供养人数目
*/
private Integer dependentsNum;
/**
* 婚姻状况(字典)
*/
private String maritalStatus;
/**
* 教育程度(字典)
*/
private String educationLevel;
/**
* 总工作年期
*/
private BigDecimal totalWorkingYears;
/**
* 现时每月收入
*/
private BigDecimal currentMonthlyIncome;
/**
* 公司电话区号
*/
private String companyMobileCode;
/**
* 公司电话
*/
private String companyMobile;
/**
* 固定电话区号
*/
private String landlineCode;
/**
* 固定电话
*/
private String landline;
/**
* 其他电话
*/
private String otherMobile;
/**
* 过往一年是否所属国家以外地区居住超过182日: 0-否, 1-是(字典)
*/
private Integer isExceed;
/**
* 是否拥有其他国家公民身份(如美国、日本等): 0-否, 1-是(字典)
*/
private Integer isOtherCountry;
/**
* 是否接受推广信息: 0-否, 1-是(字典)
*/
private Integer isPromotion;
/**
* 旅行(字典)
*/
private String travel;
/**
* 运动(字典)
*/
private String exercise;
/**
* 游戏(字典)
*/
private String game;
/**
* 电影/戏剧(字典)
*/
private String movieDrama;
/**
* 美食(字典)
*/
private String delicacy;
/**
* 地址列表(json串)
*/
private String addressList;
/**
* 通用备注
*/
private String remark;
/**
* 删除标识: 0-正常, 1-删除
*/
private Integer isDeleted;
/**
* 创建人ID
*/
private String creatorId;
/**
* 更新人ID
*/
private String updaterId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 吸烟量(支/天)
*/
private String smokingVolume;
/**
* 货币(字典)
*/
private String currency;
/**
* 公司名称(英文)
*/
private String companyNameEn;
/**
* 公司商业登记号码
*/
private String companyBusinessNo;
/**
* 公司注册日期
*/
private Date companyRegisterTime;
/**
* 公司注册地区(字典)
*/
private String companyRegisterRegion;
/**
* 公司邮箱
*/
private String companyEmail;
/**
* 公司登记地址
*/
private String companyEnterAddress;
/**
* 授权代表姓名中文-名字
*/
private String authNameCn;
/**
* 授权代表姓名英文-名字
*/
private String authNameEn;
/**
* 授权代表职称
*/
private String authProfessional;
/**
* 授权代表电话区号
*/
private String authMobileCode;
/**
* 授权代表电话
*/
private String authMobile;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.csf.service.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* 保单投保人信息表
* @TableName policy_policyholder
*/
@TableName(value ="policy_policyholder")
@Data
public class PolicyPolicyholder implements Serializable {
/**
*
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 投保人信息表唯一业务ID
*/
private String policyPolicyholderBizId;
/**
* 新单跟进业务ID
*/
private String policyBizId;
/**
* 保单号
*/
private String policyNo;
/**
* 客户类型(字典)
*/
private String customerType;
/**
* 关联客户信息表唯一业务ID(冗余字段)
*/
private String customerBizId;
/**
* 关联客户编号(和客户信息表唯一业务ID是一对,唯一,冗余字段)
*/
private String customerNo;
/**
* 名字
*/
private String name;
/**
* 名字-英文
*/
private String nameEn;
/**
* 性别(字典)
*/
private String gender;
/**
* 证件类型(字典)
*/
private String documentType;
/**
* 证件号码
*/
private String idNumber;
/**
* 出生日期
*/
private Date birthday;
/**
* 年龄
*/
private String age;
/**
* 居住地址
*/
private String residentialAddress;
/**
* 通讯地址
*/
private String mailingAddress;
/**
* 移动电话区号
*/
private String mobileCode;
/**
* 移动电话
*/
private String mobile;
/**
* 邮箱
*/
private String email;
/**
* 公司名称
*/
private String companyName;
/**
* 公司地址
*/
private String companyAddress;
/**
* 行业
*/
private String industry;
/**
* 职位
*/
private String position;
/**
* 风险偏好(字典)
*/
private String riskAppetite;
/**
* 是否VIP: 0-否, 1-是(字典)
*/
private Integer isVip;
/**
* vip备注
*/
private String vipRemark;
/**
* 称谓(字典)
*/
private String appellation;
/**
* 是否区分吸烟(字典)
*/
private String smokingAllowed;
/**
* 出生地(省市)
*/
private String birthplace;
/**
* 国籍
*/
private String nationality;
/**
* 护照号码
*/
private String passportNo;
/**
* 通行证号码
*/
private String passNo;
/**
* 身高
*/
private String height;
/**
* 体重
*/
private String weight;
/**
* BMI
*/
private String bmi;
/**
* 平均每月支出
*/
private BigDecimal monthExpenditure;
/**
* 平均每月收入
*/
private BigDecimal monthIncome;
/**
* 受雇于现职年期
*/
private BigDecimal currentTenure;
/**
* 总流动资产
*/
private BigDecimal totalCurrentAssets;
/**
* 总负债额
*/
private BigDecimal totalDebt;
/**
* 受供养人数目
*/
private Integer dependentsNum;
/**
* 婚姻状况(字典)
*/
private String maritalStatus;
/**
* 教育程度(字典)
*/
private String educationLevel;
/**
* 总工作年期
*/
private BigDecimal totalWorkingYears;
/**
* 现时每月收入
*/
private BigDecimal currentMonthlyIncome;
/**
* 公司电话区号
*/
private String companyMobileCode;
/**
* 公司电话
*/
private String companyMobile;
/**
* 固定电话区号
*/
private String landlineCode;
/**
* 固定电话
*/
private String landline;
/**
* 其他电话
*/
private String otherMobile;
/**
* 过往一年是否所属国家以外地区居住超过182日: 0-否, 1-是(字典)
*/
private Integer isExceed;
/**
* 是否拥有其他国家公民身份(如美国、日本等): 0-否, 1-是(字典)
*/
private Integer isOtherCountry;
/**
* 是否接受推广信息: 0-否, 1-是(字典)
*/
private Integer isPromotion;
/**
* 投保人邮政编码
*/
private String postalCode;
/**
* 旅行(字典)
*/
private String travel;
/**
* 运动(字典)
*/
private String exercise;
/**
* 游戏(字典)
*/
private String game;
/**
* 电影/戏剧(字典)
*/
private String movieDrama;
/**
* 美食(字典)
*/
private String delicacy;
/**
* 地址列表(json串)
*/
private String addressList;
/**
* 吸烟量(支/天)
*/
private String smokingVolume;
/**
* 货币(字典)
*/
private String currency;
/**
* 公司名称(英文)
*/
private String companyNameEn;
/**
* 公司商业登记号码
*/
private String companyBusinessNo;
/**
* 公司注册日期
*/
private Date companyRegisterTime;
/**
* 公司注册地区(字典)
*/
private String companyRegisterRegion;
/**
* 公司邮箱
*/
private String companyEmail;
/**
* 公司登记地址
*/
private String companyEnterAddress;
/**
* 授权代表姓名中文-名字
*/
private String authNameCn;
/**
* 授权代表姓名英文-名字
*/
private String authNameEn;
/**
* 授权代表职称
*/
private String authProfessional;
/**
* 授权代表电话区号
*/
private String authMobileCode;
/**
* 授权代表电话
*/
private String authMobile;
/**
* 通用备注
*/
private String remark;
/**
* 删除标识: 0-正常, 1-删除
*/
private Integer isDeleted;
/**
* 创建人ID
*/
private String creatorId;
/**
* 更新人ID
*/
private String updaterId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.csf.service.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 第二持有人信息表
* @TableName policy_second_holder
*/
@TableName(value ="policy_second_holder")
@Data
public class PolicySecondHolder implements Serializable {
/**
*
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 第二持有人信息表唯一业务ID
*/
private String policySecondHolderBizId;
/**
* 新单跟进业务ID
*/
private String policyBizId;
/**
* 保单号
*/
private String policyNo;
/**
* 与受保人关系(字典)
*/
private String insurantRel;
/**
* 名字
*/
private String name;
/**
* 名字-英文
*/
private String nameEn;
/**
* 性别(字典)
*/
private String gender;
/**
* 证件类型(字典)
*/
private String documentType;
/**
* 证件号码
*/
private String idNumber;
/**
* 护照号码
*/
private String passportNumber;
/**
* 出生日期
*/
private Date birthTime;
/**
* 年龄
*/
private String age;
/**
* 通用备注
*/
private String remark;
/**
* 删除标识: 0-正常, 1-删除
*/
private Integer isDeleted;
/**
* 创建人ID
*/
private String creatorId;
/**
* 更新人ID
*/
private String updaterId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.csf.service.service;
import com.yd.csf.service.model.PolicyBeneficiary;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author Zhang Jianan
* @description 针对表【policy_beneficiary(受益人信息表)】的数据库操作Service
* @createDate 2025-10-31 11:43:16
*/
public interface PolicyBeneficiaryService extends IService<PolicyBeneficiary> {
}
...@@ -36,4 +36,6 @@ public interface PolicyFollowService extends IService<PolicyFollow> { ...@@ -36,4 +36,6 @@ public interface PolicyFollowService extends IService<PolicyFollow> {
Boolean uploadAttachment(AttachmentUploadRequest attachmentUploadRequest); Boolean uploadAttachment(AttachmentUploadRequest attachmentUploadRequest);
String getNextStatus(PolicyFollowStatusEnum policyFollowStatusEnum); String getNextStatus(PolicyFollowStatusEnum policyFollowStatusEnum);
PolicyFollowAggregateDto getPolicyFollowAggregate(String policyBizId);
} }
package com.yd.csf.service.service;
import com.yd.csf.service.model.PolicyInsurant;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author Zhang Jianan
* @description 针对表【policy_insurant(保单受保人信息表)】的数据库操作Service
* @createDate 2025-10-31 13:29:18
*/
public interface PolicyInsurantService extends IService<PolicyInsurant> {
}
package com.yd.csf.service.service;
import com.yd.csf.service.model.PolicyPolicyholder;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author Zhang Jianan
* @description 针对表【policy_policyholder(保单投保人信息表)】的数据库操作Service
* @createDate 2025-10-31 11:43:10
*/
public interface PolicyPolicyholderService extends IService<PolicyPolicyholder> {
}
package com.yd.csf.service.service;
import com.yd.csf.service.model.PolicySecondHolder;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author Zhang Jianan
* @description 针对表【policy_second_holder(第二持有人信息表)】的数据库操作Service
* @createDate 2025-10-31 13:29:23
*/
public interface PolicySecondHolderService extends IService<PolicySecondHolder> {
}
package com.yd.csf.service.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yd.csf.service.model.PolicyBeneficiary;
import com.yd.csf.service.service.PolicyBeneficiaryService;
import com.yd.csf.service.dao.PolicyBeneficiaryMapper;
import org.springframework.stereotype.Service;
/**
* @author Zhang Jianan
* @description 针对表【policy_beneficiary(受益人信息表)】的数据库操作Service实现
* @createDate 2025-10-31 11:43:16
*/
@Service
public class PolicyBeneficiaryServiceImpl extends ServiceImpl<PolicyBeneficiaryMapper, PolicyBeneficiary>
implements PolicyBeneficiaryService{
}
...@@ -17,7 +17,9 @@ import com.yd.csf.service.enums.PolicyFollowStatusEnum; ...@@ -17,7 +17,9 @@ import com.yd.csf.service.enums.PolicyFollowStatusEnum;
import com.yd.csf.service.model.*; import com.yd.csf.service.model.*;
import com.yd.csf.service.service.*; import com.yd.csf.service.service.*;
import com.yd.csf.service.dao.PolicyFollowMapper; import com.yd.csf.service.dao.PolicyFollowMapper;
import com.yd.csf.service.utils.AsyncQueryUtil;
import com.yd.csf.service.vo.PolicyFollowVO; import com.yd.csf.service.vo.PolicyFollowVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -26,6 +28,8 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -26,6 +28,8 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -34,6 +38,7 @@ import java.util.stream.Collectors; ...@@ -34,6 +38,7 @@ import java.util.stream.Collectors;
* @createDate 2025-09-16 18:18:06 * @createDate 2025-09-16 18:18:06
*/ */
@Service @Service
@Slf4j
public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, PolicyFollow> public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, PolicyFollow>
implements PolicyFollowService{ implements PolicyFollowService{
...@@ -47,6 +52,16 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol ...@@ -47,6 +52,16 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
private PolicyFollowRecordService policyFollowRecordService; private PolicyFollowRecordService policyFollowRecordService;
@Resource @Resource
private PolicyFollowFileService policyFollowFileService; private PolicyFollowFileService policyFollowFileService;
@Resource
private AsyncQueryUtil asyncQueryUtil;
@Resource
private PolicyPolicyholderService policyPolicyholderService;
@Resource
private PolicyInsurantService policyInsurantService;
@Resource
private PolicyBeneficiaryService policyBeneficiaryService;
@Resource
private PolicySecondHolderService policySecondHolderService;
@Override @Override
...@@ -328,6 +343,85 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol ...@@ -328,6 +343,85 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
} }
} }
/**
* 异步聚合查询新单跟进详情
*/
@Override
public PolicyFollowAggregateDto getPolicyFollowAggregate(String policyBizId) {
long startTime = System.currentTimeMillis();
try {
// 1. 异步查询保单信息
CompletableFuture<Policy> policyFuture = asyncQueryUtil.asyncQuery(
() -> policyService.getOne(new QueryWrapper<Policy>().eq("policy_biz_id", policyBizId)),
"查询保单信息"
);
// 2. 异步查询保单投保人
CompletableFuture<List<PolicyPolicyholder>> policyholderListFuture = asyncQueryUtil.asyncQuery(
() -> {
QueryWrapper<PolicyPolicyholder> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("policy_biz_id", policyBizId);
return policyPolicyholderService.list(queryWrapper);
},
"查询保单投保人"
);
// 3. 异步查询保单受保人
CompletableFuture<List<PolicyInsurant>> insurantListFuture = asyncQueryUtil.asyncQuery(
() -> {
QueryWrapper<PolicyInsurant> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("policy_biz_id", policyBizId);
return policyInsurantService.list(queryWrapper);
},
"查询保单受保人"
);
// 4. 异步查询保单受益人
CompletableFuture<List<PolicyBeneficiary>> beneficiaryListFuture = asyncQueryUtil.asyncQuery(
() -> {
QueryWrapper<PolicyBeneficiary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("policy_biz_id", policyBizId);
return policyBeneficiaryService.list(queryWrapper);
},
"查询保单受益人"
);
// 5. 异步查询保单第二持有人
CompletableFuture<List<PolicySecondHolder>> secondPolicyholderListFuture = asyncQueryUtil.asyncQuery(
() -> {
QueryWrapper<PolicySecondHolder> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("policy_biz_id", policyBizId);
return policySecondHolderService.list(queryWrapper);
},
"查询保单第二持有人"
);
// 5. 等待所有异步任务完成(设置超时时间)
CompletableFuture.allOf(policyFuture, policyholderListFuture, insurantListFuture, beneficiaryListFuture, secondPolicyholderListFuture)
.get(5, TimeUnit.SECONDS); // 5秒超时
// 6. 构建聚合结果
PolicyFollowAggregateDto aggregateDto = new PolicyFollowAggregateDto();
aggregateDto.setPolicy(policyFuture.get());
aggregateDto.setPolicyPolicyholderList(policyholderListFuture.get());
aggregateDto.setPolicyInsurantList(insurantListFuture.get());
aggregateDto.setPolicyBeneficiaryList(beneficiaryListFuture.get());
aggregateDto.setPolicySecondHolderList(secondPolicyholderListFuture.get());
long costTime = System.currentTimeMillis() - startTime;
log.info("新单跟进聚合查询完成, policyBizId: {}, 总耗时: {}ms", policyBizId, costTime);
return aggregateDto;
} catch (Exception e) {
log.error("新单跟进聚合查询失败, policyBizId: {}, 错误: {}", policyBizId, e.getMessage(), e);
PolicyFollowAggregateDto errorDto = new PolicyFollowAggregateDto();
errorDto.setErrorMessage("查询失败: " + e.getMessage());
return errorDto;
}
}
@Override @Override
public Boolean uploadAttachment(AttachmentUploadRequest attachmentUploadRequest) { public Boolean uploadAttachment(AttachmentUploadRequest attachmentUploadRequest) {
String policyBizId = attachmentUploadRequest.getPolicyBizId(); String policyBizId = attachmentUploadRequest.getPolicyBizId();
......
package com.yd.csf.service.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yd.csf.service.model.PolicyInsurant;
import com.yd.csf.service.service.PolicyInsurantService;
import com.yd.csf.service.dao.PolicyInsurantMapper;
import org.springframework.stereotype.Service;
/**
* @author Zhang Jianan
* @description 针对表【policy_insurant(保单受保人信息表)】的数据库操作Service实现
* @createDate 2025-10-31 13:29:18
*/
@Service
public class PolicyInsurantServiceImpl extends ServiceImpl<PolicyInsurantMapper, PolicyInsurant>
implements PolicyInsurantService{
}
package com.yd.csf.service.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yd.csf.service.model.PolicyPolicyholder;
import com.yd.csf.service.service.PolicyPolicyholderService;
import com.yd.csf.service.dao.PolicyPolicyholderMapper;
import org.springframework.stereotype.Service;
/**
* @author Zhang Jianan
* @description 针对表【policy_policyholder(保单投保人信息表)】的数据库操作Service实现
* @createDate 2025-10-31 11:43:10
*/
@Service
public class PolicyPolicyholderServiceImpl extends ServiceImpl<PolicyPolicyholderMapper, PolicyPolicyholder>
implements PolicyPolicyholderService{
}
package com.yd.csf.service.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yd.csf.service.model.PolicySecondHolder;
import com.yd.csf.service.service.PolicySecondHolderService;
import com.yd.csf.service.dao.PolicySecondHolderMapper;
import org.springframework.stereotype.Service;
/**
* @author Zhang Jianan
* @description 针对表【policy_second_holder(第二持有人信息表)】的数据库操作Service实现
* @createDate 2025-10-31 13:29:23
*/
@Service
public class PolicySecondHolderServiceImpl extends ServiceImpl<PolicySecondHolderMapper, PolicySecondHolder>
implements PolicySecondHolderService{
}
package com.yd.csf.service.utils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import java.util.stream.Collectors;
/**
* 异步聚合查询工具类
* 专门用于接口中聚合查询多个数据实体的场景
*/
@Slf4j
@Component
public class AsyncQueryUtil {
/**
* 异步执行单个查询任务
*
* @param supplier 查询任务
* @param taskName 任务名称(用于日志)
* @return CompletableFuture
*/
@Async("asyncQueryExecutor")
public <T> CompletableFuture<T> asyncQuery(Supplier<T> supplier, String taskName) {
long startTime = System.currentTimeMillis();
try {
log.info("开始异步查询任务: {}", taskName);
T result = supplier.get();
long costTime = System.currentTimeMillis() - startTime;
log.info("异步查询任务完成: {}, 耗时: {}ms", taskName, costTime);
return CompletableFuture.completedFuture(result);
} catch (Exception e) {
log.error("异步查询任务失败: {}, 错误: {}", taskName, e.getMessage(), e);
// 使用兼容性工具类替代CompletableFuture.failedFuture()
return CompletableFutureUtil.failedFuture(e);
}
}
/**
* 批量异步查询,等待所有任务完成
*
* @param tasks 查询任务列表
* @return 所有查询结果的CompletableFuture
*/
public <T> CompletableFuture<List<T>> batchAsyncQuery(List<CompletableFuture<T>> tasks) {
return CompletableFutureUtil.allOf(tasks.toArray(new CompletableFuture[0]))
.thenApply(v -> tasks.stream()
.map(CompletableFutureUtil::safeJoin) // 使用安全的join方法
.collect(Collectors.toList()));
}
/**
* 异步查询并设置超时时间
*
* @param supplier 查询任务
* @param taskName 任务名称
* @param timeoutMs 超时时间(毫秒)
* @return CompletableFuture
*/
@Async("asyncQueryExecutor")
public <T> CompletableFuture<T> asyncQueryWithTimeout(Supplier<T> supplier, String taskName, long timeoutMs) {
// 使用兼容性工具类的超时方法
return CompletableFutureUtil.supplyAsyncWithTimeout(supplier, timeoutMs, TimeUnit.MILLISECONDS)
.whenComplete((result, throwable) -> {
if (throwable != null) {
log.error("异步查询任务超时或失败: {}, 错误: {}", taskName, throwable.getMessage());
} else {
log.info("异步查询任务完成: {}", taskName);
}
});
}
/**
* 增强的异步查询方法,支持自定义异常处理
*/
@Async("asyncQueryExecutor")
public <T> CompletableFuture<T> enhancedAsyncQuery(Supplier<T> supplier, String taskName,
java.util.function.Function<Exception, T> exceptionHandler) {
long startTime = System.currentTimeMillis();
try {
log.info("开始增强异步查询任务: {}", taskName);
T result = supplier.get();
long costTime = System.currentTimeMillis() - startTime;
log.info("增强异步查询任务完成: {}, 耗时: {}ms", taskName, costTime);
return CompletableFuture.completedFuture(result);
} catch (Exception e) {
log.error("增强异步查询任务失败: {}, 错误: {}", taskName, e.getMessage(), e);
try {
// 使用自定义异常处理器
T fallbackResult = exceptionHandler.apply(e);
return CompletableFuture.completedFuture(fallbackResult);
} catch (Exception handlerException) {
log.error("异常处理器执行失败: {}, 错误: {}", taskName, handlerException.getMessage(), handlerException);
return CompletableFutureUtil.failedFuture(handlerException);
}
}
}
/**
* 并行执行多个查询任务,返回第一个成功的结果
*/
@SafeVarargs
public final <T> CompletableFuture<T> firstSuccessAsyncQuery(String taskName, Supplier<T>... suppliers) {
@SuppressWarnings("unchecked")
CompletableFuture<T>[] futures = new CompletableFuture[suppliers.length];
for (int i = 0; i < suppliers.length; i++) {
final int index = i;
futures[i] = asyncQuery(suppliers[i], taskName + "-" + (i + 1))
.exceptionally(e -> {
log.warn("查询任务 {} 失败: {}", taskName + "-" + (index + 1), e.getMessage());
return null; // 返回null表示失败,让其他任务继续
});
}
return CompletableFutureUtil.anyOf(futures)
.thenApply(result -> {
if (result == null) {
throw new RuntimeException("所有查询任务都失败了: " + taskName);
}
return result;
});
}
/**
* 重试机制的异步查询
*/
@Async("asyncQueryExecutor")
public <T> CompletableFuture<T> retryAsyncQuery(Supplier<T> supplier, String taskName, int maxRetries, long retryDelayMs) {
return retryAsyncQueryInternal(supplier, taskName, maxRetries, retryDelayMs, 0);
}
private <T> CompletableFuture<T> retryAsyncQueryInternal(Supplier<T> supplier, String taskName,
int maxRetries, long retryDelayMs, int currentRetry) {
long startTime = System.currentTimeMillis();
try {
log.info("开始重试异步查询任务: {}, 重试次数: {}/{}", taskName, currentRetry, maxRetries);
T result = supplier.get();
long costTime = System.currentTimeMillis() - startTime;
log.info("重试异步查询任务完成: {}, 重试次数: {}, 耗时: {}ms", taskName, currentRetry, costTime);
return CompletableFuture.completedFuture(result);
} catch (Exception e) {
log.warn("重试异步查询任务失败: {}, 重试次数: {}, 错误: {}", taskName, currentRetry, e.getMessage());
if (currentRetry < maxRetries) {
// 延迟重试 - 使用thenCompose展平嵌套的CompletableFuture
return CompletableFutureUtil.delayedFuture(retryDelayMs, TimeUnit.MILLISECONDS, () -> null)
.thenCompose(ignored -> retryAsyncQueryInternal(supplier, taskName, maxRetries, retryDelayMs, currentRetry + 1));
} else {
log.error("重试异步查询任务最终失败: {}, 最大重试次数: {}", taskName, maxRetries);
return CompletableFutureUtil.failedFuture(e);
}
}
}
}
\ No newline at end of file
package com.yd.csf.service.utils;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.function.Supplier;
/**
* CompletableFuture兼容性工具类
* 提供Java 8兼容的CompletableFuture方法
*/
public class CompletableFutureUtil {
/**
* Java 8兼容的failedFuture方法
* 替代Java 9+的CompletableFuture.failedFuture()
*/
public static <T> CompletableFuture<T> failedFuture(Throwable ex) {
CompletableFuture<T> future = new CompletableFuture<>();
future.completeExceptionally(ex);
return future;
}
/**
* 创建已完成的异常Future(别名方法)
*/
public static <T> CompletableFuture<T> completedExceptionally(Throwable ex) {
return failedFuture(ex);
}
/**
* 安全的join方法,避免CompletionException包装
* 直接抛出原始异常
*/
public static <T> T safeJoin(CompletableFuture<T> future) {
try {
return future.join();
} catch (CompletionException e) {
Throwable cause = e.getCause();
if (cause instanceof RuntimeException) {
throw (RuntimeException) cause;
} else if (cause instanceof Error) {
throw (Error) cause;
} else {
throw new RuntimeException(cause);
}
}
}
/**
* 带超时的supplyAsync方法(Java 8兼容)
*/
public static <T> CompletableFuture<T> supplyAsyncWithTimeout(Supplier<T> supplier, long timeout, java.util.concurrent.TimeUnit unit) {
CompletableFuture<T> future = CompletableFuture.supplyAsync(supplier);
// 使用定时器模拟超时
java.util.Timer timeoutTimer = new java.util.Timer();
timeoutTimer.schedule(new java.util.TimerTask() {
@Override
public void run() {
if (!future.isDone()) {
future.completeExceptionally(new java.util.concurrent.TimeoutException("Operation timed out after " + timeout + " " + unit.name().toLowerCase()));
}
}
}, unit.toMillis(timeout));
return future.whenComplete((result, throwable) -> timeoutTimer.cancel());
}
/**
* 批量等待所有Future完成
*/
@SafeVarargs
public static CompletableFuture<Void> allOf(CompletableFuture<?>... futures) {
return CompletableFuture.allOf(futures);
}
/**
* 批量等待任意Future完成
*/
@SafeVarargs
public static <T> CompletableFuture<T> anyOf(CompletableFuture<T>... futures) {
return CompletableFuture.anyOf(futures).thenApply(obj -> (T) obj);
}
/**
* 延迟执行的CompletableFuture
*/
public static <T> CompletableFuture<T> delayedFuture(long delay, java.util.concurrent.TimeUnit unit, Supplier<T> supplier) {
CompletableFuture<T> future = new CompletableFuture<>();
java.util.Timer timer = new java.util.Timer();
timer.schedule(new java.util.TimerTask() {
@Override
public void run() {
try {
T result = supplier.get();
future.complete(result);
} catch (Exception e) {
future.completeExceptionally(e);
} finally {
timer.cancel();
}
}
}, unit.toMillis(delay));
return future;
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.csf.service.dao.PolicyBeneficiaryMapper">
<resultMap id="BaseResultMap" type="com.yd.csf.service.model.PolicyBeneficiary">
<id property="id" column="id" />
<result property="policyBeneficiaryBizId" column="policy_beneficiary_biz_id" />
<result property="policyBizId" column="policy_biz_id" />
<result property="policyNo" column="policy_no" />
<result property="customerType" column="customer_type" />
<result property="insurantRel" column="insurant_rel" />
<result property="benefitRatio" column="benefit_ratio" />
<result property="name" column="name" />
<result property="nameEn" column="name_en" />
<result property="gender" column="gender" />
<result property="documentType" column="document_type" />
<result property="idNumber" column="id_number" />
<result property="passportNumber" column="passport_number" />
<result property="birthTime" column="birth_time" />
<result property="companyName" column="company_name" />
<result property="companyNameEn" column="company_name_en" />
<result property="companyBusinessNo" column="company_business_no" />
<result property="companyRegisterTime" column="company_register_time" />
<result property="companyRegisterRegion" column="company_register_region" />
<result property="companyMobileCode" column="company_mobile_code" />
<result property="companyMobile" column="company_mobile" />
<result property="companyEmail" column="company_email" />
<result property="companyEnterAddress" column="company_enter_address" />
<result property="mailingAddress" column="mailing_address" />
<result property="authNameCn" column="auth_name_cn" />
<result property="authNameEn" column="auth_name_en" />
<result property="authProfessional" column="auth_professional" />
<result property="authMobileCode" column="auth_mobile_code" />
<result property="authMobile" column="auth_mobile" />
<result property="addressList" column="address_list" />
<result property="remark" column="remark" />
<result property="isDeleted" column="is_deleted" />
<result property="creatorId" column="creator_id" />
<result property="updaterId" column="updater_id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="Base_Column_List">
id,policy_beneficiary_biz_id,policy_biz_id,policy_no,customer_type,insurant_rel,
benefit_ratio,name,name_en,gender,document_type,
id_number,passport_number,birth_time,company_name,company_name_en,
company_business_no,company_register_time,company_register_region,company_mobile_code,company_mobile,
company_email,company_enter_address,mailing_address,auth_name_cn,auth_name_en,
auth_professional,auth_mobile_code,auth_mobile,address_list,remark,
is_deleted,creator_id,updater_id,create_time,update_time
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.csf.service.dao.PolicyInsurantMapper">
<resultMap id="BaseResultMap" type="com.yd.csf.service.model.PolicyInsurant">
<id property="id" column="id" />
<result property="policyInsurantBizId" column="policy_insurant_biz_id" />
<result property="policyBizId" column="policy_biz_id" />
<result property="policyNo" column="policy_no" />
<result property="customerType" column="customer_type" />
<result property="customerBizId" column="customer_biz_id" />
<result property="customerNo" column="customer_no" />
<result property="policyholderRel" column="policyholder_rel" />
<result property="name" column="name" />
<result property="nameEn" column="name_en" />
<result property="gender" column="gender" />
<result property="documentType" column="document_type" />
<result property="idNumber" column="id_number" />
<result property="birthday" column="birthday" />
<result property="age" column="age" />
<result property="residentialAddress" column="residential_address" />
<result property="mailingAddress" column="mailing_address" />
<result property="mobileCode" column="mobile_code" />
<result property="mobile" column="mobile" />
<result property="email" column="email" />
<result property="companyName" column="company_name" />
<result property="companyAddress" column="company_address" />
<result property="industry" column="industry" />
<result property="position" column="position" />
<result property="riskAppetite" column="risk_appetite" />
<result property="isVip" column="is_vip" />
<result property="vipRemark" column="vip_remark" />
<result property="appellation" column="appellation" />
<result property="smokingAllowed" column="smoking_allowed" />
<result property="birthplace" column="birthplace" />
<result property="nationality" column="nationality" />
<result property="passportNo" column="passport_no" />
<result property="passNo" column="pass_no" />
<result property="height" column="height" />
<result property="weight" column="weight" />
<result property="bmi" column="bmi" />
<result property="currentTenure" column="current_tenure" />
<result property="totalDebt" column="total_debt" />
<result property="dependentsNum" column="dependents_num" />
<result property="maritalStatus" column="marital_status" />
<result property="educationLevel" column="education_level" />
<result property="totalWorkingYears" column="total_working_years" />
<result property="currentMonthlyIncome" column="current_monthly_income" />
<result property="companyMobileCode" column="company_mobile_code" />
<result property="companyMobile" column="company_mobile" />
<result property="landlineCode" column="landline_code" />
<result property="landline" column="landline" />
<result property="otherMobile" column="other_mobile" />
<result property="isExceed" column="is_exceed" />
<result property="isOtherCountry" column="is_other_country" />
<result property="isPromotion" column="is_promotion" />
<result property="travel" column="travel" />
<result property="exercise" column="exercise" />
<result property="game" column="game" />
<result property="movieDrama" column="movie_drama" />
<result property="delicacy" column="delicacy" />
<result property="addressList" column="address_list" />
<result property="remark" column="remark" />
<result property="isDeleted" column="is_deleted" />
<result property="creatorId" column="creator_id" />
<result property="updaterId" column="updater_id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="smokingVolume" column="smoking_volume" />
<result property="currency" column="currency" />
<result property="companyNameEn" column="company_name_en" />
<result property="companyBusinessNo" column="company_business_no" />
<result property="companyRegisterTime" column="company_register_time" />
<result property="companyRegisterRegion" column="company_register_region" />
<result property="companyEmail" column="company_email" />
<result property="companyEnterAddress" column="company_enter_address" />
<result property="authNameCn" column="auth_name_cn" />
<result property="authNameEn" column="auth_name_en" />
<result property="authProfessional" column="auth_professional" />
<result property="authMobileCode" column="auth_mobile_code" />
<result property="authMobile" column="auth_mobile" />
</resultMap>
<sql id="Base_Column_List">
id,policy_insurant_biz_id,policy_biz_id,policy_no,customer_type,customer_biz_id,
customer_no,policyholder_rel,name,name_en,gender,
document_type,id_number,birthday,age,residential_address,
mailing_address,mobile_code,mobile,email,company_name,
company_address,industry,position,risk_appetite,is_vip,
vip_remark,appellation,smoking_allowed,birthplace,nationality,
passport_no,pass_no,height,weight,bmi,
current_tenure,total_debt,dependents_num,marital_status,education_level,
total_working_years,current_monthly_income,company_mobile_code,company_mobile,landline_code,
landline,other_mobile,is_exceed,is_other_country,is_promotion,
travel,exercise,game,movie_drama,delicacy,
address_list,remark,is_deleted,creator_id,updater_id,
create_time,update_time,smoking_volume,currency,company_name_en,
company_business_no,company_register_time,company_register_region,company_email,company_enter_address,
auth_name_cn,auth_name_en,auth_professional,auth_mobile_code,auth_mobile
</sql>
</mapper>
...@@ -9,14 +9,17 @@ ...@@ -9,14 +9,17 @@
<result property="policyBizId" column="policy_biz_id" /> <result property="policyBizId" column="policy_biz_id" />
<result property="policyNo" column="policy_no" /> <result property="policyNo" column="policy_no" />
<result property="userBizId" column="user_biz_id" /> <result property="userBizId" column="user_biz_id" />
<result property="planBizId" column="plan_biz_id" />
<result property="productCode" column="product_code" /> <result property="productCode" column="product_code" />
<result property="productName" column="product_name" /> <result property="productName" column="product_name" />
<result property="productCate" column="product_cate" /> <result property="productCate" column="product_cate" />
<result property="insurer" column="insurer" /> <result property="insurer" column="insurer" />
<result property="insurerBizId" column="insurer_biz_id" /> <result property="insurerBizId" column="insurer_biz_id" />
<result property="region" column="region" />
<result property="policyHolder" column="policy_holder" /> <result property="policyHolder" column="policy_holder" />
<result property="insured" column="insured" /> <result property="insured" column="insured" />
<result property="paymentTerm" column="payment_term" /> <result property="paymentTerm" column="payment_term" />
<result property="paymentFrequency" column="payment_frequency" />
<result property="paymentPremium" column="payment_premium" /> <result property="paymentPremium" column="payment_premium" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="currency" column="currency" /> <result property="currency" column="currency" />
...@@ -26,7 +29,13 @@ ...@@ -26,7 +29,13 @@
<result property="effectiveDate" column="effective_date" /> <result property="effectiveDate" column="effective_date" />
<result property="renewalDate" column="renewal_date" /> <result property="renewalDate" column="renewal_date" />
<result property="isPrepaid" column="is_prepaid" /> <result property="isPrepaid" column="is_prepaid" />
<result property="deductibles" column="deductibles" />
<result property="prepaidTerm" column="prepaid_term" /> <result property="prepaidTerm" column="prepaid_term" />
<result property="initialPaymentMethod" column="initial_payment_method" />
<result property="renewalPaymentMethod" column="renewal_payment_method" />
<result property="dividendDistributionMethod" column="dividend_distribution_method" />
<result property="isBacktrack" column="is_backtrack" />
<result property="isJoin" column="is_join" />
<result property="reconciliationCompany" column="reconciliation_company" /> <result property="reconciliationCompany" column="reconciliation_company" />
<result property="reconciliationCompanyBizId" column="reconciliation_company_biz_id" /> <result property="reconciliationCompanyBizId" column="reconciliation_company_biz_id" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
...@@ -38,11 +47,13 @@ ...@@ -38,11 +47,13 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,policy_biz_id,policy_no,user_biz_id,product_code,product_name, id,policy_biz_id,policy_no,user_biz_id,plan_biz_id,product_code,
product_cate,insurer,insurer_biz_id,policy_holder,insured, product_name,product_cate,insurer,insurer_biz_id,region,
payment_term,payment_premium,status,currency,initial_premium, policy_holder,insured,payment_term,payment_frequency,payment_premium,
sign_date,issue_date,effective_date,renewal_date,is_prepaid, status,currency,initial_premium,sign_date,issue_date,
prepaid_term,reconciliation_company,reconciliation_company_biz_id,remark,is_deleted, effective_date,renewal_date,is_prepaid,deductibles,prepaid_term,
creator_id,updater_id,create_time,update_time initial_payment_method,renewal_payment_method,dividend_distribution_method,is_backtrack,is_join,
reconciliation_company,reconciliation_company_biz_id,remark,is_deleted,creator_id,
updater_id,create_time,update_time
</sql> </sql>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.csf.service.dao.PolicyPolicyholderMapper">
<resultMap id="BaseResultMap" type="com.yd.csf.service.model.PolicyPolicyholder">
<id property="id" column="id" />
<result property="policyPolicyholderBizId" column="policy_policyholder_biz_id" />
<result property="policyBizId" column="policy_biz_id" />
<result property="policyNo" column="policy_no" />
<result property="customerType" column="customer_type" />
<result property="customerBizId" column="customer_biz_id" />
<result property="customerNo" column="customer_no" />
<result property="name" column="name" />
<result property="nameEn" column="name_en" />
<result property="gender" column="gender" />
<result property="documentType" column="document_type" />
<result property="idNumber" column="id_number" />
<result property="birthday" column="birthday" />
<result property="age" column="age" />
<result property="residentialAddress" column="residential_address" />
<result property="mailingAddress" column="mailing_address" />
<result property="mobileCode" column="mobile_code" />
<result property="mobile" column="mobile" />
<result property="email" column="email" />
<result property="companyName" column="company_name" />
<result property="companyAddress" column="company_address" />
<result property="industry" column="industry" />
<result property="position" column="position" />
<result property="riskAppetite" column="risk_appetite" />
<result property="isVip" column="is_vip" />
<result property="vipRemark" column="vip_remark" />
<result property="appellation" column="appellation" />
<result property="smokingAllowed" column="smoking_allowed" />
<result property="birthplace" column="birthplace" />
<result property="nationality" column="nationality" />
<result property="passportNo" column="passport_no" />
<result property="passNo" column="pass_no" />
<result property="height" column="height" />
<result property="weight" column="weight" />
<result property="bmi" column="bmi" />
<result property="monthExpenditure" column="month_expenditure" />
<result property="monthIncome" column="month_income" />
<result property="currentTenure" column="current_tenure" />
<result property="totalCurrentAssets" column="total_current_assets" />
<result property="totalDebt" column="total_debt" />
<result property="dependentsNum" column="dependents_num" />
<result property="maritalStatus" column="marital_status" />
<result property="educationLevel" column="education_level" />
<result property="totalWorkingYears" column="total_working_years" />
<result property="currentMonthlyIncome" column="current_monthly_income" />
<result property="companyMobileCode" column="company_mobile_code" />
<result property="companyMobile" column="company_mobile" />
<result property="landlineCode" column="landline_code" />
<result property="landline" column="landline" />
<result property="otherMobile" column="other_mobile" />
<result property="isExceed" column="is_exceed" />
<result property="isOtherCountry" column="is_other_country" />
<result property="isPromotion" column="is_promotion" />
<result property="postalCode" column="postal_code" />
<result property="travel" column="travel" />
<result property="exercise" column="exercise" />
<result property="game" column="game" />
<result property="movieDrama" column="movie_drama" />
<result property="delicacy" column="delicacy" />
<result property="addressList" column="address_list" />
<result property="smokingVolume" column="smoking_volume" />
<result property="currency" column="currency" />
<result property="companyNameEn" column="company_name_en" />
<result property="companyBusinessNo" column="company_business_no" />
<result property="companyRegisterTime" column="company_register_time" />
<result property="companyRegisterRegion" column="company_register_region" />
<result property="companyEmail" column="company_email" />
<result property="companyEnterAddress" column="company_enter_address" />
<result property="authNameCn" column="auth_name_cn" />
<result property="authNameEn" column="auth_name_en" />
<result property="authProfessional" column="auth_professional" />
<result property="authMobileCode" column="auth_mobile_code" />
<result property="authMobile" column="auth_mobile" />
<result property="remark" column="remark" />
<result property="isDeleted" column="is_deleted" />
<result property="creatorId" column="creator_id" />
<result property="updaterId" column="updater_id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="Base_Column_List">
id,policy_policyholder_biz_id,policy_biz_id,policy_no,customer_type,customer_biz_id,
customer_no,name,name_en,gender,document_type,
id_number,birthday,age,residential_address,mailing_address,
mobile_code,mobile,email,company_name,company_address,
industry,position,risk_appetite,is_vip,vip_remark,
appellation,smoking_allowed,birthplace,nationality,passport_no,
pass_no,height,weight,bmi,month_expenditure,
month_income,current_tenure,total_current_assets,total_debt,dependents_num,
marital_status,education_level,total_working_years,current_monthly_income,company_mobile_code,
company_mobile,landline_code,landline,other_mobile,is_exceed,
is_other_country,is_promotion,postal_code,travel,exercise,
game,movie_drama,delicacy,address_list,smoking_volume,
currency,company_name_en,company_business_no,company_register_time,company_register_region,
company_email,company_enter_address,auth_name_cn,auth_name_en,auth_professional,
auth_mobile_code,auth_mobile,remark,is_deleted,creator_id,
updater_id,create_time,update_time
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.csf.service.dao.PolicySecondHolderMapper">
<resultMap id="BaseResultMap" type="com.yd.csf.service.model.PolicySecondHolder">
<id property="id" column="id" />
<result property="policySecondHolderBizId" column="policy_second_holder_biz_id" />
<result property="policyBizId" column="policy_biz_id" />
<result property="policyNo" column="policy_no" />
<result property="insurantRel" column="insurant_rel" />
<result property="name" column="name" />
<result property="nameEn" column="name_en" />
<result property="gender" column="gender" />
<result property="documentType" column="document_type" />
<result property="idNumber" column="id_number" />
<result property="passportNumber" column="passport_number" />
<result property="birthTime" column="birth_time" />
<result property="age" column="age" />
<result property="remark" column="remark" />
<result property="isDeleted" column="is_deleted" />
<result property="creatorId" column="creator_id" />
<result property="updaterId" column="updater_id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="Base_Column_List">
id,policy_second_holder_biz_id,policy_biz_id,policy_no,insurant_rel,name,
name_en,gender,document_type,id_number,passport_number,
birth_time,age,remark,is_deleted,creator_id,
updater_id,create_time,update_time
</sql>
</mapper>
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