<?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>
|