小程序查询长者信息接口增加返回内容:医保类型、失能等级、缴费状态对应中文名称
This commit is contained in:
parent
8f6018b4ef
commit
63ae23f4b1
|
|
@ -1,5 +1,6 @@
|
||||||
package com.nu.entity;
|
package com.nu.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
@ -281,4 +282,17 @@ public class ElderInfoEntity implements Serializable {
|
||||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date checkinTime;
|
private Date checkinTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医保类型中文名
|
||||||
|
*/
|
||||||
|
private String yblxName;
|
||||||
|
/**
|
||||||
|
* 失能等级中文名
|
||||||
|
*/
|
||||||
|
private String sndjName;
|
||||||
|
/**
|
||||||
|
* 缴费状态中文名
|
||||||
|
*/
|
||||||
|
private String jfztName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,7 @@ package com.nu.modules.elderinfo.entity;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
@ -372,4 +369,21 @@ public class ElderInfo implements Serializable {
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date checkinTime;
|
private Date checkinTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医保类型中文名
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String yblxName;
|
||||||
|
/**
|
||||||
|
* 失能等级中文名
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String sndjName;
|
||||||
|
/**
|
||||||
|
* 缴费状态中文名
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String jfztName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@ package com.nu.modules.elderinfo.mapper;
|
||||||
|
|
||||||
import com.nu.modules.elderinfo.entity.ElderInfo;
|
import com.nu.modules.elderinfo.entity.ElderInfo;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 长者信息
|
* @Description: 长者信息
|
||||||
|
|
@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
*/
|
*/
|
||||||
public interface ElderInfoMapper extends BaseMapper<ElderInfo> {
|
public interface ElderInfoMapper extends BaseMapper<ElderInfo> {
|
||||||
|
|
||||||
|
List<ElderInfo> selectLists(@Param("openId") String openId,@Param("elderId") String elderId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,30 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!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">
|
<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>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -42,13 +42,7 @@ public class ElderInfoServiceImpl extends ServiceImpl<ElderInfoMapper, ElderInfo
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ElderInfoEntity> queryElders(String openId, String elderId) {
|
public List<ElderInfoEntity> queryElders(String openId, String elderId) {
|
||||||
QueryWrapper<ElderInfo> qw = new QueryWrapper<>();
|
return BeanUtil.copyToList(baseMapper.selectLists(openId, elderId), ElderInfoEntity.class);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue