liusheng
2024-09-21 d3bf339bd64d7b7efddc0afdd4beb1866b8b5a04
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -49,6 +49,7 @@
        <result property="inhospstate" column="inhospstate"/>
        <result property="checkFlag" column="check_flag"/>
        <result property="age" column="age"/>
        <result property="sex" column="sex"/>
        <result property="telcode" column="telcode"/>
        <result property="longTaskReason" column="long_task_reason"/>
        <result property="nurseId" column="nurse_id"/>
@@ -112,6 +113,7 @@
    <select id="selectPatMedInhospList" parameterType="com.smartor.domain.PatMedInhosp" resultMap="PatMedInhospResult">
        select CONCAT( a.age, a.age_unit ) AS age,
        a.telcode as telcode,
        a.sex,
        b.inhospid,
        b.nurse_id,
        b.nurse_name,
@@ -176,10 +178,15 @@
                concat('%', #{hospitaldistrictname}, '%')
            </if>
            <if test="endtime != null ">and b.endtime = #{endtime}</if>
            <if test="inhospno != null ">and b.inhospno = #{inhospno}</if>
            <if test="serialnum != null ">and b.serialnum = #{serialnum}</if>
            <if test="endtime != null ">and b.endtime = #{endtime}</if>
            <if test="patno != null ">and b.patno = #{patno}</if>
            <if test="nurseId != null ">and b.nurse_id = #{nurseId}</if>
            <if test="nurseName != null ">and b.nurse_name = #{nurseName}</if>
            <if test="checkFlag != null ">and b.check_flag = #{checkFlag}</if>
            <if test="cry != null and cry == 0 ">and b.endtime is null</if>
            <if test="cry != null and cry == 1 ">and b.endtime is not null</if>
            <if test="inhospstate != null ">and b.inhospstate = #{inhospstate}</if>
            <if test="schemestatus != null ">and b.schemestatus = #{schemestatus}</if>
            <if test="outWayId != null ">and b.out_way_id = #{outWayId}</if>
@@ -191,8 +198,36 @@
            <if test="leaveldeptname != null  and leaveldeptname != ''">and b.leaveldeptname like concat('%',
                #{leaveldeptname}, '%')
            </if>
               <if test="patid != null  and patid != ''">and a.id =#{patid}
            </if>
            <if test="leavehospitaldistrictname != null  and leavehospitaldistrictname != ''">and
                b.leavehospitaldistrictname like concat('%', #{leavehospitaldistrictname}, '%')
            </if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null">
                AND (b.leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
                OR b.leaveldeptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close="))">
                    #{leaveldeptcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes == null">
                AND b.leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes == null and leaveldeptcodes != null">
                AND b.leaveldeptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close=")">
                    #{leaveldeptcode}
                </foreach>
            </if>
        </where>
        order by b.inhospid desc
@@ -276,14 +311,26 @@
                #{leavediagname}, '%')
            </if>
            <if test="drname != null  and drname != ''">and b.drname like concat('%', #{drname}, '%')</if>
            <if test="leavehospitaldistrictcodes != null">
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null">
                AND (b.leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
                OR b.leaveldeptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close="))">
                    #{leaveldeptcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes == null">
                AND b.leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
            </if>
            <if test="leaveldeptcodes != null">
            <if test="leavehospitaldistrictcodes == null and leaveldeptcodes != null">
                AND b.leaveldeptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close=")">
@@ -455,11 +502,21 @@
    </update>
    <delete id="deletePatMedInhospByInhospid" parameterType="Long">
        delete
        from pat_med_inhosp
        update pat_med_inhosp
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where inhospid = #{inhospid}
    </delete>
    <delete id="deletePatMedInhospByInhospno" parameterType="String">
        update pat_med_inhosp
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where inhospno = #{inhospno}
    </delete>
    <delete id="deletePatMedInhospByInhospids" parameterType="String">
        delete from pat_med_inhosp where inhospid in
        <foreach item="inhospid" collection="array" open="(" separator="," close=")">