| | |
| | | <result property="isManuallyCalled" column="is_manually_called"/> |
| | | <result property="campusid" column="campusid"/> |
| | | <result property="diagType" column="diag_type"/> |
| | | <!-- 2026-11:重要性标记编码(日间手术/日间诊疗/无…),建任务时取自 pat_med_inhosp --> |
| | | <result property="importanceFlagCode" column="importance_flag_code"/> |
| | | </resultMap> |
| | | |
| | | <resultMap type="com.ruoyi.task.domain.ServiceSubtaskCount" id="ServiceSubtaskResult2"> |
| | |
| | | hospitaldistrictname, |
| | | deptcode, |
| | | deptname, |
| | | importance_flag_code, |
| | | stop_state, |
| | | leavehospitaldistrictcode, |
| | | leavehospitaldistrictname, |
| | |
| | | <sql id="filterLeaveDimAnd"> |
| | | /* f-v3 */ |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | AND ( |
| | | leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="lvWardCodeItem" open="(" separator="," close=")"> |
| | | #{lvWardCodeItem} |
| | | </foreach> |
| | | <!-- 延续护理任务(service_type='99')可以在患者还没出院时生成: |
| | | 这类记录只有「在院维度」(hospitaldistrictcode / deptcode),出院维度是 NULL。 |
| | | NULL 不匹配任何 IN,任务会「提示生成成功、列表里却查不到」, |
| | | 所以出院维度为空时用同一套编码体系的在院维度兜底。 --> |
| | | OR (service_type = '99' AND (leavehospitaldistrictcode IS NULL OR leavehospitaldistrictcode = '') |
| | | AND hospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="lvWardCodeItem" open="(" separator="," close=")"> |
| | | #{lvWardCodeItem} |
| | | </foreach>) |
| | | ) |
| | | </if> |
| | | <if test="leaveldeptcodes != null and leaveldeptcodes.size() > 0"> |
| | | AND leaveldeptcode IN |
| | | AND ( |
| | | leaveldeptcode IN |
| | | <foreach collection="leaveldeptcodes" item="lvDeptCodeItem" open="(" separator="," close=")"> |
| | | #{lvDeptCodeItem} |
| | | </foreach> |
| | | OR (service_type = '99' AND (leaveldeptcode IS NULL OR leaveldeptcode = '') |
| | | AND deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="lvDeptCodeItem" open="(" separator="," close=")"> |
| | | #{lvDeptCodeItem} |
| | | </foreach>) |
| | | ) |
| | | </if> |
| | | </sql> |
| | | |
| | |
| | | or (leaveldeptcodes != null and leaveldeptcodes.size() > 0)"> |
| | | AND ( |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | ( |
| | | leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="lvWardCodeItem" open="(" separator="," close=")"> |
| | | #{lvWardCodeItem} |
| | | </foreach> |
| | | <!-- 延续护理任务(service_type='99')可以在患者还没出院时生成: |
| | | 这类记录只有「在院维度」(hospitaldistrictcode / deptcode),出院维度是 NULL。 |
| | | NULL 不匹配任何 IN,任务会「提示生成成功、列表里却查不到」, |
| | | 所以出院维度为空时用同一套编码体系的在院维度兜底。 --> |
| | | OR (service_type = '99' AND (leavehospitaldistrictcode IS NULL OR leavehospitaldistrictcode = '') |
| | | AND hospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="lvWardCodeItem" open="(" separator="," close=")"> |
| | | #{lvWardCodeItem} |
| | | </foreach>) |
| | | ) |
| | | </if> |
| | | <if test="(leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0) |
| | | and (leaveldeptcodes != null and leaveldeptcodes.size() > 0)"> |
| | | OR |
| | | </if> |
| | | <if test="leaveldeptcodes != null and leaveldeptcodes.size() > 0"> |
| | | ( |
| | | leaveldeptcode IN |
| | | <foreach collection="leaveldeptcodes" item="lvDeptCodeItem" open="(" separator="," close=")"> |
| | | #{lvDeptCodeItem} |
| | | </foreach> |
| | | OR (service_type = '99' AND (leaveldeptcode IS NULL OR leaveldeptcode = '') |
| | | AND deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="lvDeptCodeItem" open="(" separator="," close=")"> |
| | | #{lvDeptCodeItem} |
| | | </foreach>) |
| | | ) |
| | | </if> |
| | | ) |
| | | </if> |
| | |
| | | <if test="operatorNo != null and operatorNo != ''">and operator_no = #{operatorNo}</if> |
| | | <if test="wechat != null and wechat != ''">and wechat = #{wechat}</if> |
| | | <if test="hospType != null and hospType != ''">and hosp_type = #{hospType}</if> |
| | | <!-- |
| | | 2026-11:重要性标记筛选(对应 service_subtask.importance_flag_code,建任务时取自 |
| | | pat_med_inhosp.importance_flag_code)。两种写法: |
| | | ① 精确单值 importanceFlagCode = 'FH0165.01'(或描述口径 '日间手术') |
| | | ② 精确多值 importanceFlagCodes = ['FH0165.01','FH0165.02'] |
| | | 该列采集时就被拼成**描述串**(ImportFlagEnum 的 desc),多值用英文逗号拼接, |
| | | 如 '无,日间手术'(见 ServiceSLTDHealthcareRecordServiceImpl#hospitalizedApply)—— |
| | | 等值/IN 只命中单值行;多值行(现场仅 7 条,都在出院记录上)要筛全需自行写 |
| | | find_in_set。两种口径并存(有库存枚举编码、有库存中文描述),传什么按什么精确比, |
| | | 不做值域归一。 |
| | | --> |
| | | <if test="importanceFlagCode != null and importanceFlagCode != ''"> |
| | | and importance_flag_code = #{importanceFlagCode} |
| | | </if> |
| | | <if test="importanceFlagCodes != null and importanceFlagCodes.size() > 0"> |
| | | AND importance_flag_code IN |
| | | <foreach collection="importanceFlagCodes" item="impFlagItem" open="(" separator="," close=")"> |
| | | #{impFlagItem} |
| | | </foreach> |
| | | </if> |
| | | <if test="libtemplateid != null ">and libtemplateid = #{libtemplateid}</if> |
| | | <if test="libtemplatename != null ">and libtemplatename = #{libtemplatename}</if> |
| | | <if test="openid != null ">and openid = #{openid}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectCompletedInhospFollowups" resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where del_flag = '0' |
| | | and sendstate = 6 |
| | | and hosp_type in ('2', '6') |
| | | and orgid = #{orgid} |
| | | and finishtime >= #{startTime} |
| | | <if test="serviceTypes != null and serviceTypes.size() > 0"> |
| | | and service_type in |
| | | <foreach collection="serviceTypes" item="serviceType" open="(" separator="," close=")"> |
| | | #{serviceType} |
| | | </foreach> |
| | | </if> |
| | | order by id asc |
| | | limit #{limit} |
| | | </select> |
| | | |
| | | <select id="selectServiceSubtaskByDiagname" parameterType="com.ruoyi.task.domain.ServiceSubtask" |
| | | resultMap="ServiceSubtaskResult"> |
| | | select sendstate,starttime,endtime,nurse_name,phone,sex,task_name,sendname,leavediagname,visit_time FROM |
| | |
| | | <if test="hospitaldistrictname != null and hospitaldistrictname != ''">hospitaldistrictname,</if> |
| | | <if test="deptcode != null and deptcode != ''">deptcode,</if> |
| | | <if test="deptname != null and deptname != ''">deptname,</if> |
| | | <!-- 2026-11:重要性标记编码(日间手术/日间诊疗…),建任务时从 pat_med_inhosp 同步 --> |
| | | <if test="importanceFlagCode != null and importanceFlagCode != ''">importance_flag_code,</if> |
| | | <if test="labelstatus != null">labelstatus,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | |
| | | <if test="hospitaldistrictname != null and hospitaldistrictname != ''">#{hospitaldistrictname},</if> |
| | | <if test="deptcode != null and deptcode != ''">#{deptcode},</if> |
| | | <if test="deptname != null and deptname != ''">#{deptname},</if> |
| | | <if test="importanceFlagCode != null and importanceFlagCode != ''">#{importanceFlagCode},</if> |
| | | <if test="labelstatus != null">#{labelstatus},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |