<?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="cn.besteam.modules.medical.mapper.MwDisposalUnitMapper">
|
|
<select id="queryPageList" resultType="cn.besteam.modules.medical.vo.MwDisposalUnitVo">
|
select
|
du.*,
|
sd.depart_name as hospitalName,
|
CASE du.status
|
WHEN 1 THEN '启用'
|
WHEN 0 THEN '禁用'
|
ELSE '未知'
|
END as statusName
|
from mw_disposal_unit du
|
left join sys_department sd on du.hospital_id = sd.id
|
<where>
|
and du.del_flag = 0
|
<if test="dto.hospitalIdList != null and dto.hospitalIdList.size > 0 ">
|
and du.hospital_id in
|
<foreach collection="dto.hospitalIdList" item="tempId" open="(" close=")" separator=",">
|
#{tempId}
|
</foreach>
|
</if>
|
<if test="dto.unitName != null and dto.unitName != ''">
|
and du.unit_name like concat('%', #{dto.unitName}, '%')
|
</if>
|
<if test="dto.contactPerson != null and dto.contactPerson != ''">
|
and du.contact_person like concat('%', #{dto.contactPerson}, '%')
|
</if>
|
<if test="dto.contactPhone != null and dto.contactPhone != ''">
|
and du.contact_phone like concat('%', #{dto.contactPhone}, '%')
|
</if>
|
<if test="dto.status != null">
|
and du.status = #{dto.status}
|
</if>
|
</where>
|
order by du.create_time desc
|
</select>
|
|
<select id="queryList" resultType="cn.besteam.modules.medical.vo.MwDisposalUnitVo">
|
select
|
du.*,
|
sd.dept_name as hospitalName,
|
CASE du.status
|
WHEN 1 THEN '启用'
|
WHEN 0 THEN '禁用'
|
ELSE '未知'
|
END as statusName
|
from mw_disposal_unit du
|
left join sys_department sd on du.hospital_id = sd.id
|
<where>
|
and du.del_flag = 0
|
<if test="dto.hospitalIdList != null and dto.hospitalIdList.size > 0 ">
|
and du.hospital_id in
|
<foreach collection="dto.hospitalIdList" item="tempId" open="(" close=")" separator=",">
|
#{tempId}
|
</foreach>
|
</if>
|
<if test="dto.unitName != null and dto.unitName != ''">
|
and du.unit_name like concat('%', #{dto.unitName}, '%')
|
</if>
|
<if test="dto.contactPerson != null and dto.contactPerson != ''">
|
and du.contact_person like concat('%', #{dto.contactPerson}, '%')
|
</if>
|
<if test="dto.contactPhone != null and dto.contactPhone != ''">
|
and du.contact_phone like concat('%', #{dto.contactPhone}, '%')
|
</if>
|
<if test="dto.status != null">
|
and du.status = #{dto.status}
|
</if>
|
</where>
|
order by du.create_time desc
|
</select>
|
|
</mapper>
|