| | |
| | | ) |
| | | </if> |
| | | AND (HospState IS NULL OR HospState = 1) |
| | | ORDER BY HospName |
| | | ORDER BY |
| | | CASE WHEN HospName = '家中' THEN 0 ELSE 1 END, |
| | | HospName |
| | | </select> |
| | | |
| | | <select id="selectHospDataById" parameterType="Integer" resultMap="HospDataResult"> |
| | |
| | | FROM HospData |
| | | WHERE HospID = #{hospId} |
| | | </select> |
| | | |
| | | <!-- 查询常用转出医院ID列表 --> |
| | | <select id="selectFrequentOutHospitalIds" resultType="java.lang.Integer"> |
| | | select ServiceOrdPtOutHospID from ( |
| | | select ServiceOrdPtOutHospID,count(1) as InCount from ServiceOrder |
| | | where ServiceOrdClass=#{serviceOrdClass} and ServiceOrdPtOutHospID>0 |
| | | group by ServiceOrdPtOutHospID |
| | | ) as t |
| | | order by InCount desc |
| | | </select> |
| | | <select id="getHomeHospId" resultType="java.lang.Integer"> |
| | | select HospID from HospData where HospName='家中' |
| | | </select> |
| | | |
| | | <!-- 查询常用转入医院ID列表 --> |
| | | <select id="selectFrequentInHospitalIds" resultType="java.lang.Integer"> |
| | | select ServiceOrdPtInHospID from ( |
| | | select ServiceOrdPtInHospID,count(1) as InCount from ServiceOrder |
| | | where ServiceOrdClass=#{serviceOrdClass} and ServiceOrdPtInHospID>0 |
| | | group by ServiceOrdPtInHospID |
| | | ) as t |
| | | order by InCount desc |
| | | </select> |
| | | |
| | | <!-- 根据医院ID列表查询医院信息 --> |
| | | <select id="selectHospDataByIds" resultMap="HospDataResult"> |
| | | SELECT |
| | | HospID, HospName, HospCityID, HospShort, |
| | | HopsProvince, HopsCity, HopsArea, HospAddress, |
| | | HospTEL, HospUnitID, HospState, HospOAID, |
| | | HospIntroducerID, HospIntroducerDate, HospLevel |
| | | FROM HospData |
| | | WHERE HospID IN |
| | | <foreach collection="hospIds" item="hospId" open="(" separator="," close=")"> |
| | | #{hospId} |
| | | </foreach> |
| | | <if test="region != null and region != ''"> |
| | | AND ( |
| | | HopsProvince LIKE '%' + #{region} + '%' |
| | | OR HopsCity LIKE '%' + #{region} + '%' |
| | | OR HopsArea LIKE '%' + #{region} + '%' |
| | | ) |
| | | </if> |
| | | AND (HospState IS NULL OR HospState = 1) |
| | | ORDER BY HospName |
| | | </select> |
| | | </mapper> |