Commit 7c1e06d9 authored by zhaji's avatar zhaji

"feature-zhaJi:优化投保列表分页查询"

parent bc5b11b4
......@@ -418,7 +418,7 @@ public class TInsuranceDetailController {
}
/**
* 出险
* 紧急出险
*
* @author zhaji
* @param empIdcardNo 身份证
......
......@@ -177,4 +177,6 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @return
*/
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard);
List<TInsuranceDetail> selectListByempIdcardNo(String empIdcardNo);
}
......@@ -3950,23 +3950,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (!ValidityUtil.validateIDCard(empIdcardNo)){
return R.failed("身份证格式不正确");
}
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
//查询所有在保,未出险,未过期,未失效,未减员的保单信息
queryWrapper.eq(TInsuranceDetail :: getEmpIdcardNo,empIdcardNo)
.eq(TInsuranceDetail :: getBuyHandleStatus ,CommonConstants.THREE_INT)
.eq(TInsuranceDetail :: getIsEffect,CommonConstants.ZERO_INT)
.eq(TInsuranceDetail :: getIsUse,CommonConstants.ZERO_INT)
.eq(TInsuranceDetail :: getIsOverdue,CommonConstants.ZERO_INT)
.ne(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.ONE_INT)
.ne(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT)
.ne(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.FOUR_INT);
List<TInsuranceDetail> list = list(queryWrapper);
List<TInsuranceDetail> list = this.baseMapper.selectListByempIdcardNo(empIdcardNo);
if (CollectionUtils.isEmpty(list)){
return R.failed("无可出险的保单");
}
for (TInsuranceDetail tInsuranceDetail : list) {
tInsuranceDetail.setIsUse(CommonConstants.ONE_INT);
//tInsuranceDetail.setUpdateBy();
tInsuranceDetail.setUpdateTime(LocalDateTime.now());
}
boolean b = updateBatchById(list);
......
......@@ -304,7 +304,7 @@
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
and detail.DEPT_NO = #{param.deptNo}
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
......@@ -340,7 +340,7 @@
<if test="param.createEndTime != null and param.createEndTime.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.createEndTime}, ' 23:59:59')
</if>
ORDER BY detail.CREATE_TIME DESC
ORDER BY detail.CREATE_TIME ,detail.ID DESC
</select>
<!-- 已投保列表不分页查询-->
<select id="getInsuredList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
......@@ -783,4 +783,20 @@
</where>
ORDER BY CREATE_TIME desc
</select>
<select id="selectListByempIdcardNo" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
SELECT
<include refid="Base_Column_List"/>
FROM t_insurance_detail
<where>
EMP_IDCARD_NO = #{empIdcardNo}
AND IS_EFFECT = 0
AND IS_USE =0
and IS_OVERDUE = 0
and DELETE_FLAG = 0
and BUY_HANDLE_STATUS =3
and (REDUCE_HANDLE_STATUS is null or REDUCE_HANDLE_STATUS = 3)
</where>
ORDER BY CREATE_TIME desc
</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