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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?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.DmHarborMapper">
    
    <resultMap type="com.ruoyi.manage.domain.DmHarbor" id="DmHarborResult">
        <result property="pkId"    column="pkId"    />
        <result property="harborName"    column="HARBOR_NAME"    />
        <result property="deptId"    column="dept_id"    />
        <result property="deptName"    column="dept_name"    />
        <result property="berthNo"    column="berth_no"    />
        <result property="oilB"    column="oil_b"    />
        <result property="oilG"    column="oil_g"    />
        <result property="ammoD"    column="ammo_d"    />
        <result property="ammoP"    column="ammo_p"    />
        <result property="ammoS"    column="ammo_s"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="dockName"    column="dockName"    />
        <result property="water"    column="water"    />
        <result property="material"    column="material"    />
        <result property="ammoO"    column="ammo_o"    />
        <result property="remark"    column="remark"    />
        <result property="height"    column="HEIGHT"    />
        <result property="heading"    column="HEADING"    />
        <result property="pitch"    column="PITCH"    />
        <result property="roll"    column="ROLL"    />
        <result property="latitude"    column="LATITUDE"    />
        <result property="longitude"    column="LONGITUDE"    />
        <result property="pointX"    column="POINT_X"    />
        <result property="pointY"    column="POINT_Y"    />
    </resultMap>
 
    <sql id="selectDmHarborVo">
        select pkId, HARBOR_NAME, dept_id, dept_name, berth_no, oil_b, oil_g, ammo_d, ammo_p, ammo_s, del_flag,
         create_by, create_time, update_by, update_time, dockName, water, material, ammo_o, remark,
          HEIGHT, HEADING, PITCH, ROLL, LATITUDE, LONGITUDE, POINT_X, POINT_Y from dm_harbor
    </sql>
 
    <select id="selectDmHarborList" parameterType="DmHarbor" resultMap="DmHarborResult">
        <include refid="selectDmHarborVo"/>
        <where>  
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="deptId != null "> and dept_id = #{deptId}</if>
            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
            <if test="berthNo != null "> and berth_no = #{berthNo}</if>
            <if test="oilB != null "> and oil_b = #{oilB}</if>
            <if test="oilG != null "> and oil_g = #{oilG}</if>
            <if test="ammoD != null "> and ammo_d = #{ammoD}</if>
            <if test="ammoP != null "> and ammo_p = #{ammoP}</if>
            <if test="ammoS != null "> and ammo_s = #{ammoS}</if>
            <if test="dockName != null  and dockName != ''"> and dockName like concat('%', #{dockName}, '%')</if>
            <if test="water != null "> and water = #{water}</if>
            <if test="material != null "> and material = #{material}</if>
            <if test="ammoO != null "> and ammo_o = #{ammoO}</if>
        </where>
    </select>
    
    <select id="selectDmHarborByPkId" parameterType="Long" resultMap="DmHarborResult">
        <include refid="selectDmHarborVo"/>
        where pkId = #{pkId}
    </select>
        
    <insert id="insertDmHarbor" parameterType="DmHarbor" useGeneratedKeys="true" keyProperty="pkId">
        insert into dm_harbor
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="name != null and name != ''">name,</if>
            <if test="deptId != null">dept_id,</if>
            <if test="deptName != null and deptName != ''">dept_name,</if>
            <if test="berthNo != null">berth_no,</if>
            <if test="oilB != null">oil_b,</if>
            <if test="oilG != null">oil_g,</if>
            <if test="ammoD != null">ammo_d,</if>
            <if test="ammoP != null">ammo_p,</if>
            <if test="ammoS != null">ammo_s,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="dockName != null">dockName,</if>
            <if test="water != null">water,</if>
            <if test="material != null">material,</if>
            <if test="ammoO != null">ammo_o,</if>
            <if test="remark != null">remark,</if>
            <if test="height != null">HEIGHT,</if>
            <if test="heading != null">HEADING,</if>
            <if test="pitch != null">PITCH,</if>
            <if test="roll != null">ROLL,</if>
            <if test="latitude != null">LATITUDE,</if>
            <if test="longitude != null">LONGITUDE,</if>
            <if test="pointX != null">POINT_X,</if>
            <if test="pointY != null">POINT_Y,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="name != null and name != ''">#{name},</if>
            <if test="deptId != null">#{deptId},</if>
            <if test="deptName != null and deptName != ''">#{deptName},</if>
            <if test="berthNo != null">#{berthNo},</if>
            <if test="oilB != null">#{oilB},</if>
            <if test="oilG != null">#{oilG},</if>
            <if test="ammoD != null">#{ammoD},</if>
            <if test="ammoP != null">#{ammoP},</if>
            <if test="ammoS != null">#{ammoS},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="dockName != null">#{dockName},</if>
            <if test="water != null">#{water},</if>
            <if test="material != null">#{material},</if>
            <if test="ammoO != null">#{ammoO},</if>
            <if test="remark != null">#{remark},</if>
            <if test="height != null">#{height},</if>
            <if test="heading != null">#{heading},</if>
            <if test="pitch != null">#{pitch},</if>
            <if test="roll != null">#{roll},</if>
            <if test="latitude != null">#{latitude},</if>
            <if test="longitude != null">#{longitude},</if>
            <if test="pointX != null">#{pointX},</if>
            <if test="pointY != null">#{pointY},</if>
         </trim>
    </insert>
 
    <update id="updateDmHarbor" parameterType="DmHarbor">
        update dm_harbor
        <trim prefix="SET" suffixOverrides=",">
            <if test="name != null and name != ''">name = #{name},</if>
            <if test="deptId != null">dept_id = #{deptId},</if>
            <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
            <if test="berthNo != null">berth_no = #{berthNo},</if>
            <if test="oilB != null">oil_b = #{oilB},</if>
            <if test="oilG != null">oil_g = #{oilG},</if>
            <if test="ammoD != null">ammo_d = #{ammoD},</if>
            <if test="ammoP != null">ammo_p = #{ammoP},</if>
            <if test="ammoS != null">ammo_s = #{ammoS},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="dockName != null">dockName = #{dockName},</if>
            <if test="water != null">water = #{water},</if>
            <if test="material != null">material = #{material},</if>
            <if test="ammoO != null">ammo_o = #{ammoO},</if>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where pkId = #{pkId}
    </update>
 
    <delete id="deleteDmHarborByPkId" parameterType="Long">
        delete from dm_harbor where pkId = #{pkId}
    </delete>
 
    <delete id="deleteDmHarborByPkIds" parameterType="String">
        delete from dm_harbor where pkId in 
        <foreach item="pkId" collection="array" open="(" separator="," close=")">
            #{pkId}
        </foreach>
    </delete>
 
    <select id="getPageList" resultMap="DmHarborResult">
        select a.*,b.DEPT_NAME as bumenName from dm_harbor a left join sys_dept b on a.DEPT_ID = b.DEPT_ID
        <where>
            <if test="dockName!=null and dockName!=''">
                dockname like concat('%',#{dockName},'%')
            </if>
        </where>
        order by PKID DESC
        limit #{pageSize} offset #{offset}
 
    </select>
 
    <select id="getTotal" resultType="java.lang.Integer">
        select count(1) from  dm_harbor a left join sys_dept b on a.DEPT_ID = b.DEPT_ID
        <where>
            <if test="dockName!=null and dockName!=''">
                dockname like concat('%',#{dockName},'%')
            </if>
        </where>
    </select>
</mapper>