Commit 85ba2939 authored by zhangwanglin's avatar zhangwanglin

异地费用

parent 2abf5d7b
...@@ -27,4 +27,7 @@ public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> { ...@@ -27,4 +27,7 @@ public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> {
Page<PlaceOtherVO> placeOtherQuery(Page page, String name, String certiCode); Page<PlaceOtherVO> placeOtherQuery(Page page, String name, String certiCode);
List<PlaceOtherVO> placeOtherTaskQuery();
} }
\ No newline at end of file
...@@ -66,4 +66,5 @@ public interface AccountService extends IService<ChDisabAccounts> { ...@@ -66,4 +66,5 @@ public interface AccountService extends IService<ChDisabAccounts> {
Page<PlaceOtherVO> placeOtherQuery(Page page, String name, String certiCode); Page<PlaceOtherVO> placeOtherQuery(Page page, String name, String certiCode);
void placeOtherTaskQuery();
} }
...@@ -697,31 +697,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -697,31 +697,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override @Override
public void otherPlaceHandler(String programId){ public void otherPlaceHandler(String programId){
/* List<OrganAccountsVO> accountsList = chDisabAccountsDetailMapper.getOtherPlaceList(programId);
for (OrganAccountsVO accountsVO : accountsList) {
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setSrvOrganId(accountsVO.getSrvOrganId());
// 异地
BigDecimal limit = BigDecimal.valueOf(20);
BigDecimal zero = BigDecimal.valueOf(0);
chDisabDetailAccounts.setAccountsAllCost(limit);
chDisabDetailAccounts.setAccountsPersonalCost(zero);
chDisabDetailAccounts.setAccountsOverallCost(zero);
chDisabDetailAccounts.setReissueAmount(zero);
chDisabDetailAccounts.setDeductionAmount(zero);
chDisabDetailAccounts.setStatus((short)0);
chDisabDetailAccounts.setModeName(accountsVO.getSrvModeName());
chDisabDetailAccounts.setCreationTime(new Date());
chDisabDetailAccounts.setAccountsTime(DateUtils.strToDate(accountsVO.getSrvDate()));
chDisabDetailAccounts.setAccountsStartTime(DateUtils.getFirstDayOfMonth(DateUtils.strToDate(accountsVO.getSrvDate())));
chDisabDetailAccounts.setAccountsEndTime(DateUtils.getlastDayOfMonth(DateUtils.strToDate(accountsVO.getSrvDate())));
chDisabDetailAccounts.setTaskDetailId(accountsVO.getTaskDetailId());
chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea());
chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId());
ChDisabAccounts chDisabAccounts = getChDisabAccounts1(accountsVO);
chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId());
chDisabAccountsDetailMapper.insert(chDisabDetailAccounts);
}*/
} }
@Override @Override
...@@ -901,10 +876,20 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -901,10 +876,20 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override @Override
public int placeOtherApply(Integer disabInfoId, String otherApplyTime) { public int placeOtherApply(Integer disabInfoId, String otherApplyTime) {
int result = taskDetailMapper.placeOtherApply(disabInfoId,otherApplyTime); int result = taskDetailMapper.placeOtherApply(disabInfoId,otherApplyTime);
Date date = DateUtils.strToDate(otherApplyTime);
boolean now = DateUtils.isNow(date);
if (now) {
placeFreeHandler(disabInfoId, otherApplyTime);
}
return result;
}
private void placeFreeHandler(Integer disabInfoId, String otherApplyTime) {
BigDecimal limit = BigDecimal.valueOf(20); BigDecimal limit = BigDecimal.valueOf(20);
BigDecimal zero = BigDecimal.valueOf(0); BigDecimal zero = BigDecimal.valueOf(0);
ChDisabDetailAccounts chDisabDetailAccountsDTO = chDisabAccountsDetailMapper.queryDisabDetailAccounts("471", otherApplyTime, String.valueOf(disabInfoId), "异地"); ChDisabDetailAccounts chDisabDetailAccountsDTO = chDisabAccountsDetailMapper.queryDisabDetailAccounts("471", otherApplyTime, String.valueOf(disabInfoId), "异地");
if(Objects.isNull(chDisabDetailAccountsDTO)) { if (Objects.isNull(chDisabDetailAccountsDTO)) {
// 异地 // 异地
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts(); ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setAccountsAllCost(limit); chDisabDetailAccounts.setAccountsAllCost(limit);
...@@ -914,7 +899,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -914,7 +899,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccounts.setSrvOrganId("471"); chDisabDetailAccounts.setSrvOrganId("471");
chDisabDetailAccounts.setCreationTime(new Date()); chDisabDetailAccounts.setCreationTime(new Date());
chDisabDetailAccounts.setAccountsTime(DateUtils.strToDate(otherApplyTime)); chDisabDetailAccounts.setAccountsTime(DateUtils.strToDate(otherApplyTime));
// chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea());
chDisabDetailAccounts.setDisabInfoId(String.valueOf(disabInfoId)); chDisabDetailAccounts.setDisabInfoId(String.valueOf(disabInfoId));
chDisabDetailAccounts.setStatus((short) 1); chDisabDetailAccounts.setStatus((short) 1);
chDisabDetailAccounts.setReissueAmount(BigDecimal.valueOf(0)); chDisabDetailAccounts.setReissueAmount(BigDecimal.valueOf(0));
...@@ -933,10 +917,21 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -933,10 +917,21 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabAccounts.setReissueAmountTotal(zero); chDisabAccounts.setReissueAmountTotal(zero);
chDisabAccounts.setDeductionAmountTotal(zero); chDisabAccounts.setDeductionAmountTotal(zero);
disabAccountsMapper.insert(chDisabAccounts); disabAccountsMapper.insert(chDisabAccounts);
}else {
BigDecimal allCost1 = chDisabAccounts.getAllCost();
BigDecimal overallCost1 = chDisabAccounts.getOverallCost();
allCost1 = allCost1.add(chDisabDetailAccountsDTO.getAccountsAllCost());
overallCost1 = overallCost1.add(chDisabDetailAccountsDTO.getAccountsAllCost());
ChDisabAccounts chDisabAccount = new ChDisabAccounts();
chDisabAccount.setAllCost(allCost1);
chDisabAccount.setOverallCost(overallCost1);
Long accountsId = chDisabAccounts.getAccountsId();
chDisabAccount.setAccountsId(accountsId);
disabAccountsMapper.updateById(chDisabAccount);
} }
chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId()); chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId());
chDisabAccountsDetailMapper.insert(chDisabDetailAccounts); chDisabAccountsDetailMapper.insert(chDisabDetailAccounts);
}else { } else {
BigDecimal accountsAllCost = chDisabDetailAccountsDTO.getAccountsAllCost(); BigDecimal accountsAllCost = chDisabDetailAccountsDTO.getAccountsAllCost();
BigDecimal accountsOverallCost = chDisabDetailAccountsDTO.getAccountsOverallCost(); BigDecimal accountsOverallCost = chDisabDetailAccountsDTO.getAccountsOverallCost();
chDisabDetailAccountsDTO.setAccountsAllCost(accountsAllCost.add(limit)); chDisabDetailAccountsDTO.setAccountsAllCost(accountsAllCost.add(limit));
...@@ -944,7 +939,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -944,7 +939,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccountsDTO.setAccountsPersonalCost(zero); chDisabDetailAccountsDTO.setAccountsPersonalCost(zero);
chDisabAccountsDetailMapper.updateById(chDisabDetailAccountsDTO); chDisabAccountsDetailMapper.updateById(chDisabDetailAccountsDTO);
} }
return result;
} }
@Override @Override
...@@ -953,4 +947,16 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -953,4 +947,16 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
return placeOtherVOPage; return placeOtherVOPage;
} }
@Override
public void placeOtherTaskQuery(){
List<PlaceOtherVO> placeOtherVOS = taskDetailMapper.placeOtherTaskQuery();
for (PlaceOtherVO placeOtherVO : placeOtherVOS) {
Integer disabInfoId = placeOtherVO.getDisabInfoId();
String otherApplyTime = placeOtherVO.getOtherApplyTime();
placeFreeHandler(disabInfoId,otherApplyTime);
}
}
} }
...@@ -78,6 +78,34 @@ ...@@ -78,6 +78,34 @@
</if> </if>
</select> </select>
<select id="placeOtherTaskQuery" resultType="com.hungraim.ltc.pojo.vo.disable.PlaceOtherVO">
SELECT distinct info.DISAB_INFO_ID disabInfoId,
report.evaluate_time evaluateTime,
task.ORGAN_ID organId,
report.disable_level_id disableLevelId,
info.REAL_NAME realName,
info.CERTI_CODE certiCode,
(SELECT DISE_TYPE_CODE FROM CH_FND_DISEASE_TYPE WHERE info.DISE_TYPE_S = DISE_TYPE_ID) diseTypeS,
info.disease_desc diseaseDesc,
lev.DISABLE_LEVEL_NAME riskLevel,
report.PUBLICITY_START_TIME publicityStartTime,
report.PUBLICITY_END_TIME publicityEndTime,
report.PUBLICITY_TIME publicityTime,
to_char(info.OTHER_APPLY_TIME,'yyyy-MM-dd') otherApplyTime
FROM CH_DISABLE_INFO info
LEFT JOIN CH_APR_TASK task ON info.DISAB_INFO_ID = task.DISABLE_INFO_ID
LEFT JOIN ch_apr_report report ON report.TASK_ID = task.TASK_ID
left join ch_apr_organ aprOrgan on task.apr_organ_id = aprOrgan.apr_organ_id
LEFT JOIN CH_CFG_SRV_DISABLE_LEVEL lev ON report.DISABLE_LEVEL_ID = lev.DISABLE_LEVEL_ID
where info.SRV_MODE_ID ='4' and sysdate <![CDATA[ > ]]> report.PUBLICITY_END_TIME
and info.OTHER_APPLY_TIME is not null
and info.OTHER_APPLY_TIME = to_date(to_char(sysdate,'yyyy-MM-dd'),'yyyy-MM-dd')
</select>
<update id="placeOtherApply"> <update id="placeOtherApply">
update CH_DISABLE_INFO set OTHER_APPLY_TIME = TO_DATE ( #{otherApplyTime}, 'yyyy-MM-dd') where DISAB_INFO_ID = #{disabInfoId} update CH_DISABLE_INFO set OTHER_APPLY_TIME = TO_DATE ( #{otherApplyTime}, 'yyyy-MM-dd') where DISAB_INFO_ID = #{disabInfoId}
......
...@@ -569,4 +569,10 @@ public class DisableController { ...@@ -569,4 +569,10 @@ public class DisableController {
return Result.success(1); return Result.success(1);
} }
@GetMapping("/disableExitTask")
public Result disableExitTask(){
disableService.disableExitTask();
return Result.success();
}
} }
...@@ -6,7 +6,6 @@ import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo; ...@@ -6,7 +6,6 @@ import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram; import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend; import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend;
import com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo; 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.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -31,7 +30,9 @@ public interface DisableInfoMapper extends BaseMapper<ChDisableInfo> { ...@@ -31,7 +30,9 @@ public interface DisableInfoMapper extends BaseMapper<ChDisableInfo> {
*/ */
Page<DisableInfoListVo> getDisableInfoList(Page<DisableInfoListVo> page, @Param("srvOrganId") Long srvOrganId,String certiCode,String realName,String svrModelId); Page<DisableInfoListVo> getDisableInfoList(Page<DisableInfoListVo> page, @Param("srvOrganId") Long srvOrganId,String certiCode,String realName,String svrModelId);
int deleteSrvSend(Integer disableInfoId,String exitTime);
List<DisableInfoListVo> getDisableExitList();
int updateSrvProgramById(ChSrvProgram chSrvProgram); int updateSrvProgramById(ChSrvProgram chSrvProgram);
......
...@@ -187,4 +187,6 @@ public interface DisableService { ...@@ -187,4 +187,6 @@ public interface DisableService {
List<ChDisableExit> getDisableExitHis(Integer disableInfoId); List<ChDisableExit> getDisableExitHis(Integer disableInfoId);
Integer selectByCertiCode(String certiCode); Integer selectByCertiCode(String certiCode);
void disableExitTask();
} }
...@@ -16,13 +16,10 @@ import com.hungraim.ltc.pojo.entity.assessment.ChAprTask; ...@@ -16,13 +16,10 @@ import com.hungraim.ltc.pojo.entity.assessment.ChAprTask;
import com.hungraim.ltc.pojo.entity.assessment.ChDisableInfoHis; import com.hungraim.ltc.pojo.entity.assessment.ChDisableInfoHis;
import com.hungraim.ltc.pojo.entity.disable.*; import com.hungraim.ltc.pojo.entity.disable.*;
import com.hungraim.ltc.pojo.entity.riskLevel.ChDisableRiskLevel; 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.ChCfgPara;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram; import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend; 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.disable.*;
import com.hungraim.ltc.pojo.vo.governance.ProgramListVo;
import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo; import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo;
import com.hungraim.ltc.service.DisableService; import com.hungraim.ltc.service.DisableService;
import com.hungraim.ltc.service.OrganService; import com.hungraim.ltc.service.OrganService;
...@@ -39,7 +36,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -39,7 +36,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.awt.print.Book;
import java.util.*; import java.util.*;
@Service @Service
...@@ -643,49 +639,58 @@ public class DisableServiceImpl implements DisableService { ...@@ -643,49 +639,58 @@ public class DisableServiceImpl implements DisableService {
int result = disableInfoMapper.updateById(chDisableInfo); int result = disableInfoMapper.updateById(chDisableInfo);
boolean now = DateUtils.isNow(date); boolean now = DateUtils.isNow(date);
if (now) { if (now) {
ChSrvProgram chSrvProgram = new ChSrvProgram(); disableExitHanlder(exitReasonId, srvOrganId, disableInfoId, date);
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 = new ChSrvSend();
chSrvSend1.setDisabInfoId(Long.valueOf(disableInfoId));
chSrvSend1.setFcd(new Date());
chSrvSend1.setStatus((short)0);
chSrvSendInfoMapper.insert(chSrvSend1);
}
} }
// 解除护理机构分配
// delete from CH_SRV_SEND where DISAB_INFO_ID = '327'
// disableInfoMapper.deleteSrvSend(disableInfoId,exitTime);
// } return result;
}
/**
* 失能人员退出处理
*@param exitReasonId 失能退出原因
* @param srvOrganId 失能退出前所在护理机构
* @param disableInfoId 失能人员
* @param date 退出时间
*@return void
**/
private void disableExitHanlder(Integer exitReasonId, Integer srvOrganId, Integer disableInfoId, Date date) {
// 更新方案为已终止
ChSrvProgram chSrvProgram = new ChSrvProgram();
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 = new ChSrvSend();
chSrvSend1.setDisabInfoId(Long.valueOf(disableInfoId));
chSrvSend1.setFcd(new Date());
chSrvSend1.setStatus((short)0);
chSrvSendInfoMapper.insert(chSrvSend1);
}
// 插入历史记录
ChDisableExit chDisableExit = new ChDisableExit(); ChDisableExit chDisableExit = new ChDisableExit();
chDisableExit.setDisabInfoId(disableInfoId); chDisableExit.setDisabInfoId(disableInfoId);
chDisableExit.setExitReasonId(exitReasonId); chDisableExit.setExitReasonId(exitReasonId);
chDisableExit.setExitTime(date); chDisableExit.setExitTime(date);
chDisableExit.setSrvOrganId(srvOrganId); chDisableExit.setSrvOrganId(srvOrganId);
disableExitMapper.insert(chDisableExit); disableExitMapper.insert(chDisableExit);
return result;
} }
@Override @Override
...@@ -703,6 +708,23 @@ public class DisableServiceImpl implements DisableService { ...@@ -703,6 +708,23 @@ public class DisableServiceImpl implements DisableService {
} }
/**
* @desc 定时执行失能退出退出时间不是当天的
* @return void
**/
@Override
public void disableExitTask(){
List<DisableInfoListVo> disableExitList = disableInfoMapper.getDisableExitList();
for (DisableInfoListVo disableInfoListVo : disableExitList) {
Integer exitReasonId = disableInfoListVo.getExitReasonId();
Long srvOrganId = disableInfoListVo.getSrvOrganId();
Long disabInfoId = disableInfoListVo.getDisabInfoId();
String exitTime = disableInfoListVo.getExitTime();
Date date = DateUtils.strToDate(exitTime);
disableExitHanlder(exitReasonId,srvOrganId.intValue(),disabInfoId.intValue(),date);
}
}
} }
...@@ -2,20 +2,66 @@ ...@@ -2,20 +2,66 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hungraim.ltc.dao.DisableInfoMapper"> <mapper namespace="com.hungraim.ltc.dao.DisableInfoMapper">
<select id="getDisableInfoList" resultType="com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo"> <select id="getDisableInfoList" resultType="com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo">
SELECT distinct T2.DISAB_INFO_ID disabInfoId,
T1.PROGRAM_ID programId,
T6.SRV_ORGAN_ID srvOrganId,
T5.DISTRICT_PROVINCIAL districtProvincial,
T5.DISTRICT_CITY districtCity,
T2.REAL_NAME realName,
T2.TEL realTel,
T2.BIRTHDAY birthday,
T2.GENDER gender,
T2.ACPT_PROVINCIAL acptProvincial,
T2.ACPT_CITY acptCity,
T2.ACPT_AREA acptArea,
T2.ACPT_STREET acptStreet,
T2.ACPT_ADDRESS acptAddress,
T7.MODE_NAME svrModelName,
T5.SRV_ORGAN_NAME svrOrganName,
T1.PROG_STATUS progStatus,
T1.EFF_TIME effTime,
T2.CERTI_CODE certiCode,
T2.APPLY_ID applyId,
to_char(T2.EXIT_TIME,'yyyy-MM-dd') exitTime,
--服务方案起始日
--服务方案终止日
to_char(T1.PROGRAM_DATE,'yyyy-MM-dd HH24:mi:ss') programDate,
to_char(T1.PROGRAM_EDN_DATE,'yyyy-MM-dd HH24:mi:ss') programEdnDate,
T2.EXIT_FLAG exitFlag,
T2.EXIT_REASON_ID exitReasonId
FROM CH_DISABLE_INFO T2
inner join (select * from CH_SRV_SEND where STATUS in(1,3)) T6 on T6.DISAB_INFO_ID = T2.DISAB_INFO_ID
LEFT 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_SRV_ORGAN T5 ON T6.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
<where>
1=1
<if test="srvOrganId != null and srvOrganId != '' and srvOrganId!=0">
and T5.SRV_ORGAN_ID = #{srvOrganId}
</if>
<if test="certiCode != null and certiCode != ''">
and T2.CERTI_CODE = #{certiCode}
</if>
<if test="realName != null and realName != ''">
and T2.real_name like CONCAT(CONCAT('%',#{realName}) ,'%')
</if>
<if test="svrModelId != null and svrModelId != ''">
and T7.MODE_ID = #{svrModelId}
</if>
</where>
</select>
<select id="getDisableExitList" resultType="com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo">
SELECT distinct T2.DISAB_INFO_ID disabInfoId, SELECT distinct T2.DISAB_INFO_ID disabInfoId,
T1.PROGRAM_ID programId, T1.PROGRAM_ID programId,
T6.SRV_ORGAN_ID srvOrganId, T6.SRV_ORGAN_ID srvOrganId,
T5.DISTRICT_PROVINCIAL districtProvincial, T5.DISTRICT_PROVINCIAL districtProvincial,
T5.DISTRICT_CITY districtCity, T5.DISTRICT_CITY districtCity,
T2.REAL_NAME realName, T2.REAL_NAME realName,
T2.TEL realTel,
T2.BIRTHDAY birthday,
T2.GENDER gender,
T2.ACPT_PROVINCIAL acptProvincial,
T2.ACPT_CITY acptCity,
T2.ACPT_AREA acptArea,
T2.ACPT_STREET acptStreet,
T2.ACPT_ADDRESS acptAddress,
T7.MODE_NAME svrModelName, T7.MODE_NAME svrModelName,
T5.SRV_ORGAN_NAME svrOrganName, T5.SRV_ORGAN_NAME svrOrganName,
T1.PROG_STATUS progStatus, T1.PROG_STATUS progStatus,
...@@ -34,23 +80,10 @@ ...@@ -34,23 +80,10 @@
LEFT JOIN CH_SRV_PROGRAM T1 ON T1.DISAB_INFO_ID = T2.DISAB_INFO_ID LEFT 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_CFG_SRV_MODE T7 ON T2.SRV_MODE_ID = T7.MODE_ID
LEFT JOIN CH_SRV_ORGAN T5 ON T6.SRV_ORGAN_ID = T5.SRV_ORGAN_ID LEFT JOIN CH_SRV_ORGAN T5 ON T6.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
<where> where T2.EXIT_TIME is not null
1=1 and T2.EXIT_TIME = to_date(to_char(sysdate,'yyyy-MM-dd'),'yyyy-MM-dd')
<if test="srvOrganId != null and srvOrganId != '' and srvOrganId!=0"> </select>
and T5.SRV_ORGAN_ID = #{srvOrganId}
</if>
<if test="certiCode != null and certiCode != ''">
and T2.CERTI_CODE = #{certiCode}
</if>
<if test="realName != null and realName != ''">
and T2.real_name like CONCAT(CONCAT('%',#{realName}) ,'%')
</if>
<if test="svrModelId != null and svrModelId != ''">
and T7.MODE_ID = #{svrModelId}
</if>
</where>
</select>
<update id="updateChSrvProgram"> <update id="updateChSrvProgram">
update CH_SRV_PROGRAM t set t.PROG_STATUS ='2' ,t.END_TIME =sysdate update CH_SRV_PROGRAM t set t.PROG_STATUS ='2' ,t.END_TIME =sysdate
...@@ -58,9 +91,7 @@ ...@@ -58,9 +91,7 @@
</update> </update>
<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 id="updateSrvProgramById" parameterType="com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram">
......
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