Commit 72260093 authored by zhangwanglin's avatar zhangwanglin

Merge branch 'dev_20230327_建床管理无审核版本_zxl' into uat_ch_master

parents b0a85d58 fbe3ed82
......@@ -40,7 +40,9 @@ public interface BuildBedMapper extends BaseMapper<ChSrvBuildBed> {
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();
String selectModeTypeById(@Param("pId")Long pId);
}
......@@ -144,7 +144,8 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
}
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);
chPunchDetailsVO.setRecordData(chPunchDetailVOS);
chPunchDetailsVO.setChPunchDetailVOS(serviceTypeDetailed1s);
......
......@@ -72,20 +72,27 @@
</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
detail.TASK_DETAIL_ID,
detail.SRV_START_TIME ,
detail.SRV_END_TIME,
to_char( detail.SRV_START_TIME, 'dd' ) executionTime,
case when mode1.MODE_NAME='上门' then to_char(detail.SRV_START_TIME, 'dd' )
else to_char(item.FCD, 'dd' ) end executionTime,
service.SERVICE_TYPE_DETAILED_NAME itemName,
service.SERVICE_TYPE_DETAILED_ID serviceTypeDetailedId
FROM
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_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
inner JOIN ch_srv_task task ON task.srv_task_id = detail.srv_task_id
inner JOIN ch_srv_program program on program.PROGRAM_ID=task.PROGRAM_ID
inner JOIN ch_cfg_srv_mode mode1 ON program.srv_mode_id = mode1.mode_id
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
<if test="taskDetailId != null and taskDetailId != ''">
and task.PROGRAM_ID = #{taskDetailId}
......@@ -94,12 +101,19 @@
<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 test="sevStarTime != null and sevStarTime != ''">
AND detail.SRV_START_TIME &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd')
</if>
<if test="sevEndTime != null and sevEndTime != ''">
AND detail.SRV_END_TIME &lt;= TO_DATE (substr(#{sevEndTime},1,10), 'yyyy-mm-dd')
</if>
<choose>
<when test="modeType == '上门'">
<if test="sevStarTime != null and sevStarTime != ''">
AND detail.SRV_START_TIME &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd')
</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 id="selectServiceTypeDetailed" resultType="com.hungraim.ltc.pojo.entity.account.ChServiceTypeVO">
......@@ -115,5 +129,4 @@
</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