小程序查询长者信息接口增加返回内容:医保类型、失能等级、缴费状态对应中文名称

This commit is contained in:
1378012178@qq.com 2026-01-09 14:53:59 +08:00
parent 8f6018b4ef
commit 63ae23f4b1
5 changed files with 63 additions and 11 deletions

View File

@ -1,5 +1,6 @@
package com.nu.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@ -281,4 +282,17 @@ public class ElderInfoEntity implements Serializable {
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date checkinTime;
/**
* 医保类型中文名
*/
private String yblxName;
/**
* 失能等级中文名
*/
private String sndjName;
/**
* 缴费状态中文名
*/
private String jfztName;
}

View File

@ -3,10 +3,7 @@ package com.nu.modules.elderinfo.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
@ -372,4 +369,21 @@ public class ElderInfo implements Serializable {
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date checkinTime;
/**
* 医保类型中文名
*/
@TableField(exist = false)
private String yblxName;
/**
* 失能等级中文名
*/
@TableField(exist = false)
private String sndjName;
/**
* 缴费状态中文名
*/
@TableField(exist = false)
private String jfztName;
}

View File

@ -2,6 +2,9 @@ package com.nu.modules.elderinfo.mapper;
import com.nu.modules.elderinfo.entity.ElderInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Description: 长者信息
@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface ElderInfoMapper extends BaseMapper<ElderInfo> {
List<ElderInfo> selectLists(@Param("openId") String openId,@Param("elderId") String elderId);
}

View File

@ -2,4 +2,30 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nu.modules.elderinfo.mapper.ElderInfoMapper">
<select id="selectLists" resultType="com.nu.modules.elderinfo.entity.ElderInfo">
select elder.*,
yblxDictItem.item_text as yblxName,
sndjDictItem.item_text as sndjName,
jfztDictItem.item_text as jfztName
from nu_biz_elder_info elder
LEFT JOIN sys_dict yblxDict on yblxDict.dict_code = 'medical_insurance_type'
LEFT JOIN sys_dict_item yblxDictItem on yblxDictItem.dict_id = yblxDict.id and
yblxDictItem.item_value = elder.medical_type
LEFT JOIN sys_dict sndjDict on sndjDict.dict_code = (case elder.medical_type
when 'syb' then 'syb_reimbursement_type'
when ' zgyb' then 'zgyb_reimbursement_type'
when 'jmyb' then 'jmyb_reimbursement_type'
else '' end)
LEFT JOIN sys_dict_item sndjDictItem on sndjDictItem.dict_id = sndjDict.id and
sndjDictItem.item_value = elder.disability_reimbursement_type
LEFT JOIN sys_dict jfztDict on jfztDict.dict_code = 'elder_payment_status'
LEFT JOIN sys_dict_item jfztDictItem on jfztDictItem.dict_id = jfztDict.id and
jfztDictItem.item_value = elder.payment_status
<where>
elder.guardian_open_id = #{openId}
<if test="elderId != null and elderId != ''">
and elder.id = #{elderId}
</if>
</where>
</select>
</mapper>

View File

@ -42,13 +42,7 @@ public class ElderInfoServiceImpl extends ServiceImpl<ElderInfoMapper, ElderInfo
@Override
public List<ElderInfoEntity> queryElders(String openId, String elderId) {
QueryWrapper<ElderInfo> qw = new QueryWrapper<>();
qw.eq("guardian_open_id", openId);
if (StringUtils.isNotBlank(elderId)) {
qw.eq("id", elderId);
}
List<ElderInfo> elderInfos = baseMapper.selectList(qw);
return BeanUtil.copyToList(elderInfos, ElderInfoEntity.class);
return BeanUtil.copyToList(baseMapper.selectLists(openId, elderId), ElderInfoEntity.class);
}
@Override