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

43 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">
2024-03-25 11:21:32 +08:00
FROM sys_hospital
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"/>
2024-03-25 11:21:32 +08:00
ORDER BY create_time DESC
LIMIT #{offset},#{limit};
</select>
<select id="getHospitalTotal" resultType="java.lang.Integer">
SELECT COUNT(*)
<include refid="hospitalSelectSQL"/>
</select>
</mapper>