Commit fbe3ed82 authored by zengxiaoli@yeah.net's avatar zengxiaoli@yeah.net

建床管理

1.打卡详情-医疗养老打卡详情判断执行时间
parent bb8dba82
...@@ -40,7 +40,9 @@ public interface BuildBedMapper extends BaseMapper<ChSrvBuildBed> { ...@@ -40,7 +40,9 @@ public interface BuildBedMapper extends BaseMapper<ChSrvBuildBed> {
ChPunchDetailsVO getsrvOrgan(Long taskDetailId); ChPunchDetailsVO getsrvOrgan(Long taskDetailId);
List<ChServiceTypeDetailedVO> getServiceTypeDetailed(@Param("taskDetailId")Long taskDetailId,@Param("certiCode")String certiCode,@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,@Param("modeType")String modeType);
List<ChServiceTypeVO> selectServiceTypeDetailed(); List<ChServiceTypeVO> selectServiceTypeDetailed();
String selectModeTypeById(@Param("pId")Long pId);
} }
...@@ -144,7 +144,8 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB ...@@ -144,7 +144,8 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
} }
log.info("chPunchDetailsQuery获取服务机构和服务类型:"+chPunchDetailsVO); log.info("chPunchDetailsQuery获取服务机构和服务类型:"+chPunchDetailsVO);
//打卡详情 //打卡详情
List<ChServiceTypeDetailedVO> serviceTypeDetailed1s = buildBedMapper.getServiceTypeDetailed(taskDetailId,certiCode,sevStarTime, sevEndTime); String modeType = buildBedMapper.selectModeTypeById(taskDetailId);
List<ChServiceTypeDetailedVO> serviceTypeDetailed1s = buildBedMapper.getServiceTypeDetailed(taskDetailId,certiCode,sevStarTime, sevEndTime,modeType);
log.info("chPunchDetailsQuery打卡详情:"+serviceTypeDetailed1s); log.info("chPunchDetailsQuery打卡详情:"+serviceTypeDetailed1s);
chPunchDetailsVO.setRecordData(chPunchDetailVOS); chPunchDetailsVO.setRecordData(chPunchDetailVOS);
chPunchDetailsVO.setChPunchDetailVOS(serviceTypeDetailed1s); chPunchDetailsVO.setChPunchDetailVOS(serviceTypeDetailed1s);
......
...@@ -72,20 +72,27 @@ ...@@ -72,20 +72,27 @@
</select> </select>
<select id="selectModeTypeById" resultType="String">
select mode1.MODE_NAME from ch_srv_program program
inner JOIN ch_cfg_srv_mode mode1 ON program.srv_mode_id = mode1.mode_id
where program.PROGRAM_ID = #{pId}
</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
detail.TASK_DETAIL_ID, case when mode1.MODE_NAME='上门' then to_char(detail.SRV_START_TIME, 'dd' )
detail.SRV_START_TIME , else to_char(item.FCD, 'dd' ) end executionTime,
detail.SRV_END_TIME,
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 --服务计划详情 inner 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 inner JOIN ch_srv_program program on program.PROGRAM_ID=task.PROGRAM_ID
LEFT JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID inner JOIN ch_cfg_srv_mode mode1 ON program.srv_mode_id = mode1.mode_id
left join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME inner JOIN CH_SRV_TASK_FINISH_ITEM item ON detail.TASK_DETAIL_ID = item.TASK_DETAIL_ID
inner JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID
inner 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 task.PROGRAM_ID = #{taskDetailId} and task.PROGRAM_ID = #{taskDetailId}
...@@ -94,12 +101,19 @@ ...@@ -94,12 +101,19 @@
<if test="certiCode != null and certiCode != ''"> <if test="certiCode != null and certiCode != ''">
and task.DISAB_INFO_ID = (select DISAB_INFO_ID from CH_DISABLE_INFO where CERTI_CODE =#{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 != ''"> <choose>
AND detail.SRV_START_TIME &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd') <when test="modeType == '上门'">
</if> <if test="sevStarTime != null and sevStarTime != ''">
<if test="sevEndTime != null and sevEndTime != ''"> AND detail.SRV_START_TIME &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd')
AND detail.SRV_END_TIME &lt;= TO_DATE (substr(#{sevEndTime},1,10), 'yyyy-mm-dd') </if>
</if> <if test="sevEndTime != null and sevEndTime != ''">
AND detail.SRV_END_TIME &lt;= TO_DATE (substr(#{sevEndTime},1,10), 'yyyy-mm-dd')
</if>
</when>
<otherwise>
AND item.FCD >= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd')
</otherwise>
</choose>
</select> </select>
<select id="selectServiceTypeDetailed" resultType="com.hungraim.ltc.pojo.entity.account.ChServiceTypeVO"> <select id="selectServiceTypeDetailed" resultType="com.hungraim.ltc.pojo.entity.account.ChServiceTypeVO">
...@@ -115,5 +129,4 @@ ...@@ -115,5 +129,4 @@
</mapper> </mapper>
\ No newline at end of file
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