| | |
| | | <result property="guid" column="guid"/> |
| | | <result property="patno" column="patno"/> |
| | | <result property="diagcheckFlag" column="diagcheck_flag"/> |
| | | <result property="idcardno" column="idcardno"/> |
| | | <result property="remark" column="remark"/> |
| | | </resultMap> |
| | | |
| | |
| | | pmo.patname, |
| | | CONCAT(pa.age,pa.age_unit,pa.age2,pa.age_unit2) AS age, |
| | | pa.telcode, |
| | | pmo.mainsuit |
| | | pmo.mainsuit, |
| | | pa.idcardno |
| | | from pat_med_outhosp pmo left join pat_archive pa on pmo.patid = pa.id |
| | | <where> |
| | | pmo.del_flag=0 |
| | |
| | | <if test="deptname != null and deptname != ''">and pmo.deptname like concat('%', #{deptname}, '%')</if> |
| | | <if test="drname != null and drname != ''">and pmo.drname like concat('%', #{drname}, '%')</if> |
| | | <if test="patname != null and patname != ''">and pmo.patname like concat('%', #{patname}, '%')</if> |
| | | |
| | | <!--<if test="beginTime != null ">and date_format(pmo.admitdate,'%Y%m%d%H%i%s') >= |
| | | date_format(#{beginTime},'%Y%m%d%H%i%s') |
| | | </if> |
| | | <if test="endTime != null ">and date_format(pmo.admitdate,'%Y%m%d%H%i%s') <= |
| | | date_format(#{endTime},'%Y%m%d%H%i%s') |
| | | </if>--> |
| | | <if test="beginTime != null ">and date_format(pmo.admitdate,'%y%m%d') >= |
| | | date_format(#{beginTime},'%y%m%d') |
| | | </if> |
| | |
| | | del_flag=0 |
| | | and date_format(admitdate,'%y%m%d') >= date_format(#{startDate},'%y%m%d') |
| | | and date_format(admitdate,'%y%m%d') <= date_format(#{endDate},'%y%m%d') |
| | | <if test="deptcodeList != null"> |
| | | <if test="deptcodeList != null and deptcodeList.size()>0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getDeptRanking" parameterType="com.smartor.domain.PatMedReq" resultType="com.smartor.domain.PatMedRes"> |
| | | SELECT deptname, COUNT(1) AS rc |
| | | FROM pat_med_outhosp |
| | | <where> |
| | | del_flag=0 |
| | | <if test="inhospstate != inhospstate"> |
| | | and inhospstate= #{inhospstate} |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size()>0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |