| | |
| | | b.futypecode, |
| | | b.futypedesc, |
| | | b.fuadvice, |
| | | b.fuspecialadvice |
| | | b.fuspecialadvice, |
| | | a.idcardno |
| | | FROM |
| | | pat_med_inhosp b |
| | | JOIN |
| | |
| | | a.telcode, |
| | | a.id, |
| | | a.sex |
| | | order by b.inhospid desc |
| | | <if test="cry==1"> |
| | | order by b.endtime desc |
| | | </if> |
| | | <if test="cry==0"> |
| | | order by b.starttime desc |
| | | </if> |
| | | </select> |
| | | <select id="selectPatMedInhospListByCondition" parameterType="com.smartor.domain.PatMedInhospVO" |
| | | resultMap="PatMedInhospResult"> |
| | |
| | | FROM pat_med_outhosp |
| | | <where> |
| | | del_flag=0 |
| | | <if test="deptcodeList != null"> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | |
| | | <where> |
| | | del_flag=0 |
| | | and inhospstate=0 |
| | | <if test="deptcodeList != null"> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | |
| | | <where> |
| | | del_flag=0 |
| | | and inhospstate=1 |
| | | <if test="deptcodeList != null"> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | |
| | | <where> |
| | | del_flag=0 |
| | | and inhospstate=1 |
| | | <if test="deptcodeList != null"> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | |
| | | </if> |
| | | ) AS combined |
| | | GROUP BY deptname; |
| | | |
| | | |
| | | </select> |
| | | <select id="selectPatMedInhospCount" parameterType="com.smartor.domain.PatMedReq" |
| | | resultType="com.smartor.domain.PatMedRes"> |
| | |
| | | and date_format(endtime,'%y%m%d') >= date_format(#{startDate},'%y%m%d') |
| | | and date_format(endtime,'%y%m%d') <= date_format(#{endDate},'%y%m%d') |
| | | </if> |
| | | <if test="deptcodeList != null"> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |