| | |
| | | where patid = #{patid} |
| | | </select> |
| | | |
| | | <select id="selectPatArchiveCount" parameterType="Long" resultType="com.smartor.domain.PerSonWorkbenchDto"> |
| | | 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 |
| | | <if test="deptIds != null ">and deptId in |
| | | <foreach collection="deptIds" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId} |
| | | </foreach> |
| | | </if> |
| | | <if test="drCodes != null ">and drcode in |
| | | <foreach collection="drCodes" item="drCode" open="(" separator="," close=")"> |
| | | #{drCode} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | union |
| | | select "出院" name1, count(1) as count FROM `pat_med_inhosp` |
| | | <where> |
| | | del_flag=0 and endtime != null |
| | | <if test="deptIds != null ">and deptId in |
| | | <foreach collection="deptIds" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId} |
| | | </foreach> |
| | | </if> |
| | | <if test="drCodes != null ">and drcode in |
| | | <foreach collection="drCodes" item="drCode" open="(" separator="," close=")"> |
| | | #{drCode} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | union |
| | | select "门诊" name1, count(1) as count FROM `pat_med_outhosp` |
| | | where del_flag=0 |
| | | ) aa |
| | | |
| | | </select> |
| | | |
| | | <insert id="insertPatArchiveOut" parameterType="com.smartor.domain.PatArchiveOut" useGeneratedKeys="true" |
| | | keyProperty="patid"> |
| | | insert into pat_archive_out |