| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.HospDataMapper"> |
| | | |
| | | <resultMap type="HospData" id="HospDataResult"> |
| | | <result property="hospId" column="HospID" /> |
| | | <result property="hospName" column="HospName" /> |
| | | <result property="hospCityId" column="HospCityID" /> |
| | | <result property="hospShort" column="HospShort" /> |
| | | <result property="hopsProvince" column="HopsProvince" /> |
| | | <result property="hopsCity" column="HopsCity" /> |
| | | <result property="hopsArea" column="HopsArea" /> |
| | | <result property="hospAddress" column="HospAddress" /> |
| | | <result property="hospTel" column="HospTEL" /> |
| | | <result property="hospUnitId" column="HospUnitID" /> |
| | | <result property="hospState" column="HospState" /> |
| | | <result property="hospOaId" column="HospOAID" /> |
| | | <result property="hospIntroducerId" column="HospIntroducerID" /> |
| | | <result property="hospIntroducerDate" column="HospIntroducerDate" /> |
| | | <result property="hospLevel" column="HospLevel" /> |
| | | </resultMap> |
| | | |
| | | <select id="searchHospitals" resultMap="HospDataResult"> |
| | | SELECT TOP 100 |
| | | HospID, HospName, HospCityID, HospShort, |
| | | HopsProvince, HopsCity, HopsArea, HospAddress, |
| | | HospTEL, HospUnitID, HospState, HospOAID, |
| | | HospIntroducerID, HospIntroducerDate, HospLevel |
| | | FROM HospData |
| | | WHERE 1=1 |
| | | <!-- 地域过滤:对HospProvince, HospCity, HospArea进行OR匹配 --> |
| | | <if test="region != null and region != ''"> |
| | | AND (HopsProvince LIKE '%' + #{region} + '%' |
| | | OR HopsCity LIKE '%' + #{region} + '%' |
| | | OR HopsArea LIKE '%' + #{region} + '%') |
| | | </if> |
| | | <!-- 关键词过滤:对多个字段进行OR匹配 --> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND (HopsProvince LIKE '%' + #{keyword} + '%' |
| | | OR HopsCity LIKE '%' + #{keyword} + '%' |
| | | OR HopsArea LIKE '%' + #{keyword} + '%' |
| | | OR HospAddress LIKE '%' + #{keyword} + '%' |
| | | OR HospName LIKE '%' + #{keyword} + '%' |
| | | OR HospShort LIKE '%' + #{keyword} + '%') |
| | | </if> |
| | | AND (HospState IS NULL OR HospState = 1) |
| | | ORDER BY HospName |
| | | </select> |
| | | |
| | | <select id="selectHospDataById" parameterType="Integer" resultMap="HospDataResult"> |
| | | SELECT |
| | | HospID, HospName, HospCityID, HospShort, |
| | | HopsProvince, HopsCity, HopsArea, HospAddress, |
| | | HospTEL, HospUnitID, HospState, HospOAID, |
| | | HospIntroducerID, HospIntroducerDate, HospLevel |
| | | FROM HospData |
| | | WHERE HospID = #{hospId} |
| | | </select> |
| | | </mapper> |