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
<?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.manage.mapper.DpShipDeviceMapper">
 
    <insert id="insertDpShipDevice" parameterType="com.ruoyi.manage.domain.DpShipDevice">
        insert into DP_SHIP_DEVICE(DEVICE_ID, DEVICE_NAME, DEVICE_SHIP_ID, DEVICE_OVERVIEW,
                                   DEVICE_MODEL, DEVICE_PARAMETERS, UPDATE_TIME, UPDATE_USER)
        values(#{entity.deviceId}, #{entity.deviceName}, #{entity.deviceShipId},  #{entity.deviceOverview},
               #{entity.deviceModel}, #{entity.deviceParameters}, #{entity.updateTime}, #{entity.updateUser})
    </insert>
 
    <update id="updateDpShipDevice" parameterType="com.ruoyi.manage.domain.DpShipDevice">
        UPDATE DP_SHIP_DEVICE
        SET
            DEVICE_ID = #{entity.deviceId},
            DEVICE_NAME = #{entity.deviceName},
            DEVICE_SHIP_ID = #{entity.deviceShipId},
            DEVICE_OVERVIEW = #{entity.deviceOverview},
            DEVICE_MODEL = #{entity.deviceModel},
            DEVICE_PARAMETERS = #{entity.deviceParameters},
            UPDATE_TIME = #{entity.updateTime},
            UPDATE_USER = #{entity.updateUser}
        WHERE ID = #{entity.id}
    </update>
 
    <delete id="deleteDpShipDevice" parameterType="string">
        delete from DP_SHIP_DEVICE where ID = #{id}
    </delete>
 
    <select id="selectDpShipDevice" parameterType="string" resultType="com.ruoyi.manage.domain.DpShipDevice">
        select a.*,b.SHIP_NAME as deviceShipName,c.SHIP_MODEL as deviceModel,c.TYPE_NAME as shipTypeName from DP_SHIP_DEVICE a
        left join DP_Ships b on a.DEVICE_SHIP_ID = b.SHIP_ID
        left join DP_SHIP_TYPE c on a.SHIP_TYPE_ID = c.ID
        <where>
            <if test="id != null and id != ''">
                and a.ID = #{id}
            </if>
        </where>
    </select>
 
    <select id="selectDpShipDeviceByName" parameterType="string" resultType="com.ruoyi.manage.domain.DpShipDevice">
        select a.*,b.SHIP_NAME as deviceShipName,c.SHIP_MODEL as deviceModel,c.TYPE_NAME as shipTypeName from DP_SHIP_DEVICE a
        left join DP_Ships b on a.DEVICE_SHIP_ID = b.SHIP_ID
        left join DP_SHIP_TYPE c on a.SHIP_TYPE_ID = c.ID
        <where>
            <if test="name != null and name != ''">
                and a.DEVICE_NAME = #{name}
            </if>
        </where>
    </select>
 
    <select id="getDpShipDevices" resultType="com.ruoyi.manage.domain.DpShipDevice">
        select a.*,b.SHIP_NAME as deviceShipName,c.SHIP_MODEL as deviceModel,c.TYPE_NAME as shipTypeName from DP_SHIP_DEVICE a
        left join DP_Ships b on a.DEVICE_SHIP_ID = b.SHIP_ID
        left join DP_SHIP_TYPE c on a.SHIP_TYPE_ID = c.ID
    </select>
 
    <select id="selectDpShipDeviceByShipId" parameterType="string" resultType="com.ruoyi.manage.domain.DpShipDevice">
        select a.*,b.SHIP_NAME as deviceShipName,c.SHIP_MODEL as deviceModel,c.TYPE_NAME as shipTypeName from DP_SHIP_DEVICE a
        left join DP_Ships b on a.DEVICE_SHIP_ID = b.SHIP_ID
        left join DP_SHIP_TYPE c on a.SHIP_TYPE_ID = c.ID
        <where>
        <if test="deviceShipId != null and deviceShipId != ''">
         and a.DEVICE_SHIP_ID = #{deviceShipId}
        </if>
        </where>
    </select>
 
    <select id="getTotal" resultType="java.lang.Long">
        select count(1) from DP_SHIP_DEVICE a left join DP_Ships b on a.DEVICE_SHIP_ID = b.SHIP_ID
        <where>
            <if test="deviceName != null and deviceName != ''">
                and a.DEVICE_NAME like concat('%', #{deviceName}, '%')
            </if>
            <if test="deviceId!=null and deviceId!=''">
                and a.DEVICE_ID like concat('%', #{deviceId}, '%')
            </if>
        </where>
    </select>
    <select id="getPageList" resultType="com.ruoyi.manage.domain.DpShipDevice">
        select a.*,b.SHIP_NAME as deviceShipName,c.SHIP_MODEL as deviceModel,c.TYPE_NAME as shipTypeName,
        c.SHIP_DESIGN as shipDesign from DP_SHIP_DEVICE a
        left join DP_Ships b on a.DEVICE_SHIP_ID = b.SHIP_ID
        left join DP_SHIP_TYPE c on a.SHIP_TYPE_ID = c.ID
        <where>
            <if test="deviceName != null and deviceName != ''">
                and a.DEVICE_NAME like concat('%', #{deviceName}, '%')
            </if>
            <if test="deviceId!=null and deviceId!=''">
                and a.DEVICE_ID like concat('%', #{deviceId}, '%')
            </if>
        </where>
        order by a.ID DESC
        limit #{pageSize} offset #{offset}
    </select>
 
</mapper>