You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
6.1 KiB

<?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.system.mapper.RouteWaypointsMapper">
<resultMap type="RouteWaypoints" id="RouteWaypointsResult">
<result property="id" column="id" />
<result property="routeId" column="route_id" />
<result property="name" column="name" />
<result property="seq" column="seq" />
<result property="lat" column="lat" />
<result property="lng" column="lng" />
<result property="alt" column="alt" />
<result property="speed" column="speed" />
<result property="startTime" column="start_time" />
<result property="turnAngle" column="turn_angle" />
<result property="pointType" column="point_type" />
<result property="holdParams" column="hold_params" />
<result property="displayStyle" column="display_style" typeHandler="com.ruoyi.system.typehandler.WaypointDisplayStyleTypeHandler" />
</resultMap>
<sql id="selectRouteWaypointsVo">
select id, route_id, name, seq, lat, lng, alt, speed, start_time, turn_angle, point_type, hold_params, display_style from route_waypoints
</sql>
<select id="selectRouteWaypointsList" parameterType="RouteWaypoints" resultMap="RouteWaypointsResult">
<include refid="selectRouteWaypointsVo"/>
<where>
<if test="routeId != null "> and route_id = #{routeId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="seq != null "> and seq = #{seq}</if>
<if test="lat != null "> and lat = #{lat}</if>
<if test="lng != null "> and lng = #{lng}</if>
<if test="alt != null "> and alt = #{alt}</if>
<if test="speed != null "> and speed = #{speed}</if>
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
<if test="turnAngle != null "> and turn_angle = #{turnAngle}</if>
<if test="pointType != null and pointType != ''"> and point_type = #{pointType}</if>
<if test="holdParams != null and holdParams != ''"> and hold_params = #{holdParams}</if>
</where>
order by seq asc
</select>
<select id="selectRouteWaypointsById" parameterType="Long" resultMap="RouteWaypointsResult">
<include refid="selectRouteWaypointsVo"/>
where id = #{id}
</select>
<select id="selectMaxSeqByRouteId" parameterType="Long" resultType="Integer">
select max(seq) from ry.route_waypoints where route_id = #{routeId}
</select>
<update id="incrementSeqFrom">
update route_waypoints set seq = seq + 1 where route_id = #{routeId} and seq &gt;= #{seq}
</update>
<insert id="insertRouteWaypoints" parameterType="RouteWaypoints" useGeneratedKeys="true" keyProperty="id">
insert into route_waypoints
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="routeId != null">route_id,</if>
<if test="name != null">name,</if>
<if test="seq != null">seq,</if>
<if test="lat != null">lat,</if>
<if test="lng != null">lng,</if>
<if test="alt != null">alt,</if>
<if test="speed != null">speed,</if>
<if test="startTime != null and startTime != ''">start_time,</if>
<if test="turnAngle != null">turn_angle,</if>
<if test="pointType != null and pointType != ''">point_type,</if>
<if test="holdParams != null">hold_params,</if>
<if test="displayStyle != null">display_style,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="routeId != null">#{routeId},</if>
<if test="name != null">#{name},</if>
<if test="seq != null">#{seq},</if>
<if test="lat != null">#{lat},</if>
<if test="lng != null">#{lng},</if>
<if test="alt != null">#{alt},</if>
<if test="speed != null">#{speed},</if>
<if test="startTime != null and startTime != ''">#{startTime},</if>
<if test="turnAngle != null">#{turnAngle},</if>
<if test="pointType != null and pointType != ''">#{pointType},</if>
<if test="holdParams != null">#{holdParams},</if>
<if test="displayStyle != null">#{displayStyle, typeHandler=com.ruoyi.system.typehandler.WaypointDisplayStyleTypeHandler},</if>
</trim>
</insert>
<update id="updateRouteWaypoints" parameterType="RouteWaypoints">
update route_waypoints
<trim prefix="SET" suffixOverrides=",">
<if test="routeId != null">route_id = #{routeId},</if>
<if test="name != null">name = #{name},</if>
<if test="seq != null">seq = #{seq},</if>
<if test="lat != null">lat = #{lat},</if>
<if test="lng != null">lng = #{lng},</if>
<if test="alt != null">alt = #{alt},</if>
<if test="speed != null">speed = #{speed},</if>
<if test="startTime != null and startTime != ''">start_time = #{startTime},</if>
<if test="turnAngle != null">turn_angle = #{turnAngle},</if>
<if test="pointType != null">point_type = #{pointType},</if>
<if test="holdParams != null">hold_params = #{holdParams},</if>
<if test="displayStyle != null">display_style = #{displayStyle, typeHandler=com.ruoyi.system.typehandler.WaypointDisplayStyleTypeHandler},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRouteWaypointsById" parameterType="Long">
delete from route_waypoints where id = #{id}
</delete>
<delete id="deleteRouteWaypointsByRouteId" parameterType="Long">
delete from route_waypoints where route_id = #{routeId}
</delete>
<delete id="deleteRouteWaypointsByIds" parameterType="String">
delete from route_waypoints where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>