Commit 47d7a3a4 authored by zengxiaoli@yeah.net's avatar zengxiaoli@yeah.net

建床管理

1.查询-失能人员多条数据整合成一条 2.打卡详情-打卡记录按照每月每天执行的项目打勾 3.打卡详情-记录中展示对应的护理机构名称和机构类型 4.查询服务开始和结束时间,换成服务方案里的时间。
parent 9bad7448
...@@ -336,8 +336,8 @@ public class BuildBedController { ...@@ -336,8 +336,8 @@ public class BuildBedController {
* @return * @return
*/ */
@GetMapping("/chPunchDetailsQuery") @GetMapping("/chPunchDetailsQuery")
public Result chPunchDetailsQuery(Long taskDetailId,String sevStarTime,String sevEndTime){ public Result chPunchDetailsQuery(Long taskDetailId,String certiCode,String sevStarTime,String sevEndTime){
ChPunchDetailsVO chPunchDetailsVO = buildBedService.chPunchDetailsQuery(taskDetailId,sevStarTime,sevEndTime); ChPunchDetailsVO chPunchDetailsVO = buildBedService.chPunchDetailsQuery(taskDetailId,certiCode,sevStarTime,sevEndTime);
return Result.success(chPunchDetailsVO); return Result.success(chPunchDetailsVO);
} }
...@@ -379,4 +379,3 @@ public class BuildBedController { ...@@ -379,4 +379,3 @@ public class BuildBedController {
} }
\ No newline at end of file
...@@ -42,7 +42,7 @@ public interface BuildBedMapper extends BaseMapper<ChSrvBuildBed> { ...@@ -42,7 +42,7 @@ public interface BuildBedMapper extends BaseMapper<ChSrvBuildBed> {
ChPunchDetailsVO getsrvOrgan(Long taskDetailId); ChPunchDetailsVO getsrvOrgan(Long taskDetailId);
List<ChServiceTypeDetailedVO> getServiceTypeDetailed(@Param("taskDetailId")Long taskDetailId,@Param("sevStarTime")String sevStarTime,@Param("sevEndTime")String sevEndTime); List<ChServiceTypeDetailedVO> getServiceTypeDetailed(@Param("taskDetailId")Long taskDetailId,@Param("certiCode")String certiCode,@Param("sevStarTime")String sevStarTime,@Param("sevEndTime")String sevEndTime);
List<ChServiceTypeVO> selectServiceTypeDetailed(); List<ChServiceTypeVO> selectServiceTypeDetailed();
} }
...@@ -56,5 +56,5 @@ public interface IBuildBedService extends IService<ChSrvBuildBed> { ...@@ -56,5 +56,5 @@ public interface IBuildBedService extends IService<ChSrvBuildBed> {
* 打卡详情 * 打卡详情
* @param taskDetailId * @param taskDetailId
*/ */
ChPunchDetailsVO chPunchDetailsQuery(Long taskDetailId,String sevStarTime,String sevEndTime); ChPunchDetailsVO chPunchDetailsQuery(Long taskDetailId,String certiCode,String sevStarTime,String sevEndTime);
} }
...@@ -132,7 +132,7 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB ...@@ -132,7 +132,7 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
* @param taskDetailId * @param taskDetailId
*/ */
@Override @Override
public ChPunchDetailsVO chPunchDetailsQuery(Long taskDetailId, String sevStarTime,String sevEndTime) { public ChPunchDetailsVO chPunchDetailsQuery(Long taskDetailId,String certiCode, String sevStarTime,String sevEndTime) {
List<ChPunchDetailVO> chPunchDetailVOS = new ArrayList<>(); List<ChPunchDetailVO> chPunchDetailVOS = new ArrayList<>();
//获取项目信息 //获取项目信息
List<ChServiceTypeVO> chServiceTypeDetaileds = buildBedMapper.selectServiceTypeDetailed(); List<ChServiceTypeVO> chServiceTypeDetaileds = buildBedMapper.selectServiceTypeDetailed();
...@@ -154,7 +154,7 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB ...@@ -154,7 +154,7 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
} }
log.info("chPunchDetailsQuery获取服务机构和服务类型:"+chPunchDetailsVO); log.info("chPunchDetailsQuery获取服务机构和服务类型:"+chPunchDetailsVO);
//打卡详情 //打卡详情
List<ChServiceTypeDetailedVO> serviceTypeDetailed1s = buildBedMapper.getServiceTypeDetailed(taskDetailId,sevStarTime, sevEndTime); List<ChServiceTypeDetailedVO> serviceTypeDetailed1s = buildBedMapper.getServiceTypeDetailed(taskDetailId,certiCode,sevStarTime, sevEndTime);
log.info("chPunchDetailsQuery打卡详情:"+serviceTypeDetailed1s); log.info("chPunchDetailsQuery打卡详情:"+serviceTypeDetailed1s);
chPunchDetailsVO.setRecordData(chPunchDetailVOS); chPunchDetailsVO.setRecordData(chPunchDetailVOS);
chPunchDetailsVO.setChPunchDetailVOS(serviceTypeDetailed1s); chPunchDetailsVO.setChPunchDetailVOS(serviceTypeDetailed1s);
......
...@@ -27,22 +27,19 @@ ...@@ -27,22 +27,19 @@
<select id="chSrvTaskDetailQuery" parameterType="com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetailVo" <select id="chSrvTaskDetailQuery" parameterType="com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetailVo"
resultType="com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetailVo"> resultType="com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetailVo">
SELECT select
t.TASK_DETAIL_ID taskDetailId, program.PROGRAM_ID taskDetailId,
mode1.MODE_NAME modeName,----服务方式 mode1.MODE_NAME modeName,
organ.SRV_ORGAN_NAME srvOrganName,--护理机构名称 organ.SRV_ORGAN_NAME srvOrganName,--护理机构名称
info.REAL_NAME realName,--失能人员名字 info.REAL_NAME realName,--失能人员名字
info.CERTI_CODE certiCode,--失能人员身份证件号码 info.CERTI_CODE certiCode,--失能人员身份证件号码
t.SRV_START_TIME sevStarTime,--服务开始时间 program.PROGRAM_DATE sevStarTime,--服务开始时间
t.SRV_END_TIME sevEndTime,--服务结束时间 program.PROGRAM_EDN_DATE sevEndTime--服务结束时间
TO_DATE( '', 'yyyy-MM-dd' ) declarationTime from ch_srv_program program
FROM
CH_SRV_TASK_DETAIL t --服务明细表
LEFT JOIN ch_srv_task task ON task.srv_task_id = t.srv_task_id --服务计划详情
LEFT JOIN CH_DISABLE_INFO info ON task.DISAB_INFO_ID = info.DISAB_INFO_ID --失能人员信息表
LEFT JOIN ch_srv_program program ON task.program_id = program.program_id --服务方案
LEFT JOIN ch_srv_organ organ ON program.srv_organ_id = organ.srv_organ_id --服务机构
LEFT JOIN ch_cfg_srv_mode mode1 ON program.srv_mode_id = mode1.mode_id --服务方式 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 --服务机构
LEFT JOIN ch_srv_task task ON task.PROGRAM_ID = program.PROGRAM_ID --服务计划详情
LEFT JOIN CH_DISABLE_INFO info ON task.DISAB_INFO_ID = info.DISAB_INFO_ID --失能人员信息表
where 1=1 where 1=1
<if test="vo.srvOrganName != null and vo.srvOrganName != ''"> <if test="vo.srvOrganName != null and vo.srvOrganName != ''">
AND organ.SRV_ORGAN_NAME LIKE '%' || #{vo.srvOrganName} || '%' AND organ.SRV_ORGAN_NAME LIKE '%' || #{vo.srvOrganName} || '%'
...@@ -57,43 +54,10 @@ ...@@ -57,43 +54,10 @@
AND info.CERTI_CODE =#{vo.certiCode} AND info.CERTI_CODE =#{vo.certiCode}
</if> </if>
<if test="vo.sevStarTime != null and vo.sevStarTime != ''"> <if test="vo.sevStarTime != null and vo.sevStarTime != ''">
AND t.SRV_START_TIME &gt;= TO_DATE (#{vo.sevStarTime}, 'yyyy-mm-dd') AND program.PROGRAM_DATE &gt;= TO_DATE (#{vo.sevStarTime}, 'yyyy-mm-dd')
</if> </if>
<if test="vo.sevEndTime != null and vo.sevEndTime != ''"> <if test="vo.sevEndTime != null and vo.sevEndTime != ''">
AND t.SRV_END_TIME &lt;= TO_DATE (#{vo.sevEndTime}, 'yyyy-mm-dd') AND program.PROGRAM_EDN_DATE &lt;= TO_DATE (#{vo.sevEndTime}, 'yyyy-mm-dd')
</if>
UNION
SELECT
d.TASK_DETAIL_ID taskDetailId,
d.MODE_NAME modeName,----服务方式
o.SRV_ORGAN_NAME srvOrganName,--护理机构名称
info.REAL_NAME realName,--失能人员名字
info.CERTI_CODE certiCode,--失能人员身份证件号码
TO_DATE( '', 'yyyy-MM-dd' ) sevStarTime,--服务开始时间
TO_DATE( '', 'yyyy-MM-dd' ) sevEndTime,--服务结束时间
d.DECLARATION_TIME declarationTime--申报日期
FROM
CH_DISAB_ACCOUNTS_DETAIL d --账户信息表
LEFT JOIN CH_DISABLE_INFO info ON d.DISAB_INFO_ID = info.DISAB_INFO_ID --失能人员信息表
LEFT JOIN CH_SRV_ORGAN o ON d.SRV_ORGAN_ID = o.SRV_ORGAN_ID --护理机构表
where 1=1
<if test="vo.srvOrganName != null and vo.srvOrganName != ''">
AND o.SRV_ORGAN_NAME LIKE '%' || #{vo.srvOrganName} || '%'
</if>
<if test="vo.modeName != null and vo.modeName != ''">
AND d.MODE_NAME = #{vo.modeName}
</if>
<if test="vo.realName != null and vo.realName != ''">
AND info.REAL_NAME LIKE '%' || #{vo.realName} || '%'
</if>
<if test="vo.certiCode != null and vo.certiCode != ''">
AND info.CERTI_CODE =#{vo.certiCode}
</if>
<if test="vo.sevStarTime != null and vo.sevStarTime != ''">
AND d.DECLARATION_TIME &gt;= TO_DATE (#{vo.sevStarTime}, 'yyyy-mm-dd')
</if>
<if test="vo.sevEndTime != null and vo.sevEndTime != ''">
AND d.DECLARATION_TIME &lt;= TO_DATE (#{vo.sevEndTime}, 'yyyy-mm-dd')
</if> </if>
</select> </select>
<select id="getsrvOrgan" resultType="com.hungraim.ltc.pojo.entity.account.ChPunchDetailsVO"> <select id="getsrvOrgan" resultType="com.hungraim.ltc.pojo.entity.account.ChPunchDetailsVO">
...@@ -103,43 +67,32 @@ ...@@ -103,43 +67,32 @@
FROM FROM
CH_SRV_ORGAN n CH_SRV_ORGAN n
LEFT JOIN CH_CFG_SRV_ORGAN_TYPE e ON n.ORGAN_ID = e.ORGAN_TYPE_ID LEFT JOIN CH_CFG_SRV_ORGAN_TYPE e ON n.ORGAN_ID = e.ORGAN_TYPE_ID
LEFT JOIN CH_DISAB_ACCOUNTS_DETAIL detail ON n.SRV_ORGAN_ID = detail.SRV_ORGAN_ID LEFT JOIN ch_srv_program program ON n.SRV_ORGAN_ID = program.SRV_ORGAN_ID
WHERE detail.TASK_DETAIL_ID = #{taskDetailId} WHERE program.PROGRAM_ID = #{taskDetailId}
</select> </select>
<select id="getServiceTypeDetailed" parameterType="Long" resultType="com.hungraim.ltc.pojo.entity.account.ChServiceTypeDetailedVO"> <select id="getServiceTypeDetailed" parameterType="Long" resultType="com.hungraim.ltc.pojo.entity.account.ChServiceTypeDetailedVO">
SELECT SELECT
to_char( detail.DECLARATION_TIME, 'dd' ) executionTime, detail.TASK_DETAIL_ID,
service.SERVICE_TYPE_DETAILED_NAME itemName, detail.SRV_START_TIME ,
service.SERVICE_TYPE_DETAILED_ID serviceTypeDetailedId detail.SRV_END_TIME,
FROM
CH_DISAB_ACCOUNTS_DETAIL detail
LEFT JOIN CH_SRV_TASK_FINISH_ITEM item ON detail.TASK_DETAIL_ID = item.TASK_DETAIL_ID
LEFT JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID
left join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME
WHERE 1=1
<if test="taskDetailId != null and taskDetailId != ''">
and detail.TASK_DETAIL_ID = #{taskDetailId}
</if>
<if test="sevStarTime != null and sevStarTime != ''">
AND detail.DECLARATION_TIME &gt;= TO_DATE (substr(#{sevStarTime} ,1,10), 'yyyy-mm-dd')
</if>
<if test="sevEndTime != null and sevEndTime != ''">
AND detail.DECLARATION_TIME &lt;= TO_DATE (substr(#{sevEndTime},1,10), 'yyyy-mm-dd')
</if>
UNION
SELECT
to_char( detail.SRV_START_TIME, 'dd' ) executionTime, to_char( detail.SRV_START_TIME, 'dd' ) executionTime,
service.SERVICE_TYPE_DETAILED_NAME itemName, service.SERVICE_TYPE_DETAILED_NAME itemName,
service.SERVICE_TYPE_DETAILED_ID serviceTypeDetailedId service.SERVICE_TYPE_DETAILED_ID serviceTypeDetailedId
FROM FROM
CH_SRV_TASK_DETAIL detail CH_SRV_TASK_DETAIL detail
LEFT JOIN ch_srv_task task ON task.srv_task_id = detail.srv_task_id --服务计划详情
LEFT JOIN CH_SRV_TASK_FINISH_ITEM item ON detail.TASK_DETAIL_ID = item.TASK_DETAIL_ID LEFT JOIN CH_SRV_TASK_FINISH_ITEM item ON detail.TASK_DETAIL_ID = item.TASK_DETAIL_ID
LEFT JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID LEFT JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID
left join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME left join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME
WHERE 1=1 WHERE 1=1
<if test="taskDetailId != null and taskDetailId != ''"> <if test="taskDetailId != null and taskDetailId != ''">
and detail.TASK_DETAIL_ID = #{taskDetailId} and task.PROGRAM_ID = #{taskDetailId}
</if>
<if test="certiCode != null and certiCode != ''">
and task.DISAB_INFO_ID = (select DISAB_INFO_ID from CH_DISABLE_INFO where CERTI_CODE =#{certiCode})
</if> </if>
<if test="sevStarTime != null and sevStarTime != ''"> <if test="sevStarTime != null and sevStarTime != ''">
AND detail.SRV_START_TIME &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd') AND detail.SRV_START_TIME &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd')
......
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