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
<?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.DpShipsMapper">
 
    <select id="getDpShipsById" parameterType="java.lang.String" resultType="com.ruoyi.manage.domain.DpShips">
        select a.*, c.TYPE_NAME as shipType, c.SHIP_DESIGN as shipDesign, c.SHIP_OVERVIEW as shipOverview,
        c.SHIP_PARAMETERS as shipParameters, c.SHIP_MODEL as shipModel,c.POSITION as position,c.TARGET as target,
        c.TONNAGE as tonnage, c.DRAFT as draft, c.LENGTH as length, c.CREW as crew from DP_SHIPS a
        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="getByWhIdBeId" parameterType="com.ruoyi.manage.domain.DpShips" resultType="com.ruoyi.manage.domain.DpShips">
        select a.*, c.TYPE_NAME as shipType, c.SHIP_DESIGN as shipDesign, c.SHIP_OVERVIEW as shipOverview,
        c.SHIP_PARAMETERS as shipParameters, c.SHIP_MODEL as shipModel,c.POSITION as position,c.TARGET as target,
        c.TONNAGE as tonnage, c.DRAFT as draft, c.LENGTH as length, c.CREW as crew from DP_SHIPS a
        left join DP_SHIP_TYPE c on a.SHIP_TYPE_ID = c.ID
        <where>
            <if test="whId != null and whId != ''">
                and a.WH_ID = #{whId}
            </if>
            <if test="beId != null and beId != ''">
                and a.BE_ID = #{beId}
            </if>
        </where>
    </select>
 
 
 
    <select id="getTotal" resultType="java.lang.Long">
        select count(1) from DP_SHIPS a left join DP_WHARF b on a.WH_ID = b.WH_ID
        <where>
            <if test="shipName != null and shipName != ''">
                and a.SHIP_NAME LIKE CONCAT('%', #{shipName}, '%')
            </if>
 
        </where>
    </select>
 
    <select id="getPageList" resultType="com.ruoyi.manage.domain.DpShips">
        select a.*, c.TYPE_NAME as shipType, c.SHIP_DESIGN as shipDesign, c.SHIP_OVERVIEW as shipOverview,c.POSITION as position,c.TARGET as target,
        c.SHIP_PARAMETERS as shipParameters, c.SHIP_MODEL as shipModel,b.HARBOR_NAME as whName,d.name as beName,
        c.TONNAGE as tonnage, c.DRAFT as draft, c.LENGTH as length, c.CREW as crew from DP_SHIPS a
        left join dm_harbor b on a.WH_ID = b.pkId
        left join DM_BERTH d on a.BE_ID = d.pkId
        left join DP_SHIP_TYPE c on a.SHIP_TYPE_ID = c.ID
        <where>
            <if test="shipName != null and shipName != ''">
                and a.SHIP_NAME LIKE CONCAT('%', #{shipName}, '%')
            </if>
        </where>
        order by ID DESC limit #{pageSize} offset #{offset}
    </select>
 
</mapper>