| | |
| | | <select id="selectPatArchiveOutList" parameterType="com.smartor.domain.PatArchiveOut" |
| | | resultMap="PatArchiveOutResult"> |
| | | <include refid="selectPatArchiveOutVo"/> |
| | | <where> |
| | | where 1=1 |
| | | <if test="patientno != null and patientno != ''">and patientno = #{patientno}</if> |
| | | <if test="pattype != null and pattype != ''">and pattype = #{pattype}</if> |
| | | <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> |
| | |
| | | <if test="pid != null ">and pid = #{pid}</if> |
| | | <if test="guid != null and guid != ''">and guid = #{guid}</if> |
| | | <if test="membertype != null and membertype != ''">and membertype = #{membertype}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectPatArchiveOutByPatid" parameterType="Long" resultMap="PatArchiveOutResult"> |
| | |
| | | select aa.name1 as name, aa.count as count |
| | | from ( |
| | | SELECT "住院" as name1, count(1) as count FROM `pat_med_inhosp` |
| | | <where> |
| | | del_flag = 0 and endtime = null |
| | | where 1=1 |
| | | and del_flag = 0 and endtime = null |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="deptIds != null ">and deptId in |
| | | <foreach collection="deptIds" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId} |
| | |
| | | #{drCode} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | union |
| | | select "出院" name1, count(1) as count FROM `pat_med_inhosp` |
| | | <where> |
| | | del_flag=0 and endtime != null |
| | | where 1=1 |
| | | and del_flag = 0 and endtime != null |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="deptIds != null ">and deptId in |
| | | <foreach collection="deptIds" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId} |
| | |
| | | #{drCode} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | union |
| | | select "门诊" name1, count(1) as count FROM `pat_med_outhosp` |
| | | where del_flag=0 |