Commit 79815f56 authored by zhangwanglin's avatar zhangwanglin

出院情况查询条件

parent 608078e9
......@@ -51,4 +51,6 @@ public class ChSrvTaskDetailVo extends BaseReq {
*/
private String modeName;
private String hospitalFlag;
}
......@@ -47,4 +47,6 @@ public interface BuildBedMapper extends BaseMapper<ChSrvBuildBed> {
String selectModeTypeById(@Param("pId")Long pId);
int getRoleByUserId(@Param("userId") Integer userId,@Param("roleIds") List<String> roleIds );
int selectSrvSend(String disabInfoId);
}
......@@ -101,6 +101,15 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
public Page<ChSrvTaskDetailVo> chSrvTaskDetailQuery(Page<ChSrvTaskDetailVo> page,ChSrvTaskDetailVo vo){
Page<ChSrvTaskDetailVo> chSrvTaskDetailVoPage = buildBedMapper.chSrvTaskDetailQuery(page, vo);
chSrvTaskDetailVoPage.getRecords().stream().filter(chSrvTaskDetail -> {
String disabInfoId = chSrvTaskDetail.getDisabInfoId();
String hospitalFlag = chSrvTaskDetail.getHospitalFlag();
if("1".equals(hospitalFlag)){
int count = buildBedMapper.selectSrvSend(disabInfoId);
if(count > 0) {
chSrvTaskDetail.setHospitalFlag("0");
}
}
if (null != chSrvTaskDetail.getSevStarTime()){
chSrvTaskDetail.setSevStarTime(chSrvTaskDetail.getSevStarTime().substring(0,19));
}
......
......@@ -36,7 +36,9 @@
info.REAL_NAME realName,--失能人员名字
info.CERTI_CODE certiCode,--失能人员身份证件号码
program.PROGRAM_DATE sevStarTime,--服务开始时间
program.PROGRAM_EDN_DATE sevEndTime--服务结束时间
program.PROGRAM_EDN_DATE sevEndTime,--服务结束时间
(case when info.exit_time is null then 0 else 1 end) hospitalFlag,
info.DISAB_INFO_ID disabInfoId
from ch_srv_program program
LEFT JOIN ch_cfg_srv_mode mode1 ON program.srv_mode_id = mode1.mode_id --服务方式
LEFT JOIN ch_srv_organ organ ON program.srv_organ_id = organ.srv_organ_id --服务机构
......@@ -59,6 +61,9 @@
<if test="vo.certiCode != null and vo.certiCode != ''">
AND info.CERTI_CODE =#{vo.certiCode}
</if>
<if test="vo.hospitalFlag != null and vo.hospitalFlag != ''">
AND (case when info.exit_time is null then 0 else 1 end) =#{vo.hospitalFlag}
</if>
<if test="vo.sevStarTime != null and vo.sevStarTime != ''">
AND program.PROGRAM_DATE &gt;= TO_DATE (#{vo.sevStarTime}, 'yyyy-mm-dd')
</if>
......@@ -68,6 +73,12 @@
)A
where A.rn =1
</select>
<select id="selectSrvSend" resultType="java.lang.Integer">
select count(*) from CH_SRV_SEND t where t.DISAB_INFO_ID = #{disabInfoId} and
t.STATUS = 1
</select>
<select id="getsrvOrgan" resultType="com.hungraim.ltc.pojo.entity.account.ChPunchDetailsVO">
SELECT
n.SRV_ORGAN_NAME srvOrganName,
......
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