13693261870
2025-07-02 6708810c4de34dfb9513061432d656f91d56ee3a
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?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.fuzhou.mapper.EquipmentMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.fuzhou.domain.DpEquipment">
        <id column="ID" property="id" />
        <result column="BE_ID" property="beId" />
        <result column="EQU_NAME" property="equName" />
        <result column="PROTOCOL" property="protocol" />
        <result column="EQU_SE_TYPE" property="equSeType" />
        <result column="PERIOD_TIME" property="periodTime" />
        <result column="INTERVAL_TIME" property="intervalTime" />
        <result column="WH_ID" property="whId" />
        <result column="X" property="x" />
        <result column="Y" property="y" />
        <result column="Z" property="z" />
        <result column="FIELD_NAME" property="fieldName" />
        <result column="EQUIPMENT_TYPE_ID" property="equipmentTypeId" />
    </resultMap>
 
 
    <delete id="deleteBy">
        delete from DP_EQUIPMENT where wh_id in (select wh_id from DP_BERTH where be_id = #{beId})
    </delete>
    <select id="getTotal" resultType="java.lang.Long">
        select count(1) from DP_EQUIPMENT a
        left join DM_BERTH c on c.pkId = a.BE_ID
        left join dm_harbor b on c.HARBOR_ID = b.pkId
        <where>
            <if test="beId != null and beId != ''">
                and a.BE_ID = #{beId}
            </if>
            <if test="whId != null and whId != ''">
                and b.pkId = #{whId}
            </if>
            <if test="equName != null and equName != ''">
                and a.EQU_NAME like concat('%',#{equName},'%')
            </if>
        </where>
    </select>
 
    <select id="getListByBeId" resultType="com.ruoyi.fuzhou.domain.vo.DpEquipmentVO">
        select a.*,b.HARBOR_NAME as whName ,b.pkId as whId,c.NAME as beName,c.pkId as beId,
        d.ID as equipmentTypeId,d.TYPE_NAME as equtype,d.DESCRIPTION as description,d.FILE_PATH as filepath,d.ICON as icon,
        b.HARBOR_NAME as whName, c.NAME as beName from DP_EQUIPMENT a
        left join DM_BERTH c on c.pkId = a.BE_ID
        left join dm_harbor b on c.HARBOR_ID = b.pkId
        left join DP_EQUIPMENT_TYPE d on d.ID = a.EQUIPMENT_TYPE_ID
        <where>
            <if test="beId != null and beId != ''">
                and a.BE_ID = #{beId}
            </if>
        </where>
    </select>
 
    <select id="getListByWhId" resultType="com.ruoyi.fuzhou.domain.vo.DpEquipmentVO">
        select a.*,b.HARBOR_NAME as whName ,b.pkId as whId,c.NAME as beName,c.pkId as beId,
        d.ID as equipmentTypeId,d.TYPE_NAME as equtype,d.DESCRIPTION as description,d.FILE_PATH as filepath,d.ICON as icon,
        b.HARBOR_NAME as whName, c.NAME as beName from DP_EQUIPMENT a
        left join DM_BERTH c on c.pkId = a.BE_ID
        left join dm_harbor b on c.HARBOR_ID = b.pkId
        left join DP_EQUIPMENT_TYPE d on d.ID = a.EQUIPMENT_TYPE_ID
        <where>
            <if test="whId != null and whId != ''">
                and b.pkId = #{whId}
            </if>
        </where>
    </select>
 
    <select id="getPageList" resultType="com.ruoyi.fuzhou.domain.vo.DpEquipmentVO">
        select a.*,b.HARBOR_NAME as whName ,b.pkId as whId,c.NAME as beName,c.pkId as beId,
        d.ID as equipmentTypeId,d.TYPE_NAME as typeName,d.DESCRIPTION as description,d.FILE_PATH as filepath,d.ICON as icon,
        b.HARBOR_NAME as whName, c.NAME as beName from DP_EQUIPMENT a
        left join DM_BERTH c on c.pkId = a.BE_ID
        left join dm_harbor b on c.HARBOR_ID = b.pkId
        left join DP_EQUIPMENT_TYPE d on d.ID = a.EQUIPMENT_TYPE_ID
        <where>
            <if test="beId != null and beId != ''">
                and a.BE_ID = #{beId}
            </if>
            <if test="whId != null and whId != ''">
                and b.pkId = #{whId}
            </if>
            <if test="equipmentTypeId != null and equipmentTypeId != ''">
                and d.ID = #{equipmentTypeId}
            </if>
            <if test="equName != null and equName != ''">
                and a.EQU_NAME like concat('%',#{equName},'%')
            </if>
        </where>
        order by a.ID DESC limit #{pageSize} offset #{offset}
    </select>
 
    <select id="queryById" resultType="com.ruoyi.fuzhou.domain.vo.DpEquipmentVO">
        select a.*,b.HARBOR_NAME as whName ,b.pkId as whId,c.NAME as beName,c.pkId as beId,
        d.ID as equipmentTypeId,d.TYPE_NAME as equtype,d.DESCRIPTION as description,d.FILE_PATH as filepath,d.ICON as icon,
        b.HARBOR_NAME as whName, c.NAME as beName from DP_EQUIPMENT a
        left join DM_BERTH c on c.pkId = a.BE_ID
        left join dm_harbor b on c.HARBOR_ID = b.pkId
        left join DP_EQUIPMENT_TYPE d on d.ID = a.EQUIPMENT_TYPE_ID
        where a.ID = #{id}
    </select>
 
    <select id="getListByBeIdTypeId" resultType="com.ruoyi.fuzhou.domain.vo.DpEquipmentVO">
        select a.*,b.HARBOR_NAME as whName ,b.pkId as whId,c.NAME as beName,c.pkId as beId,
        d.ID as equipmentTypeId,d.TYPE_NAME as equtype,d.DESCRIPTION as description,d.FILE_PATH as filepath,d.ICON as icon,
        b.HARBOR_NAME as whName, c.NAME as beName from DP_EQUIPMENT a
        left join DM_BERTH c on c.pkId = a.BE_ID
        left join dm_harbor b on c.HARBOR_ID = b.pkId
        left join DP_EQUIPMENT_TYPE d on d.ID = a.EQUIPMENT_TYPE_ID
        <where>
            <if test="beId != null and beId != ''">
                and a.BE_ID = #{beId}
            </if>
<!--            <if test="typeId != null and typeId != ''">-->
<!--                and a.EQUIPMENT_TYPE_ID = #{typeId}-->
<!--            </if>-->
            <if test="typeIds !=null and typeIds.size() > 0">
                and a.EQUIPMENT_TYPE_ID in
                <foreach item="typeId" collection="typeIds" open="(" separator="," close=")">
                    #{typeId}
                </foreach>
            </if>
        </where>
    </select>
 
</mapper>