| | |
| | | <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"/> |
| | |
| | | <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, |
| | |
| | | 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> |
| | |
| | | <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 |
| | |
| | | #{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=")"> |
| | |
| | | </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=")"> |