package com.css.simulation.resource.server.infra.db.mysql.mapper;

import api.common.pojo.param.map.SimulationMapParam;
import api.common.pojo.param.map.SimulationMapPathParam;
import api.common.pojo.po.map.SimulationMapPO;
import api.common.pojo.po.map.SimulationMapPathPO;
import api.common.pojo.vo.map.SimulationMapPathVO;
import api.common.pojo.vo.map.SimulationMapVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface SimulationMapPathMapper {
    @Insert("insert into simulation_map_path (id,map_id,path_sort,path_detail,path_start_point,path_end_point,start_point_num,end_point_num) values" +
        "(#{id},#{mapId},#{pathSort},#{pathDetail},#{pathStartPoint},#{pathEndPoint},#{startPointNum},#{endPointNum})")
    int addSimulationMap(SimulationMapPathPO simulationMapPathPO);

//    @Select("select id,path_num,map_name,map_description,create_time from simulation_map where id = #{id} and deleted = 0")
//    SimulationMapVO selectMapByMapId(@Param("id") String mapId);
//
//    @Update("update simulation_map set deleted = 1 where id = #{mapId}")
//    int deleteMultiSimulationScene(SimulationMapParam param);
//
//    @Update("update simulation_map set map_path = #{mapPath},map_description = #{mapDescription} where id = #{mapId}")
//    int updateMultiSimulationScene(SimulationMapParam param);


//
//    @Select("<script>" +
//        "select id,project_id,scene_name,map_id,create_time from multi_simulation_scene where deleted = 0 " +
//        "and project_id = #{projectId}" +
//        "order by create_time desc" +
//        "</script>")
//    List<MultiSimulationSceneVO> selectSceneList(MultiSimulationSceneParam param);

    @Select("<script>" +
        "select id,map_id,path_sort,path_detail,path_start_point,path_end_point,start_point_num,end_point_num from simulation_map_path where deleted = 0 and map_id =#{mapId} " +
        "order by path_sort asc" +
        "</script>")
    List<SimulationMapPathVO> selectSimulationMapPathList(SimulationMapPathParam param);

    @Select("<script>" +
        "select id,map_id,path_sort,path_start_point,path_end_point,start_point_num,end_point_num from simulation_map_path where deleted = 0 and id =#{id} " +
        "</script>")
    SimulationMapPathVO selectSimulationMapById(@Param("id") String id);

}
