159 lines
5.1 KiB
XML
159 lines
5.1 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.zhangy.skyeye.jm.mapper.JmAirlineExecMapper">
|
||
|
|
<sql id="selectSql">
|
||
|
|
select
|
||
|
|
le.id,
|
||
|
|
le.conf_id,
|
||
|
|
le.job_id,
|
||
|
|
le.status,
|
||
|
|
le.begin_time,
|
||
|
|
le.end_time,
|
||
|
|
le.id as exec_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.start_lon,
|
||
|
|
l.start_lat,
|
||
|
|
l.start_height,
|
||
|
|
l.end_lon,
|
||
|
|
l.end_lat,
|
||
|
|
l.end_height,
|
||
|
|
l.distance
|
||
|
|
from jm_airline_exec le
|
||
|
|
left join jm_airline l on l.id = le.conf_id
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectByJobExec" resultType="com.zhangy.skyeye.jm.entity.JmAirline">
|
||
|
|
<include refid="selectSql"/>
|
||
|
|
where le.job_id in
|
||
|
|
<foreach item="item" collection="array" open="(" separator="," close=")">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
order by l.job_id, le.begin_time desc, l.uav_id, l.flight_no
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectByJobConf" 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, le.begin_time desc, l.uav_id, l.flight_no
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectByUav" resultType="com.zhangy.skyeye.jm.entity.JmAirline">
|
||
|
|
<include refid="selectSql"/>
|
||
|
|
where 1 = 1
|
||
|
|
<choose>
|
||
|
|
<when test="jobConfId != null">and l.job_id = #{jobConfId}</when>
|
||
|
|
<otherwise>and le.job_id = #{jobExecId}</otherwise>
|
||
|
|
</choose>
|
||
|
|
<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, le.begin_time desc, l.uav_id, l.flight_no
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectById" resultType="com.zhangy.skyeye.jm.entity.JmAirline">
|
||
|
|
<include refid="selectSql"/>
|
||
|
|
where le.id in
|
||
|
|
<foreach item="item" collection="array" open="(" separator="," close=")">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
order by l.job_id, le.begin_time desc, l.uav_id, l.flight_no
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectByConf" resultType="com.zhangy.skyeye.jm.entity.JmAirline">
|
||
|
|
<include refid="selectSql"/>
|
||
|
|
where le.conf_id in
|
||
|
|
<foreach item="item" collection="array" open="(" separator="," close=")">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
order by le.begin_time desc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insert" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||
|
|
insert into jm_airline_exec(
|
||
|
|
id,
|
||
|
|
job_id,
|
||
|
|
conf_id,
|
||
|
|
status,
|
||
|
|
begin_time,
|
||
|
|
end_time
|
||
|
|
) values
|
||
|
|
<foreach item="item" index="index" collection="array" separator=",">
|
||
|
|
(
|
||
|
|
#{item.id},
|
||
|
|
#{item.jobId},
|
||
|
|
#{item.confId},
|
||
|
|
#{item.status},
|
||
|
|
#{item.beginTime},
|
||
|
|
#{item.endTime}
|
||
|
|
)
|
||
|
|
</foreach>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateNotNull">
|
||
|
|
update jm_airline_exec
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="jobId != null">job_id = #{jobId},</if>
|
||
|
|
<if test="confId != null">conf_id = #{confId},</if>
|
||
|
|
<if test="status != null">status = #{status},</if>
|
||
|
|
<if test="beginTime != null">begin_time = #{beginTime},</if>
|
||
|
|
<if test="endTime != null">end_time = #{endTime},</if>
|
||
|
|
</trim>
|
||
|
|
where id = #{id}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="delete">
|
||
|
|
delete from jm_airline_exec where id in
|
||
|
|
<foreach item="item" collection="array" open="(" separator="," close=")">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteByJob">
|
||
|
|
delete from jm_airline_exec where job_id in
|
||
|
|
<foreach item="item" collection="array" open="(" separator="," close=")">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteByUav">
|
||
|
|
delete from jm_airline_exec
|
||
|
|
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>
|