Commit 5933cd4d authored by zhangwanglin's avatar zhangwanglin

失能退出

parent d6f719c0
......@@ -2,12 +2,12 @@
<!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">
<select id="getDisableInfoList" resultType="com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo">
with bb as (
SELECT T2.DISAB_INFO_ID disabInfoId,
max(T6.SRV_ORGAN_ID) srvOrganId,
SELECT max(T6.SRV_SEND_ID) srvSendId,
T2.DISAB_INFO_ID disabInfoId,
T2.REAL_NAME realName,
DECODE(max(T2.SRV_MODE_ID), '1','医疗','2', '养老','3','上门', '4', '异地') svrModelName,
max(T5.SRV_ORGAN_NAME) svrOrganName,
to_char(max(e.EXIT_TIME),'yyyy-MM-dd') exitTime,
max(T2.CERTI_CODE) CERTI_CODE,
max(e.EXIT_REASON_ID) exitReasonId,
......@@ -16,16 +16,17 @@
max(apply.apply_id) applyId
FROM CH_SRV_SEND T6
LEFT join CH_DISABLE_INFO T2 on T6.DISAB_INFO_ID = T2.DISAB_INFO_ID
LEFT JOIN CH_SRV_ORGAN T5 ON T6.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
left join CH_DISABLE_APPLY apply on apply.APPLY_ID = T2.APPLY_ID
left join CH_DISABLE_EXIT
e on e.DISAB_INFO_ID = T2.DISAB_INFO_ID
group by T2.DISAB_INFO_ID,T2.REAL_NAME)
select t.*, ( case when t.exitReasonId is null then null else 1 end ) exitFlag from bb t
select t.*,o.SRV_ORGAN_ID srvOrganId,o.SRV_ORGAN_NAME svrOrganName, ( case when t.exitReasonId is null then null else 1 end ) exitFlag from bb t
left join CH_SRV_SEND s on t.srvSendId = s.SRV_SEND_ID
LEFT JOIN CH_SRV_ORGAN o ON o.SRV_ORGAN_ID = s.SRV_ORGAN_ID
<where>
1=1
<if test="srvOrganId != null and srvOrganId != '' and srvOrganId!=0">
and t.srvOrganId = #{srvOrganId}
and o.SRV_ORGAN_ID = #{srvOrganId}
</if>
<if test="certiCode != null and certiCode != ''">
and t.CERTI_CODE = #{certiCode}
......
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