Commit e0812e2d authored by zhangwanglin's avatar zhangwanglin

服务方案

parent 80e4e8bb
......@@ -539,4 +539,19 @@ public class DisableController {
}
/**
* 失能人员信息退出历史列表
*
* @param disableInfoId
* @return 失能人员信息退出历史列表
*/
@RequestMapping("/getDisableExitHis")
public Result<List<ChDisableExit>> getDisableExitHis(Integer disableInfoId) {
if (disableInfoId == null) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
List<ChDisableExit> disableExitHis = disableService.getDisableExitHis(disableInfoId);
return Result.success(disableExitHis);
}
}
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetailDelete;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* @author zwl
* @ClassName ChSrvSendMapper
* @description
* @date 2023/3/13 18:40
**/
@Mapper
@Repository
public interface ChSrvSendInfoMapper extends BaseMapper<ChSrvSend> {
}
......@@ -3,12 +3,16 @@ package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend;
import com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo;
import com.hungraim.ltc.pojo.vo.governance.ProgramListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 失能人员信息Mapper
*
......@@ -29,4 +33,11 @@ public interface DisableInfoMapper extends BaseMapper<ChDisableInfo> {
int deleteSrvSend(Integer disableInfoId,String exitTime);
int updateSrvProgramById(ChSrvProgram chSrvProgram);
int updateSrvSendById(ChSrvSend chSrvSend);
ChSrvSend selectSrvSend(Integer disableInfoId);
}
......@@ -184,4 +184,6 @@ public interface DisableService {
int disableInfoExit(Integer disableInfoId,Integer exitReasonId,Integer applyId,Integer srvOrganId,Integer programId,String exitTime);
List<ChDisableExit> getDisableExitHis(Integer disableInfoId);
}
......@@ -18,6 +18,9 @@ import com.hungraim.ltc.pojo.entity.disable.*;
import com.hungraim.ltc.pojo.entity.riskLevel.ChDisableRiskLevel;
import com.hungraim.ltc.pojo.entity.riskLevel.ChSrvorganRiskLevel;
import com.hungraim.ltc.pojo.entity.serviceManage.ChCfgPara;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail;
import com.hungraim.ltc.pojo.vo.disable.*;
import com.hungraim.ltc.pojo.vo.governance.ProgramListVo;
import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo;
......@@ -60,6 +63,7 @@ public class DisableServiceImpl implements DisableService {
private final DisableInfoHisMapper disableInfoHisMapper;
private final DisableExitMapper disableExitMapper;
private final OrganService organService;
private final ChSrvSendInfoMapper chSrvSendInfoMapper;
@Autowired
private ChDisableRiskLevelMapper chDisableRiskLevelMapper;
......@@ -597,22 +601,46 @@ public class DisableServiceImpl implements DisableService {
chDisableInfo.setExitSrvOrganId(srvOrganId);
int result = disableInfoMapper.updateById(chDisableInfo);
boolean now = DateUtils.isNow(date);
if (now) {
ChSrvProgram chSrvProgram = new ChSrvProgram();
chSrvProgram.setProgramId(chSrvProgram.getProgramId());
chSrvProgram.setDisabInfoId(Long.valueOf(disableInfoId));
chSrvProgram.setProgStatus(2);
chSrvProgram.setEndReason("失能人员退出,终止方案");
disableInfoMapper.updateSrvProgramById(chSrvProgram);
ChSrvSend chSrvSend = new ChSrvSend();
chSrvSend.setDisabInfoId(Long.valueOf(disableInfoId));
chSrvSend.setEndTime(date);
// 4, 转入医保 5, 异地
if (exitReasonId == 4||exitReasonId==5){
// chSrvSend.setStatus((short)3);
// disableInfoMapper.updateSrvSendById(chSrvSend);
// 1, 死亡
}else if (exitReasonId == 1){
chSrvSend.setStatus((short)3);
disableInfoMapper.updateSrvSendById(chSrvSend);
}else {
chSrvSend.setStatus((short)3);
disableInfoMapper.updateSrvSendById(chSrvSend);
ChSrvSend chSrvSend1 = disableInfoMapper.selectSrvSend(disableInfoId);
if(chSrvSend1!=null){
chSrvSend1.setStatus((short)0);
chSrvSend1.setFcd(new Date());
chSrvSendInfoMapper.insert(chSrvSend1);
}
/**
* 1, 死亡
* 2, "复评未通过" },//需要重新首次录入-->评估
* 3, 退保
* 4, 转入医保
* 5, 异地
* 6, 更换其他机构
* 7, 其他
**/
if(exitReasonId == 3 || exitReasonId == 4 || exitReasonId == 5 || exitReasonId == 6 || exitReasonId == 7){
}
}
// 解除护理机构分配
// delete from CH_SRV_SEND where DISAB_INFO_ID = '327'
// disableInfoMapper.deleteSrvSend(disableInfoId,exitTime);
}
// }
ChDisableExit chDisableExit = new ChDisableExit();
chDisableExit.setDisabInfoId(disableInfoId);
chDisableExit.setExitReasonId(exitReasonId);
......@@ -622,5 +650,14 @@ public class DisableServiceImpl implements DisableService {
return result;
}
@Override
public List<ChDisableExit> getDisableExitHis(Integer disableInfoId) {
List<ChDisableExit> chDisableExits = disableExitMapper.selectList(new LambdaQueryWrapper<ChDisableExit>().eq(ChDisableExit::getDisabInfoId, disableInfoId));
return chDisableExits;
}
}
......@@ -16,8 +16,6 @@
T2.ACPT_AREA acptArea,
T2.ACPT_STREET acptStreet,
T2.ACPT_ADDRESS acptAddress,
T6.DISABLE_LEVEL_NAME realLevel,
T4.FINISH_TIME assessDate,
T7.MODE_NAME svrModelName,
T5.SRV_ORGAN_NAME svrOrganName,
T1.PROG_STATUS progStatus,
......@@ -34,11 +32,9 @@
FROM CH_DISABLE_INFO T2
INNER JOIN CH_SRV_PROGRAM T1 ON T1.DISAB_INFO_ID = T2.DISAB_INFO_ID
LEFT JOIN CH_CFG_SRV_MODE T7 ON T2.SRV_MODE_ID = T7.MODE_ID
LEFT JOIN CH_APR_REPORT T3 ON T2.LAST_TASK_ID = T3.TASK_ID
LEFT JOIN CH_CFG_SRV_DISABLE_LEVEL T6 ON T3.DISABLE_LEVEL_ID = T6.DISABLE_LEVEL_ID
LEFT JOIN CH_APR_TASK T4 ON T3.TASK_ID = T4.TASK_ID
LEFT JOIN CH_SRV_ORGAN T5 ON T1.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
<where>
T1.PROG_STATUS !=2
<if test="srvOrganId != null and srvOrganId != '' and srvOrganId!=0">
and T1.SRV_ORGAN_ID = #{srvOrganId}
</if>
......@@ -63,4 +59,22 @@
<delete id="deleteSrvSend">
delete from CH_SRV_SEND where DISAB_INFO_ID = #{disableInfoId}
</delete>
<update id="updateSrvProgramById" parameterType="com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram">
update CH_SRV_PROGRAM g set g.PROG_STATUS ='2',g.END_REASON = #{endReason} where
g.DISAB_INFO_ID =#{disabInfoId} and g.PROGRAM_DATE <![CDATA[ < ]]> sysdate
</update>
<update id="updateSrvSendById" parameterType="com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend">
update CH_SRV_SEND s set s.STATUS ='3',s.end_time = #{endTime} where
s.DISAB_INFO_ID = #{disabInfoId}
</update>
<select id="selectSrvSend" resultType="com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend">
select * from CH_SRV_SEND s where s.DISAB_INFO_ID = #{disabInfoId} and ROWNUM =1 order by fcd desc
</select>
<insert id="insertSrvSend" parameterType="com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend">
</insert>
</mapper>
\ No newline at end of file
......@@ -628,11 +628,20 @@ public class ChDisableApply extends PageInfo implements Serializable {
private Integer exitFlag;
/**
* 1, 死亡
* 2, "复评未通过" },//需要重新首次录入-->评估
* 3, 退保
* 4, 转入医保
* 5, 异地
* 6, 更换其他机构
* 7, 其他
**/
private Integer exitReasonId;
private Integer exitSrvOrganId;
private Date exitTime;
private Date exitTime;
@TableField(exist = false)
private List<ChFndAttach> fileDataList;
......
......@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
......@@ -28,6 +30,8 @@ public class ChDisableExit {
private Integer exitReasonId;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date exitTime;
}
......@@ -93,7 +93,7 @@ public class ChSrvSend implements Serializable {
private Long lcu;
/**
* 服务分配状态 未分配 0 已分配 1 已终止 2
* 服务分配状态 未分配 0 已分配 1 已终止 2 已退出 3
*/
private Short status;
......
......@@ -945,4 +945,25 @@ public class DateUtils {
return dateString;
}
/**
* 判断日期是不是今天
* @param date
* @return 是返回true,不是返回false
*/
public static boolean isNow(Date date) {
// 当前时间
Date now = new Date();
SimpleDateFormat sf = new SimpleDateFormat(DATE_PATTERN_yyyy_MM_dd);
//获取今天的日期
String nowDay = sf.format(now);
//对比的时间
String day = sf.format(date);
return day.equals(nowDay);
}
}
package com.hungraim.ltc.governance.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.governance.dao.ChSrvSendMapper;
import com.hungraim.ltc.governance.service.*;
import com.hungraim.ltc.pojo.entity.account.ChPunchDetailsVO;
import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
......@@ -45,6 +47,9 @@ public class BuildBedController {
@Autowired
private IRemoveBedService removeBedService;
@Autowired
private ChSrvSendMapper chSrvSendMapper;
/**
* 建床管理列表
......@@ -209,7 +214,8 @@ public class BuildBedController {
if (StrUtil.isBlankIfStr(disableInfoVo.getDisableInfoId())) {
return Result.failed("失能人员id不能为空");
}
Page<DisableInfoVo> disableInfoVos = disableInfoServie.querySrvYet(disableInfoVo.getDisableInfoId(), disableInfoVo.getCurrent(), disableInfoVo.getLimit());
Integer status = disableInfoVo.getStatus();
Page<DisableInfoVo> disableInfoVos = disableInfoServie.querySrvYet(disableInfoVo.getDisableInfoId(), disableInfoVo.getCurrent(), disableInfoVo.getLimit(), status);
long total = disableInfoVos.getTotal();
List<DisableInfoVo> records = disableInfoVos.getRecords();
Map map = new HashMap<>();
......@@ -232,6 +238,13 @@ public class BuildBedController {
if (chSrvSend.getDisabInfoId() == null || chSrvSend.getSrvOrganId() == null || chSrvSend.getSrvModeId() == null) {
return Result.failed("参数不全!");
}
List<ChSrvSend> chSrvSendsList = chSrvSendMapper.selectList(new LambdaQueryWrapper<ChSrvSend>()
.eq(ChSrvSend::getDisabInfoId, disabInfoId)
.eq(ChSrvSend::getStatus, (short) 1));
if (chSrvSendsList.size() > 0) {
return Result.failed("已分配护理机构,请先终止或退出再操作");
}
chSrvSend.setAllotTime(new Date());
chSrvSend.setStatus(Short.valueOf("1"));
if (chrSrvVo.getSrvSendId() == null) {
......@@ -260,6 +273,7 @@ public class BuildBedController {
return Result.failed("提交失败,服务分配记录不存在");
}
chSrvSend.setStopTime(saveStopTime.getStopTime());
chSrvSend.setStatus((short)2);
sendService.updateById(chSrvSend);
return Result.success(true);
}
......
......@@ -16,7 +16,11 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.TreeSet;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/api.governance/srvProgram")
......@@ -80,6 +84,10 @@ public class SrvProgramController {
}
Page<ProgramListVo> page = new Page<>(pageNum, pageSize);
page = srvProgramService.getProgramSetList(page, disabInfoId, srvOrganId, null);
List<ProgramListVo> records = page.getRecords();
records =records.stream().collect(
Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingLong(ProgramListVo::getProgramId))), ArrayList::new));
page.setRecords(records);
return Result.success(page);
}
......
......@@ -21,7 +21,7 @@ public class SrvTaskScheduledController {
@Autowired
private SrvTaskService srvTaskService;
@Scheduled(cron = "0 40 03 * * ?")
@Scheduled(cron = "0 38 09 * * ?")
public void timeAllocationSrvTask() {
log.info("timeAllocationSrvTask========start");
srvTaskService.timeAllocationSrvTask();
......
......@@ -10,6 +10,8 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface ChSrvProgramMapper extends BaseMapper<ChSrvProgram> {
......@@ -42,4 +44,7 @@ public interface ChSrvProgramMapper extends BaseMapper<ChSrvProgram> {
*/
ProgramDetailVo getProgramDetailWithAdd(@Param("disabInfoId") Long disabInfoId, @Param("srvOrganId") Long srvOrganId);
List<ChSrvProgram> getProgramEndProgram();
}
\ No newline at end of file
......@@ -23,4 +23,5 @@ public interface ChSrvSendMapper extends BaseMapper<ChSrvSend> {
*/
Page<SvrSendListVo> selectSrvSendList(Page<SvrSendListVo> page, @Param("srvOrganId") Long srvOrganId, @Param("realName") String realName, @Param("realTel") String realTel, @Param("programStatus") String programStatus);
int updateSrvSendInfo(Long disabInfoId);
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ import org.apache.ibatis.annotations.Select;
public interface DisableInfoMapper extends BaseMapper<ChDisableInfo> {
@Select("select s.real_name," +
@Select("<script>select s.real_name," +
"i.SRV_SEND_ID," +
" j.acpt_provincial," +
" j.acpt_city," +
......@@ -38,6 +38,10 @@ public interface DisableInfoMapper extends BaseMapper<ChDisableInfo> {
" on s.disab_info_id = i.disab_info_id" +
" left join ch_srv_organ j" +
" on i.SRV_ORGAN_ID = j.SRV_ORGAN_ID" +
" where i.disab_info_id=#{disableInfoId}")
Page<DisableInfoVo> querySrvYet(Page page, Integer disableInfoId);
" where i.disab_info_id=#{disableInfoId} " +
" <if test='status!=null and status !=\"\" '>"+
" and i.status =#{status} "+
" </if>"+
" </script>")
Page<DisableInfoVo> querySrvYet(Page page, Integer disableInfoId ,Integer status);
}
......@@ -31,6 +31,7 @@ public interface SrvSendMapper extends BaseMapper<ChSrvSend> {
Page<SrvSendVO> selectSendList(Page<SrvSendVO> page, @Param("disableInfo") ChDisableInfo disableInfo, @Param("chSrvOrgan") ChSrvOrgan chSrvOrgan, @Param("chSrvSend") ChSrvSend chSrvSend);
@Select("select permit_id from ch_srv_organ where srv_organ_id=#{organId} ")
String selectByOrganId(Integer organId);
......@@ -51,8 +52,8 @@ public interface SrvSendMapper extends BaseMapper<ChSrvSend> {
" left join ch_apr_report o" +
" on i.task_id = o.task_id left join CH_CFG_SRV_DISABLE_LEVEL l on l.disable_level_id = o.disable_level_id " +
" left join ch_disable_apply a on a.apply_id = s.apply_id " +
" where s.disab_info_id=#{disableInfoId}")
DisableInfoTaskVO selectBydisableInfoId(Integer disableInfoId);
" where s.disab_info_id=#{disableInfoId} order by o.fcd desc")
List<DisableInfoTaskVO> selectBydisableInfoId(Integer disableInfoId);
@Select("select s.real_name," +
" s.certi_code," +
......
......@@ -10,7 +10,7 @@ import com.hungraim.ltc.pojo.vo.governance.DisableInfoVo;
public interface DisableInfoServie extends IService<ChDisableInfo> {
Page<DisableInfoVo> querySrvYet(Integer disableInfoId, int current, int limit);
Page<DisableInfoVo> querySrvYet(Integer disableInfoId, int current, int limit, Integer status);
......
......@@ -15,8 +15,8 @@ public class DisableInfoServieImpl extends ServiceImpl<DisableInfoMapper, ChDisa
@Override
public Page<DisableInfoVo> querySrvYet(Integer disableInfoId, int current, int limit) {
public Page<DisableInfoVo> querySrvYet(Integer disableInfoId, int current, int limit, Integer status) {
Page<SrvSendVO> page = new Page<>(current,limit);
return this.baseMapper.querySrvYet(page,disableInfoId);
return this.baseMapper.querySrvYet(page,disableInfoId,status);
}
}
......@@ -41,7 +41,12 @@ public class SrvSendServiceImpl extends ServiceImpl<SrvSendMapper, ChSrvSend> im
@Override
public DisableInfoTaskVO selectTaskById(Integer disableInfoId, Integer srvOrganId) {
DisableInfoTaskVO disableInfoTaskVO = sendMapper.selectBydisableInfoId(disableInfoId);
List<DisableInfoTaskVO> disableInfoTaskList = sendMapper.selectBydisableInfoId(disableInfoId);
DisableInfoTaskVO disableInfoTaskVO = null;
if(disableInfoTaskList.size() >0 ){
disableInfoTaskVO = disableInfoTaskList.get(0);
}
if (srvOrganId != null) {
String s = sendMapper.selectByOrganId(srvOrganId);
disableInfoTaskVO.setPermitId(s);
......
package com.hungraim.ltc.governance.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -7,12 +8,12 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.AccountFeignService;
import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.governance.dao.ChSrvPlanMapper;
import com.hungraim.ltc.governance.dao.ChSrvTaskDetailMapper;
import com.hungraim.ltc.governance.dao.SrvTaskMapper;
import com.hungraim.ltc.governance.dao.*;
import com.hungraim.ltc.governance.service.SrvTaskService;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.governance.ChSrvPlan;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTask;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail;
import com.hungraim.ltc.pojo.vo.governance.*;
......@@ -21,6 +22,7 @@ import com.hungraim.ltc.util.AttachType;
import com.hungraim.ltc.util.DateUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -40,6 +42,8 @@ public class SrvTaskServiceImpl implements SrvTaskService {
private final AttachFeignService attachFeignService;
private final ChSrvPlanMapper chSrvPlanMapper;
private final AccountFeignService accountFeignService;
private final ChSrvProgramMapper chSrvProgramMapper;
private final ChSrvSendMapper chSrvSendMapper;
......@@ -204,8 +208,25 @@ public class SrvTaskServiceImpl implements SrvTaskService {
return srvTaskMapper.getSrvOrganEmpList(page, organId, name, certiType, certifNum);
}
@Override
public void timeAllocationSrvTask() {
List<ChSrvProgram> programEndProgram = chSrvProgramMapper.getProgramEndProgram();
if (CollectionUtil.isNotEmpty(programEndProgram)) {
for (ChSrvProgram chSrvProgram : programEndProgram) {
chSrvProgram.setProgramId(chSrvProgram.getProgramId());
chSrvProgram.setEndReason("方案时间已到期,自动终止");
chSrvProgram.setProgStatus(2);
chSrvProgramMapper.updateById(chSrvProgram);
Long disabInfoId = chSrvProgram.getDisabInfoId();
ChSrvSend chSrvSend = new ChSrvSend();
// chSrvSend.setStatus((short)2);
// chSrvSend.setEndTime(new Date());
chSrvSend.setDisabInfoId(disabInfoId);
chSrvSendMapper.updateSrvSendInfo(disabInfoId);
}
}
// 查询需要执行的计划
List<AllocationSrvTaskVO> chSrvTasks = srvTaskMapper.getAllocationSrvTask();
// 生成计划任务 CH_SRV_TASK_DETAIL
......
......@@ -68,7 +68,7 @@
LEFT JOIN CH_CFG_SRV_DISABLE_LEVEL T6 ON T3.DISABLE_LEVEL_ID = T6.DISABLE_LEVEL_ID
LEFT JOIN CH_APR_TASK T4 ON T3.TASK_ID = T4.TASK_ID
LEFT JOIN CH_SRV_ORGAN T5 ON T1.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
WHERE T1.PROGRAM_ID = #{programId}
WHERE T1.PROGRAM_ID = #{programId} and rownum =1
</select>
<select id="getProgramDetailWithAdd" resultMap="ProgramSetDetailVoMap">
SELECT NULL PROGRAM_ID,
......@@ -106,6 +106,7 @@
LEFT JOIN CH_SRV_ORGAN T5 ON T1.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
WHERE T1.DISAB_INFO_ID = #{disabInfoId}
AND T1.SRV_ORGAN_ID = #{srvOrganId}
AND ROWNUM = 1
</select>
<select id="getProgramList" resultType="com.hungraim.ltc.pojo.vo.governance.ProgramListVo">
......@@ -138,8 +139,14 @@
LEFT JOIN CH_SRV_ORGAN T5 ON T1.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
WHERE T1.DISAB_INFO_ID = #{disabInfoId}
AND T1.SRV_ORGAN_ID = #{srvOrganId}
<if test="programStatus != null and programStatus != ''">
T1.PROG_STATUS = #{programStatus}
AND T1.PROG_STATUS = #{programStatus}
</if>
</select>
<select id="getProgramEndProgram" resultType="com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram">
select * from CH_SRV_PROGRAM g where <![CDATA[ sysdate > g.PROGRAM_EDN_DATE and PROG_STATUS <> 2 ]]>
</select>
</mapper>
\ No newline at end of file
......@@ -68,4 +68,10 @@
</where>
ORDER BY T1.EFF_TIME DESC
</select>
<update id="updateSrvSendInfo">
update CH_SRV_SEND p set p.status = '2',p.end_time = sysdate where
p.DISAB_INFO_ID = #{disabInfoId}
</update>
</mapper>
\ No newline at end of file
......@@ -21,6 +21,7 @@
<!--查询服务分配信息列表-->
<select id="selectSendList" resultMap="sendresultMap">
SELECT
s.srv_send_id,
i.disab_info_id,
......@@ -42,14 +43,15 @@
LEFT JOIN ch_srv_send s ON s.disab_info_id = i.disab_info_id
LEFT JOIN ch_fnd_organ o ON i.organ_id = o.organ_id
LEFT JOIN CH_APR_TASK t ON i.disab_info_id = t.DISABLE_INFO_ID
left join ch_apr_report report on t.task_id = report.task_id
--left join ch_apr_report report on t.task_id = report.task_id
<where>
t.TASK_STATUS = 3 and report.DISABLE_LEVEL_ID in ('3','4','5')
and sysdate <![CDATA[ > ]]> report.PUBLICITY_END_TIME
t.TASK_STATUS = 3 --and report.DISABLE_LEVEL_ID in ('3','4','5')
-- and sysdate <![CDATA[ > ]]> report.PUBLICITY_END_TIME
and t.task_id in (select distinct TASK_ID from CH_APR_REPORT report where report.DISABLE_LEVEL_ID in ('3','4','5')
and sysdate <![CDATA[ > ]]> report.PUBLICITY_END_TIME)
<if test="chSrvOrgan.organId != null and chSrvOrgan.organId != ''">
AND o.organ_id = #{chSrvOrgan.organId}
</if>
<if test="disableInfo.realName != null and disableInfo.realName != ''">
AND i.real_name LIKE CONCAT(CONCAT('%',#{disableInfo.realName}),'%')
</if>
......
......@@ -220,9 +220,11 @@
left join CH_DISABLE_INFO info on t.DISAB_INFO_ID = info.DISAB_INFO_ID
left join ch_apr_task aprtask on info.last_task_id = aprtask.task_id--评定任务
left join ch_apr_report report on aprtask.task_id = report.task_id--评定报告
where t.SRV_DATE <![CDATA[ < ]]> sysdate and
(info.EXIT_TIME <![CDATA[ > ]]> sysdate or info.EXIT_TIME is null)
and sysdate <![CDATA[ > ]]> report.PUBLICITY_END_TIME
left join CH_SRV_PROGRAM program on program.DISAB_INFO_ID = info.DISAB_INFO_ID
where <![CDATA[ t.SRV_DATE < sysdate and
(info.EXIT_TIME > sysdate or info.EXIT_TIME is null)
and sysdate < program.PROGRAM_EDN_DATE
and sysdate > report.PUBLICITY_END_TIME ]]>
</select>
</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