skyeyesystem/backend/Skyeye-sys-dev/skyeye-service-manager/target/classes/mapping/jm/JmAirlineMapping.xml

270 lines
10 KiB
XML
Raw Normal View History

<?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.zhangy.skyeye.jm.mapper.JmAirlineMapper">
<sql id="selectSql">
select
l.id,
l.job_id,
l.flight_no,
l.flight_num,
l.flight_start_lon,
l.flight_start_lat,
l.flight_start_height,
l.ground_start_lon,
l.ground_start_lat,
l.ground_start_height,
l.flight_end_lon,
l.flight_end_lat,
l.flight_end_height,
l.target_centroid_lon,
l.target_centroid_lat,
l.target_centroid_height,
l.target_width,
l.target_length,
l.target_heading,
l.speed,
l.height,
l.grazing_angle,
l.squint_angle,
l.flight_type,
l.direction,
l.polarization,
l.uav_id,
l.status,
l.begin_time,
l.end_time,
l.start_lon,
l.start_lat,
l.start_height,
l.end_lon,
l.end_lat,
l.end_height,
l.distance
from jm_airline l
</sql>
<select id="selectByJob" resultType="com.zhangy.skyeye.jm.entity.JmAirline">
<include refid="selectSql"/>
where l.job_id in
<foreach item="item" collection="array" open="(" separator="," close=")">
#{item}
</foreach>
order by l.job_id, l.uav_id, l.flight_no
</select>
<select id="selectByUav" resultType="com.zhangy.skyeye.jm.entity.JmAirline">
<include refid="selectSql"/>
where l.job_id = #{jobId}
<if test="array != null and array.length > 0">
and l.uav_id in
<foreach item="item" collection="array" open="(" separator="," close=")">
#{item}
</foreach>
</if>
order by l.job_id, l.uav_id, l.flight_no
</select>
<select id="selectById" resultType="com.zhangy.skyeye.jm.entity.JmAirline">
<include refid="selectSql"/>
where l.id in
<foreach item="item" collection="array" open="(" separator="," close=")">
#{item}
</foreach>
order by l.job_id, l.uav_id, l.flight_no
</select>
<insert id="insert" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
insert into jm_airline(
id,
job_id,
flight_no,
flight_num,
flight_start_lon,
flight_start_lat,
flight_start_height,
ground_start_lon,
ground_start_lat,
ground_start_height,
flight_end_lon,
flight_end_lat,
flight_end_height,
target_centroid_lon,
target_centroid_lat,
target_centroid_height,
target_width,
target_length,
target_heading,
speed,
height,
grazing_angle,
squint_angle,
flight_type,
direction,
polarization,
uav_id,
status,
begin_time,
end_time,
start_lon,
start_lat,
start_height,
end_lon,
end_lat,
end_height,
distance
) values
<foreach item="item" index="index" collection="array" separator=",">
(
#{item.id},
#{item.jobId},
#{item.flightNo},
#{item.flightNum},
#{item.flightStartLon},
#{item.flightStartLat},
#{item.flightStartHeight},
#{item.groundStartLon},
#{item.groundStartLat},
#{item.groundStartHeight},
#{item.flightEndLon},
#{item.flightEndLat},
#{item.flightEndHeight},
#{item.targetCentroidLon},
#{item.targetCentroidLat},
#{item.targetCentroidHeight},
#{item.targetWidth},
#{item.targetLength},
#{item.targetHeading},
#{item.speed},
#{item.height},
#{item.grazingAngle},
#{item.squintAngle},
#{item.flightType},
#{item.direction},
#{item.polarization},
#{item.uavId},
#{item.status},
#{item.beginTime},
#{item.endTime},
#{item.startLon},
#{item.startLat},
#{item.startHeight},
#{item.endLon},
#{item.endLat},
#{item.endHeight},
#{item.distance}
)
</foreach>
</insert>
<update id="updateNotNull">
update jm_airline
<trim prefix="SET" suffixOverrides=",">
<if test="jobId != null">job_id = #{jobId},</if>
<if test="flightNo != null">flight_no = #{flightNo},</if>
<if test="flightNum != null">flight_num = #{flightNum},</if>
<if test="flightStartLon != null">flight_start_lon = #{flightStartLon},</if>
<if test="flightStartLat != null">flight_start_lat = #{flightStartLat},</if>
<if test="flightStartHeight != null">flight_start_height = #{flightStartHeight},</if>
<if test="groundStartLon != null">ground_start_lon = #{groundStartLon},</if>
<if test="groundStartLat != null">ground_start_lat = #{groundStartLat},</if>
<if test="groundStartHeight != null">ground_start_height = #{groundStartHeight},</if>
<if test="flightEndLon != null">flight_end_lon = #{flightEndLon},</if>
<if test="flightEndLat != null">flight_end_lat = #{flightEndLat},</if>
<if test="flightEndHeight != null">flight_end_height = #{flightEndHeight},</if>
<if test="targetCentroidLon != null">target_centroid_lon = #{targetCentroidLon},</if>
<if test="targetCentroidLat != null">target_centroid_lat = #{targetCentroidLat},</if>
<if test="targetCentroidHeight != null">target_centroid_height = #{targetCentroidHeight},</if>
<if test="targetWidth != null">target_width = #{targetWidth},</if>
<if test="targetLength != null">target_length = #{targetLength},</if>
<if test="targetHeading != null">target_heading = #{targetHeading},</if>
<if test="speed != null">speed = #{speed},</if>
<if test="height != null">height = #{height},</if>
<if test="grazingAngle != null">grazing_angle = #{grazingAngle},</if>
<if test="squintAngle != null">squint_angle = #{squintAngle},</if>
<if test="flightType != null">flight_type = #{flightType},</if>
<if test="direction != null">direction = #{direction},</if>
<if test="polarization != null">polarization = #{polarization},</if>
<if test="uavId != null">uav_id = #{uavId},</if>
<if test="status != null">status = #{status},</if>
<if test="beginTime != null">begin_time = #{beginTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="startLon != null">start_lon = #{startLon},</if>
<if test="startLat != null">start_lat = #{startLat},</if>
<if test="startHeight != null">start_height = #{startHeight},</if>
<if test="endLon != null">end_lon = #{endLon},</if>
<if test="endLat != null">end_lat = #{endLat},</if>
<if test="endHeight != null">end_height = #{endHeight},</if>
<if test="distance != null">distance = #{distance},</if>
</trim>
where id = #{id}
</update>
<update id="update">
update jm_airline
<trim prefix="SET" suffixOverrides=",">
job_id = #{jobId},
flight_no = #{flightNo},
flight_num = #{flightNum},
flight_start_lon = #{flightStartLon},
flight_start_lat = #{flightStartLat},
flight_start_height = #{flightStartHeight},
ground_start_lon = #{groundStartLon},
ground_start_lat = #{groundStartLat},
ground_start_height = #{groundStartHeight},
flight_end_lon = #{flightEndLon},
flight_end_lat = #{flightEndLat},
flight_end_height = #{flightEndHeight},
target_centroid_lon = #{targetCentroidLon},
target_centroid_lat = #{targetCentroidLat},
target_centroid_height = #{targetCentroidHeight},
target_width = #{targetWidth},
target_length = #{targetLength},
target_heading = #{targetHeading},
speed = #{speed},
height = #{height},
grazing_angle = #{grazingAngle},
squint_angle = #{squintAngle},
flight_type = #{flightType},
direction = #{direction},
polarization = #{polarization},
uav_id = #{uavId},
status = #{status},
begin_time = #{beginTime},
end_time = #{endTime},
start_lon = #{startLon},
start_lat = #{startLat},
start_height = #{startHeight},
end_lon = #{endLon},
end_lat = #{endLat},
end_height = #{endHeight},
distance = #{distance},
</trim>
where id = #{id}
</update>
<delete id="delete">
delete from jm_airline where id in
<foreach item="item" collection="array" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<delete id="deleteByJob">
delete from jm_airline where job_id in
<foreach item="item" collection="array" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<delete id="deleteByUav">
delete from jm_airline
where job_id = #{jobId}
<if test="array != null and array.length > 0">
and uav_id in
<foreach item="item" collection="array" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</delete>
</mapper>