Commit c4485f32 authored by fangxinjiang's avatar fangxinjiang

商险 提醒

parent 34902cf2
......@@ -72,14 +72,14 @@ public class TInsuranceAreaRes extends BaseEntity {
@NotBlank(message = "档案-省不能为空")
@ExcelProperty("档案-省")
@Schema(description = "档案-省")
private Integer province;
private String province;
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市",isArea = true,parentField = "province")
@ExcelProperty("档案-市")
@Schema(description = "档案-市")
private Integer city;
private String city;
/**
......
......@@ -12,76 +12,51 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 商险派单信息表
*
* @author wangan
* @date 2019-07-25 12:37:57
*/
* @Author fxj
* @Description 商险派单信息表
* @Date 16:59 2023/2/20
**/
@Data
@Schema(name = "商险派单信息表")
public class TBusinessInsuranceVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(name = "编码")
private String id;
/**
* 员工ID
*/
@Schema(name = "新员工ID")
private String empId;
/**
* 员工编码
*/
@Schema(name = "员工编码")
private String empNo;
/**
* 员工姓名
*/
@Schema(name = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(name = "员工身份证号码")
private String empIdcardNo;
/**
* 员工姓名
*/
@Schema(name = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(name = "员工身份证号码")
private String empIdcardNo;
/**
* 结算部门名称中文(内部组织架构)
*/
@Schema(name = "结算主体名称")
private String settlementOrganName;
@Schema(name = "项目名称")
private String deptName;
/**
* 结算部门编码(内部组织架构)
*/
@Schema(name = "结算主体编码")
private String settlementOrganNo;
/**
* 保险公司(配置项)
*/
@Schema(name = "保险公司ID")
private String insuranceCompany;
/**
* 险种(配置项)
*/
@Schema(name = "险种ID")
private String insuranceType;
/**
* 保险公司(配置项)
*/
@Schema(name = "保险公司(配置项)")
private String insuranceCompanyName;
/**
* 险种名称中文(配置项) 用于导入
*/
@Schema(name = "险种名称")
private String insuranceTypeName;
@Schema(name = "项目编码")
private String deptNo;
/**
* 保险公司(配置项)
*/
@Schema(name = "保险公司(配置项)")
private String insuranceCompanyName;
/**
* 险种名称中文(配置项) 用于导入
*/
@Schema(name = "险种名称")
private String insuranceTypeName;
/**
* 保单开始时间
*/
......@@ -103,466 +78,172 @@ public class TBusinessInsuranceVo implements Serializable {
* 实际保费
*/
@Schema(name = "保费")
private BigDecimal buyPay;
/**
* 是否带入工资结算(0是/1否)默认0
*/
@Schema(name = "是否带入工资结算(0是/1否)默认0")
private String isAtSalary;
/**
* 创建人
*/
@Schema(name = "创建人")
private String createUser;
/**
* 创建时间
*/
@Schema(name = "创建时间")
private LocalDateTime createTime;
/**
* 状态 0.待提交 1.待办理 2.已提交保险公司 3.已办理 4.办理失败 5:待结算(已输入保单号)6:已结算 7: 结算中(工资、社保)8:扫描出账中 9 已出账 10 已退保 11 带退保 12退保中
*/
@Schema(name = "办理状态")
private String status;
/**
* 出险状态(0未出险;1已出险)
*/
@Schema(name = "出险状态(0未出险;1已出险)")
private Integer useStatus;
/**
* 保单号
*/
@Schema(name = "保单号")
private String policyNo;
/**
* 医保
*/
@Schema(name = "医保")
private BigDecimal medicalMoney;
/**
private BigDecimal actualPremium;
/**
* 创建人
*/
@Schema(name = "创建人")
private String createName;
/**
* 创建时间
*/
@Schema(name = "创建时间")
private LocalDateTime createTime;
/**
* 投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@Schema(name = "办理状态")
private String buyHandleStatus;
/**
* 出险状态(0未出险;1已出险)
*/
/*@Schema(name = "出险状态(0未出险;1已出险)")
private Integer useStatus;*/
/**
* 保单号
*/
@Schema(name = "保单号")
private String policyNo;
/**
* 医保
*/
@Schema(name = "医保")
private BigDecimal medicalQuota;
/**
* 身故或残疾
*/
@Schema(name = "身故或残疾")
private BigDecimal deathDisabilityMoney;
/**
* 结算部门(外部)(未使用作废处理)
*/
@Schema(name = "结算部门(外部)")
private String settlementDepart;
/**
* 结算部门(内部组织架构)
*/
@Schema(name = "结算主体ID(内部组织架构)")
private String settlementOrgan;
/**
private BigDecimal dieDisableQuota;
/**
* 结算月份
*/
@Schema(name = "结算月份")
private String settleMonth;
/**
* 发票号
*/
@Schema(name = "发票号")
private String invoiceNo;
/**
* 被替换时间
*/
@Schema(name = "被替换时间")
private LocalDateTime replaceDate;
/**
* 替换状态(1.未替换 2.替换)
*/
@Schema(name = "替换状态(1.未替换 2.替换)")
private String replaceStatus;
/**
* 结算类型(数据字典)
*/
@Schema(name = "结算类型ID(数据字典)")
private String settleType;
/**
* 办理时间
*/
@Schema(name = "办理时间")
private LocalDateTime batchDate;
/**
* 是否被通知了(1:是 / 0: 否)
*/
@Schema(name = "是否被通知了(1:是 / 0: 否)")
private String isNotice;
/**
* 结算月份
*/
@Schema(name = "结算月份")
private String settleMonth;
/**
* 发票号
*/
@Schema(name = "发票号")
private String invoiceNo;
/**
* 购买类型:新增、 短期 、批增
*/
@Schema(name = "购买类型:新增、 短期 、批增")
private String buyType;
/**
* 最后更新人
*/
@Schema(name = "最后更新人")
private String lastUpdateUser;
/**
* 最后更新时间
*/
@Schema(name = "最后更新时间")
private LocalDateTime lastUpdateTime;
/**
* 原ID(数据迁移)
*/
@Schema(name = "原ID(数据迁移)")
private Integer oldId;
/**
* 扫描商险结算单ID
*/
@Schema(name = "扫描商险结算单ID")
private String settlementFormId;
/**
* 是否作废 (0否/1是)
*/
@Schema(name = "是否作废(0否/1是)")
private String invalidFlag;
/**
* 消息提醒备注
*/
@Schema(name = "备注(未续保原因)", maxLength = 32)
private String expireRemark;
/**
* 忽略提醒 0:忽略 1:不忽略
*/
@Schema(name = "有忽略提醒 0:忽略 1:不忽略")
private String expireIgnoreFlag;
/**
* 保单生效时间
*/
@Schema(name = "保单生效时间")
private LocalDate policyEffect;
/**
* 创建人id
*/
@Schema(name = "创建人id")
private Integer createUserId;
/**
* 商险非单独结算ID(与薪资、社保结算)
*/
@Schema(name = "商险非单独结算ID(与薪资、社保结算)")
private String settlementAutoFormId;
/**
* 客户id
*/
@Schema(name = "客户id")
private String customerId;
/**
* 客户名称
*/
@Schema(name = "客户名称")
private String customerName;
/**
* 更新人id
*/
@Schema(name = "更新人id")
private Integer lastUpdateUserId;
@Schema(name = "表单ID")
private String settleFormId;
//4:非单独商险扫描结算;这个还是要单独的列-settlementAutoFormId
@Schema(name = "表单类型(0:普通工资发放;1:工程类工资发放;2:预估发放;3:单独结算;)")
private String settleFormType;
/**
* 购买类型:新增、 短期 、批增
*/
@Schema(name = "购买类型名称:新增、 短期 、批增")
private String buyTypeName;
/**
* 备注
*/
@Schema(name = "备注")
private String remark;
/**
* 商险购买地省
*/
@Schema(name = "商险购买地省")
private String businessInsuranceProv;
/**
* 商险购买地
*/
@Schema(name = "商险购买地市")
private String businessInsuranceAddr;
/**
* 商险购买地省Id
*/
@Schema(name = "商险购买地省Id")
private String businessInsuranceProvId;
/**
* 商险购买地id
*/
@Schema(name = "商险购买地市id")
private String businessInsuranceAddrId;
/**
* 失效状态 0 有效 1无效。主要用于替换
*/
@Schema(name = "失效状态 0 有效 1无效。主要用于替换")
private String validFlag;
/**
* 岗位
*/
@Length(max = 32, message = "岗位不能超过32个字符")
private String post;
/*----------------------------用于修改的所有字段---------------------------------*/
/**
* 新购买标准
*/
@Schema(name = "新购买标准")
private String newBuyStandard;
/**
* 保单新的开始时间
*/
@Schema(name = "保单新的开始时间")
private LocalDate newPolicyStart;
/**
* 保单新结束时间
*/
@Schema(name = "保单新的结束时间")
private LocalDate newPolicyEnd;
/**
* 新险种名称中文(配置项)
*/
@Schema(name = "新险种(配置项)")
private String newInsuranceTypeName;
/**
* 保险公司(配置项)
*/
@Schema(name = "保险公司(配置项)")
private String newIInsuranceCompanyName;
/**
* 新员工ID
*/
@Schema(name = "新员工ID")
private String newEmpId;
/**
* 新员工名称
*/
@Schema(name = "新员工ID")
private String newEmpName;
/**
* 新员工身份证
*/
@Schema(name = "新员工身份证")
private String newEmpIdcardNo;
/**
* 新员工项目
*/
@Schema(name = "新员工项目")
private String newSettlementOrganNo;
/**
* 新员工名称
*/
@Schema(name = "新员工名称")
private String newSettlementOrganName;
/**
* 结算类型名称中文(数据字典)用于导入
*/
@Schema(name = "结算类型(数据字典)")
private String settleTypeName;
// /**
// * 状态中文 0.待提交 1.待办理 2.已提交保险公司 3.已办理 4.办理失败 5:待结算(已输入保单号)6:已结算 7: 结算中(工资、社保)8:扫描出账中 9 已出账
// */
// @Schema(name = "状态 0.待提交 1.待办理 2.已提交保险公司 3.已办理 4.办理失败 5:待结算(已输入保单号)6:已结算 7: 结算中(工资、社保)8:扫描出账中 9 已出账", name = "statusName", dataType = "String")
// @ExcelAttribute(name = "状态名称")
// private String statusName
/**
* 被替换人ID
*/
@Schema(name = "被替换人ID")
private String TO_EmployID;
/*----------------------------用于展示给前端的其他数据:员工信息、部门等信息---------------------------------*/
// private TEmployeeInfoVo tEmployeeInfoVo
/*----------------查询-----------------------------------------------*
/**
* 创建时间
*/
private LocalDateTime createTimeStart;
private LocalDateTime createTimeEnd;
//替换人名称,用户展示
@Schema(name = "被替换人姓名")
private String fromEmpName;
@Schema(name = "替换人姓名")
//被替换名称,用户展示
private String toEmpName;
@Schema(name = "替换时间")
private String toReplaceTime;
//员工档案需要
/**
* 身份证-省
*/
@Schema(name = "身份证-省")
private Integer idProvince;
/**
* 身份证-市
*/
@Schema(name = "身份证-市")
private Integer idCity;
/**
* 身份证-县
*/
@Schema(name = "身份证-县")
private Integer idTown;
/**
* 档案-省
*/
@Schema(name = "档案-省")
private Integer fileProvince;
/**
* 档案-市
*/
@Schema(name = "档案-市")
private Integer fileCity;
/**
* 档案-县
*/
@Schema(name = "档案-县")
private Integer fileTown;
/**
* 员工类型
*/
@Schema(name = "员工类型")
private String empType;
/**
* 员工标签
*/
@Schema(name = "员工标签")
private String empLabel;
/**
* 手机号
*/
@Schema(name = "手机号")
private String empPhone;
/**
* 是否过期状态 0 未过期 1已过期。主要用于页面查询展示
*/
@Schema(name = "是否过期")
private String expireFlag;
/**
* 到期消息提醒批量导入是否续保
*/
@Schema(name = "是否续保", maxLength = 32)
private String renewal;
/**
* 购买月数
*/
@Schema(name = "购买月数")
private String buyMonth;
/**
* 预估保费
*/
@Schema(name = "预估保费")
private BigDecimal forecastBuyPay;
/**
* 保费结算类型:1取实际保费 2.取预估保费
*/
@Schema(name = "保费结算类型:1取实际保费 2.取预估保费")
private String settleBuyPayType;
/**
* 实际保费-预估保费 差额
*/
@Schema(name = "差额")
private BigDecimal balance;
/**
* 退保记录id
*/
@Schema(name = "退保记录id")
private String refundRecordId;
/**
* 退费金额
*/
@Schema(name = "退费金额")
private BigDecimal refundMoney;
/**
* 退费时间
*/
@Schema(name = "退费时间")
private LocalDateTime refundCreateTime;
/**
* 退费人
*/
@Schema(name = "退费人")
private String refundCreateUser;
/**
* 行业类型
*/
@Schema(name = "行业类型")
private String industryBelong;
private String replaceTime;
/**
* 保单生效时间
*/
@Schema(name = "保单生效时间")
private String policyEffect;
/**
* 客户名称
*/
@Schema(name = "客户名称")
private String customerName;
/**
* 备注
*/
@Schema(name = "备注")
private String remark;
/**
* 商险购买地省
*/
@Schema(name = "商险购买地省")
private String insuranceProvince;
/**
* 商险购买地
*/
@Schema(name = "商险购买地市")
private String insuranceCityName;
/**
* 是否有效 0有效 1无效
*/
@Schema(name = "是否有效 0有效 1无效")
private String isEffect;
/**
* 岗位
*/
@Length(max = 32, message = "岗位不能超过32个字符")
private String post;
//替换人名称,用户展示
@Schema(name = "被替换人姓名")
private String fromEmpName;
@Schema(name = "替换人姓名")
//被替换名称,用户展示
private String toEmpName;
@Schema(name = "替换时间")
private String toReplaceTime;
/**
* 是否过期状态 0 未过期 1已过期。主要用于页面查询展示
*/
@Schema(name = "是否过期")
private String isOverdue;
/**
* 预估保费
*/
@Schema(name = "预估保费")
private BigDecimal estimatePremium;
/**
* 保费结算类型:1取实际保费 2.取预估保费
*/
@Schema(name = "保费结算类型:1取实际保费 2.取预估保费")
private String settleType;
/**
* 退费金额
*/
@Schema(name = "退费金额")
private BigDecimal refundMoney;
/**
* 退费时间
*/
@Schema(name = "退费时间")
private LocalDateTime refundCreateTime;
/**
* 退费人
*/
@Schema(name = "退费人")
private String refundCreateUser;
/*
*/
/**
* 行业类型
*//*
/**
* 我司到款单位名称
*/
@Schema(name = "我司到款单位名称")
private String selfTomoneyUnitName;
/**
* 派单人所属部门
*/
@Schema(name = "派单人所属部门")
private String userDeptName;
@Schema(name = "行业类型")
private String industryBelong;
*/
/**
* 我司到款单位名称
*//*
@Schema(name = "我司到款单位名称")
private String selfTomoneyUnitName;
*/
/**
* 派单人所属部门
*/
@Schema(name = "派单人所属部门")
private String createUserDeptName;
/**
* 消息提醒备注
*/
private String expireRemark;
}
......@@ -52,7 +52,7 @@ public class TInsurancesWarnController {
@Operation(description = "商险到期提醒分页查询")
@GetMapping("/getExpireWarn/Vopage")
public R<IPage<TBusinessInsuranceVo>> getTBusinessInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page, TBusinessInsuranceVo tBusinessInsurance) {
return insuranceDetailService.getInsuranceExpireWarnVoPage(page, tBusinessInsurance);
return R.ok(insuranceDetailService.getInsuranceExpireWarnVoPage(page, tBusinessInsurance));
}
/**
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
......@@ -276,4 +277,12 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
**/
List<InsuranceUpdateVO> selectByIds(@Param("ids") List<String> ids);
/**
* @Author fxj
* @Description 商险提醒分页查询
* @Date 16:33 2023/2/20
**/
IPage<TBusinessInsuranceVo> getInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page,
@Param("param")TBusinessInsuranceVo param,
@Param("domains")List<TSettleDomainSelectVo> domains);
}
......@@ -510,7 +510,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
**/
void updateSettleStatus();
R<IPage<TBusinessInsuranceVo>> getInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page, TBusinessInsuranceVo tBusinessInsurance);
IPage<TBusinessInsuranceVo> getInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page, TBusinessInsuranceVo tBusinessInsurance);
R<List<WorkBanchWarnVo>> getExpireInsuranceWarn(Integer expireInsuranceWarnNameUrlFlag, Integer noBuyInsuranceWarnNameUrlFlag, Integer noSettleInsuranceWarnNameUrlFlag, Boolean haveAllOrg, Integer userId);
......
......@@ -27,6 +27,7 @@ import com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpInsuranceUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.*;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceAreaResMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceDetailMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TUpdateStatusErrorMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceAreaResService;
......@@ -127,6 +128,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
private TInsuranceAreaResService tInsuranceAreaResService;
@Resource
private TUpdateStatusErrorMapper updateStatusErrorMapper;
@Resource
private TInsuranceAreaResMapper insuranceAreaResMapper;
/***********************商险办理********************************/
/**
* 每日定时刷新商险到期数据
......@@ -7393,8 +7396,31 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @Date 16:51 2023/2/16
**/
@Override
public R<IPage<TBusinessInsuranceVo>> getInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page, TBusinessInsuranceVo tBusinessInsurance) {
return null;
public IPage<TBusinessInsuranceVo> getInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page, TBusinessInsuranceVo condition) {
YifuUser user = SecurityUtils.getUser();
if (!SecurityUtils.isHaveAllOrg(null, user)) {
R<TSettleDomainListVo > sdRes = archivesDaprUtil.getPermissionByUserId(user.getId());
List<TInsuranceAreaRes> areaRes = insuranceAreaResMapper.selectList(Wrappers.<TInsuranceAreaRes>query().lambda()
.eq(TInsuranceAreaRes::getUserId,user.getId()).eq(TInsuranceAreaRes::getStatus,CommonConstants.ZERO_STRING));
if (Common.isNotNull(areaRes)) {
List<String> provinces = new ArrayList<>();
List<String> citys = new ArrayList<>();
for (TInsuranceAreaRes res:areaRes){
if (Common.isEmpty(res.getCity())){
provinces.add(res.getProvince());
}else {
citys.add(res.getCity());
}
}
condition.setBusinessInsuranceProvId(provinces);
condition.setBusinessInsuranceAddrId(citys);
}
condition.setCreateUserId(SecurityUtils.getUser().getId());
if (Common.isNotNull(sdRes) && Common.isNotNull(sdRes.getData())){
return baseMapper.getInsuranceExpireWarnVoPage(page, condition, sdRes.getData().getListSelectVO());
}
}
return baseMapper.getInsuranceExpireWarnVoPage(page, condition, null);
}
@Override
......
......@@ -1467,4 +1467,127 @@
</if>
ORDER BY refund.CREATE_TIME DESC,a.ID ASC
</select>
<sql id="selectParamsVo">
t.ID id,
t.EMP_ID empId,
t.EMP_NO empNo,
t.EMP_NAME empName,
t.EMP_IDCARD_NO empIdcardNo,
t.INSURANCE_COMPANY insuranceCompany,
t.INSURANCE_TYPE insuranceType,
t.POLICY_START policyStart,
t.POLICY_END policyEnd,
t.BUY_PAY buyPay,
t.IS_AT_SALARY isAtSalary,
t.REMARK,
t.CREATE_USER createUser,
t.CREATE_TIME createTime,
t.STATUS,
t.POLICY_NO policyNo,
t.MEDICAL_MONEY medicalMoney,
t.DEATH_DISABILITY_MONEY deathDisabilityMoney,
t.SETTLEMENT_DEPART settlementDepart,
t.SETTLEMENT_ORGAN settlementOrgan,
t.REPLACE_DATE replaceDate,
t.REPLACE_STATUS replaceStatus,
t.BUSINESS_INSURANCE_ADDR businessInsuranceAddr,
t.SETTLE_TYPE settleType,
t.BUY_STANDARD buyStandard,
t.BATCH_DATE batchDate,
t.IS_NOTICE isNotice,
t.SETTLE_MONTH settleMonth,
t.INVOICE_NO invoiceNo,
t.BUY_TYPE buyType,
t.LAST_UPDATE_USER lastUpdateUser,
t.LAST_UPDATE_TIME lastUpdateTime,
t.OLD_ID oldId,
t.SETTLEMENT_FORM_ID settlementFormId,
t.IS_SUBMIT,
t.CUSTOMER_NAME customerName,
t.CUSTOMER_ID customerId,
t.SETTLEMENT_ORGAN_NAME settlementOrganName,
t.SETTLEMENT_ORGAN_NO settlementOrganNo,
t.SETTLE_FORM_TYPE settleFormType,
t.POLICY_EFFECT policyEffect,
t.SETTLE_FORM_ID settleFormId,
p.NAME insuranceTypeName,
tic.COMPANY_NAME insuranceCompanyName,
t.BUSINESS_INSURANCE_PROV_ID businessInsuranceProvId,
t.BUSINESS_INSURANCE_ADDR_ID businessInsuranceAddrId,
t.BUSINESS_INSURANCE_PROV businessInsuranceProv,t.VALID_FLAG validFlag,
t.FORECAST_BUY_PAY,
t.SETTLE_BUY_PAY_TYPE
,case when t.POLICY_END &lt; date(now()) then '1' else 0 end 'expireFlag',
t.post,
t.BUY_MONTH,
t.REFUND_RECORD_ID,
t.REFUND_MONEY,
t.REFUND_CREATE_TIME,
t.REFUND_CREATE_USER,
t.USER_DEPT_NAME
</sql>
<sql id="expire_sql_param">
SELECT
re.TO_EMP_NAME 'toEmpName',tir.FROM_EMP_NAME 'fromEmpName' ,tir.CREATE_TIME 'fromReplaceTime',re.CREATE_TIME 'toReplaceTime',
<include refid="selectParamsVo"/>
,EXPIRE_REMARK expireRemark,EXPIRE_IGNORE_FLAG expireIgnoreFlag
FROM t_insurance_detail t
JOIN (SELECT max(POLICY_END) POLICY_END, EMP_IDCARD_NO,BUY_STANDARD, INSURANCE_TYPE
FROM t_business_insurance
WHERE INVALID_FLAG = '0'
<!-- 状态 3.已办理 5:待结算(已输入保单号)6:已结算 7: 结算中(工资、社保)8:扫描出账中 9 -->
AND STATUS in('3','5','6','7','8','9')
GROUP BY EMP_IDCARD_NO,BUY_STANDARD, INSURANCE_TYPE) cig
ON t.EMP_IDCARD_NO = cig.EMP_IDCARD_NO AND t.POLICY_END = cig.POLICY_END AND t.BUY_STANDARD = cig.BUY_STANDARD and
t.INSURANCE_TYPE = cig.INSURANCE_TYPE
join t_insurance_company tic on t.INSURANCE_COMPANY = tic.ID
join t_insurance_type p on t.INSURANCE_TYPE=p.ID
left join t_insurance_replace tir on t.ID = tir.INSURANCE_ID
LEFT JOIN (select l.* from t_insurance_replace l left join t_business_insurance tbi on l.TO_INSURANCE_ID = tbi.ID where tbi.invalid_Flag='0' and STATUS!=4 ) re ON t.id= re.INSURANCE_ID
</sql>
<sql id="expire_sql_where">
<where>
<!-- info.AUDIT_STATUS='0' and t.STATUS = 5 状态 0.待提交 1.待办理 2.已提交保险公司 3.已办理 4.办理失败 5:待结算(已输入保单号)-->
AND t.INVALID_FLAG='0' <!--未作废-->
<!--一个月内的,没有再续买商险的数据-->
and t.STATUS in('3','5','6','7','8','9')
and EXPIRE_IGNORE_FLAG='1'
and (
date_add(curdate() - day(curdate()) + 1, interval 3 month) >
t.POLICY_END
)
and t.VALID_FLAG='0'
<if test="param.empName != null and param.empName.trim() != ''">
AND t.EMP_NAME like CONCAT('%' , #{param.empName},'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
AND t.EMP_IDCARD_NO like CONCAT('%' ,#{param.empIdcardNo},'%')
</if>
<!--数据权限判断-->
AND (t.CREATE_USER_ID = #{param.createUserId}
<if test="domains != null">
<if test="domains.size() > 0">
or t.SETTLEMENT_ORGAN in
<foreach collection="domains" item="param" index="index" open="(" close=")" separator=",">
#{param.id}
</foreach>
</if>
</if>
<if test="domains == null">
or 1=1
</if>
)
</where>
order by t.CREATE_TIME desc
</sql>
<select id="getInsuranceExpireWarnVoPage"
resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.TBusinessInsuranceVo">
<include refid="expire_sql_param"/>
<include refid="expire_sql_where"/>
</select>
</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