feat: 航线解析以及websocket订阅不关闭bug修复
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
<?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.central.device.mapper.WaylineRouteMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.central.device.entity.WaylineRoute">
|
||||
<id column="id" property="id" />
|
||||
<result column="route_id" property="routeId" />
|
||||
<result column="route_name" property="routeName" />
|
||||
<result column="file_wayline_id" property="fileWaylineId" />
|
||||
<result column="device_sn" property="deviceSn" />
|
||||
<result column="device_name" property="deviceName" />
|
||||
<result column="parse_status" property="parseStatus" />
|
||||
<result column="parse_error" property="parseError" />
|
||||
<result column="waypoint_count" property="waypointCount" />
|
||||
<result column="action_count" property="actionCount" />
|
||||
<result column="total_distance" property="totalDistance" />
|
||||
<result column="total_duration" property="totalDuration" />
|
||||
<result column="auto_flight_speed" property="autoFlightSpeed" />
|
||||
<result column="take_off_point" property="takeOffPoint" />
|
||||
<result column="finish_action" property="finishAction" />
|
||||
<result column="exit_on_rc_lost" property="exitOnRcLost" />
|
||||
<result column="global_rth_height" property="globalRthHeight" />
|
||||
<result column="coordinate_mode" property="coordinateMode" />
|
||||
<result column="height_mode" property="heightMode" />
|
||||
<result column="status" property="status" />
|
||||
<result column="remark" property="remark" />
|
||||
<result column="workspace_id" property="workspaceId" />
|
||||
<result column="tenant_id" property="tenantId" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 根据航迹文件ID查询航线任务列表 -->
|
||||
<select id="selectByFileWaylineId" resultMap="BaseResultMap">
|
||||
SELECT * FROM wayline_route
|
||||
WHERE file_wayline_id = #{fileWaylineId}
|
||||
AND status = 1
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据设备SN查询绑定的航线任务列表 -->
|
||||
<select id="selectByDeviceSn" resultMap="BaseResultMap">
|
||||
SELECT * FROM wayline_route
|
||||
WHERE device_sn = #{deviceSn}
|
||||
AND status = 1
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据航线任务ID查询 -->
|
||||
<select id="selectByRouteId" resultMap="BaseResultMap">
|
||||
SELECT * FROM wayline_route
|
||||
WHERE route_id = #{routeId}
|
||||
</select>
|
||||
|
||||
<!-- 更新解析状态 -->
|
||||
<update id="updateParseStatus">
|
||||
UPDATE wayline_route
|
||||
SET parse_status = #{parseStatus},
|
||||
update_time = NOW()
|
||||
WHERE route_id = #{routeId}
|
||||
</update>
|
||||
|
||||
<!-- 更新解析状态和错误信息 -->
|
||||
<update id="updateParseStatusWithError">
|
||||
UPDATE wayline_route
|
||||
SET parse_status = #{parseStatus},
|
||||
parse_error = #{parseError},
|
||||
update_time = NOW()
|
||||
WHERE route_id = #{routeId}
|
||||
</update>
|
||||
|
||||
<!-- 更新航线任务统计信息 -->
|
||||
<update id="updateRouteStats">
|
||||
UPDATE wayline_route
|
||||
SET waypoint_count = #{waypointCount},
|
||||
action_count = #{actionCount},
|
||||
total_distance = #{totalDistance},
|
||||
total_duration = #{totalDuration},
|
||||
auto_flight_speed = #{autoFlightSpeed},
|
||||
update_time = NOW()
|
||||
WHERE route_id = #{routeId}
|
||||
</update>
|
||||
|
||||
<!-- 根据设备SN和航迹文件ID查询航线任务 -->
|
||||
<select id="selectByDeviceSnAndFileWaylineId" resultMap="BaseResultMap">
|
||||
SELECT * FROM wayline_route
|
||||
WHERE device_sn = #{deviceSn}
|
||||
AND file_wayline_id = #{waylineId}
|
||||
AND status = 1
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 删除设备与航迹文件的绑定(级联删除相关数据) -->
|
||||
<delete id="deleteBindingByDeviceAndWayline">
|
||||
DELETE FROM wayline_route
|
||||
WHERE device_sn = #{deviceSn}
|
||||
AND file_wayline_id = #{waylineId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user