rax-remote-v2/upms/upms-biz/src/main/resources/mapper/SysHospitalMapper.xml

44 lines
899 B
XML
Raw Normal View History

<?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.rax.admin.mapper.SysHospitalMapper">
<sql id="hospitalPropertiesSQL">
id,
name,
code,
status,
province,
city
</sql>
<sql id="hospitalSelectSQL">
FROM sys_hostipal
WHERE deleted = 0
<if test="name != null and name != ''">
<bind name="bindName" value="'%' + name + '%'"/>
AND name LIKE '#{bindName}'
</if>
</sql>
<select id="getHospitalList" resultType="com.rax.admin.api.dto.HospitalDTO">
SELECT
<include refid="hospitalPropertiesSQL"/>
<include refid="hospitalSelectSQL"/>
order by create_time desc
limit #{offset},#{limit}
</select>
<select id="getHospitalTotal" resultType="java.lang.Integer">
SELECT COUNT(*)
<include refid="hospitalSelectSQL"/>
</select>
</mapper>