92 lines
3.9 KiB
XML
92 lines
3.9 KiB
XML
<?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.device.mapper.DockAircraftMapper">
|
|
|
|
<resultMap type="com.ruoyi.device.mapper.entity.DockAircraftEntity" id="DockAircraftResult">
|
|
<result property="id" column="id" />
|
|
<result property="dockId" column="dock_id" />
|
|
<result property="aircraftId" column="aircraft_id" />
|
|
<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="remark" column="remark" />
|
|
</resultMap>
|
|
|
|
<sql id="selectDockAircraftVo">
|
|
select id, dock_id, aircraft_id,
|
|
create_by, create_time, update_by, update_time, remark
|
|
from device_dock_aircraft
|
|
</sql>
|
|
|
|
<select id="selectDockAircraftById" parameterType="Long" resultMap="DockAircraftResult">
|
|
<include refid="selectDockAircraftVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<select id="selectDockAircraftListByDockId" parameterType="Long" resultMap="DockAircraftResult">
|
|
<include refid="selectDockAircraftVo"/>
|
|
where dock_id = #{dockId}
|
|
</select>
|
|
|
|
<select id="selectDockAircraftListByAircraftId" parameterType="Long" resultMap="DockAircraftResult">
|
|
<include refid="selectDockAircraftVo"/>
|
|
where aircraft_id = #{aircraftId}
|
|
</select>
|
|
|
|
<select id="selectDockAircraftList" parameterType="com.ruoyi.device.mapper.entity.DockAircraftEntity" resultMap="DockAircraftResult">
|
|
<include refid="selectDockAircraftVo"/>
|
|
<where>
|
|
<if test="dockId != null">
|
|
and dock_id = #{dockId}
|
|
</if>
|
|
<if test="aircraftId != null">
|
|
and aircraft_id = #{aircraftId}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<insert id="insertDockAircraft" parameterType="com.ruoyi.device.mapper.entity.DockAircraftEntity" useGeneratedKeys="true" keyProperty="id">
|
|
insert into device_dock_aircraft
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="dockId != null">dock_id,</if>
|
|
<if test="aircraftId != null">aircraft_id,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
create_time
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="dockId != null">#{dockId},</if>
|
|
<if test="aircraftId != null">#{aircraftId},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
now()
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateDockAircraft" parameterType="com.ruoyi.device.mapper.entity.DockAircraftEntity">
|
|
update device_dock_aircraft
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="dockId != null">dock_id = #{dockId},</if>
|
|
<if test="aircraftId != null">aircraft_id = #{aircraftId},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
update_time = now()
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteDockAircraftById" parameterType="Long">
|
|
delete from device_dock_aircraft where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteDockAircraftByIds" parameterType="Long">
|
|
delete from device_dock_aircraft where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper> |