<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper  PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"  "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.tsy.data.idsse.dsds.mapper.voyage.VoyageNavigationMapper">
 
  <!-- 分页查询 -->
  <select id="navigationWithPage" resultType="map">
	select * from voyage_navigation where 1=1  	
	<if test="voyage_id != null">
      and voyage_id = #{voyage_id} 
    </if>
    <if test="order != null and order != ''">
		ORDER BY ${order} 
	</if>
	<if test="type != null and (type == 'DESC')">
	 	DESC
	</if>
  </select>
  
  <select id="totalNavigation" resultType="map">
  	select max(nav_time) max_time,min(nav_time) min_time,max(nav_lon) max_lon,min(nav_lon) min_lin,max(nav_lat) max_lat,min(nav_lat) min_lat from voyage_navigation where voyage_id=#{voyage_id};
  </select>
  
    <select id="listNavigation" resultType="map">
  	select * from voyage_navigation where VOYAGE_ID=#{voyage_id} and MOD(MINUTE(NAV_TIME),${ticket_minutes})=0 order by nav_time
  	 </select>
</mapper>