医院废弃物信息化管理平台
“mitao”
2025-12-24 3763145f34d7706923d55edc32f5cfbc8bc08b92
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?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>