liusheng
2026-10-10 0afac42fb2e9d6e5291304dd0044ce3042b45d2b
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -661,6 +661,19 @@
          AND d.del_flag = 0
    </select>
    <!-- 批量取患者标签,替代逐行调用 getTagnameBypatid;每行含 patid、tagname 两个 key -->
    <select id="getTagnameByPatids" resultType="java.util.HashMap">
        SELECT d.patid                     AS patid,
               GROUP_CONCAT(d.tagname, ', ') AS tagname
        FROM pat_archivetag d
        WHERE d.del_flag = 0
          AND d.patid IN
        <foreach collection="patids" item="patid" open="(" separator="," close=")">
            #{patid}
        </foreach>
        GROUP BY d.patid
    </select>
    <select id="selectPatMedInhospByInhospid" parameterType="Long" resultMap="PatMedInhospResult">
        <include refid="selectPatMedInhospVo"/>
@@ -746,6 +759,18 @@
        <if test="medicalCompany != null  and medicalCompany != ''">and medical_company like
            concat('%'#{medicalCompany}, '%')
        </if>
    </select>
    <!-- 按患者编号 + 出院日期查询出院记录(出院时间只比较到天,不比较时分秒),用于判断患者是否再入院 -->
    <select id="selectOutInhospByPatnoAndOutDate" resultMap="PatMedInhospResult">
        <include refid="selectPatMedInhospVo"/>
        where del_flag = 0
        and inhospstate = '1'
        <if test="patno != null and patno != ''">and patno = #{patno}</if>
        <if test="dayStart != null">and endtime &gt;= #{dayStart}</if>
        <if test="dayEnd != null">and endtime &lt; #{dayEnd}</if>
        order by inhospid desc
    </select>
@@ -893,6 +918,7 @@
            <if test="fuspecialadvice != null ">#{fuspecialadvice},</if>
            <if test="managementDoctor != null ">#{managementDoctor},</if>
            <if test="managementDoctorCode != null ">#{managementDoctorCode},</if>
            <if test="inhospMydFlag != null ">#{inhospMydFlag},</if>
            <if test="importanceFlagCode != null ">#{importanceFlagCode},</if>
            <if test="emergencyLevelCode != null ">#{emergencyLevelCode},</if>
            <if test="encounterSourceId != null ">#{encounterSourceId},</if>
@@ -917,7 +943,7 @@
        nurse_id, nurse_name, out_way_id, out_way_name, guid,
        operator, operator_id, inhospno, remark,
        fuflag, fudate, fuperiod, futypecode, futypedesc, fuadvice, fuspecialadvice, management_doctor,
        management_doctor_doctor,campusid, inhosp_myd_flag, importance_flag_code, emergency_level_code, encounter_source_id,
        management_doctor_code,campusid, inhosp_myd_flag, importance_flag_code, emergency_level_code, encounter_source_id,
        medical_code, medical_name, medical_company
        )
        values