陈昶聿
昨天 0dffefa0ba7f38d54852b3c3f97158df236bfe34
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -283,6 +283,15 @@
        </foreach>
    </select>
    <select id="selectPatArchiveByPatidHiss" resultMap="PatArchiveResult">
        SELECT id, patid_his
        FROM pat_archive
        WHERE patid_his IN
        <foreach item="patidHis" collection="patidHiss" open="(" separator="," close=")">
            #{patidHis}
        </foreach>
    </select>
    <insert id="insertPatArchiveSingle" parameterType="com.smartor.domain.PatArchive" useGeneratedKeys="true"
            keyProperty="id">
        insert into pat_archive
@@ -923,10 +932,9 @@
        d.leavehospitaldistrictcode AS leavehospitaldistrictcode
        FROM
        pat_med_inhosp d
        JOIN pat_archive a ON a.id = d.patid
        LEFT JOIN pat_archive a ON a.id = d.patid
        where 1=1
            and d.del_flag != 1
            AND a.del_flag != 1
            and d.orgid = #{orgid}
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
@@ -996,7 +1004,7 @@
            </if>
            <if test="pids != null">
                AND a.id NOT IN
                AND d.patid NOT IN
                <foreach collection="pids" item="pid" open="(" separator="," close=")">
                    #{pid}
                </foreach>
@@ -1192,12 +1200,10 @@
    <!-- 住院患者总数统计(去重) -->
    <select id="countPatArchiveInfoByInhospQC" parameterType="com.smartor.domain.PatArchiveReq" resultType="long">
        SELECT COUNT(DISTINCT a.id)
        SELECT COUNT(DISTINCT d.patid)
        FROM pat_med_inhosp d
        JOIN pat_archive a ON a.id = d.patid
        WHERE 1=1
            AND d.del_flag != 1
            AND a.del_flag != 1
            AND d.orgid = #{orgid}
            <if test="name != null  and name != ''">AND a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">AND a.idcardno = #{idcardno}</if>
@@ -1241,7 +1247,7 @@
                </foreach>
            </if>
            <if test="pids != null">
                AND a.id NOT IN
                AND d.patid NOT IN
                <foreach collection="pids" item="pid" open="(" separator="," close=")">
                    #{pid}
                </foreach>