package com.css.simulation.resource.monitor.infra.mysql.mapper;

import com.css.simulation.resource.monitor.infra.mysql.entity.GeneralEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface ScenePackageSublistMapper {


    @Select("select scene_generalization_ids\n" +
            "from scene_package_sublist\n" +
            "where scene_generalization_ids is not null\n" +
            "  and scene_generalization_ids != ''")
    List<String> selectSceneGeneralizationIds();

    @Select("<script>" +
            "select id, osgb_address, xodr_address, xosc_address\n" +
            "from scene_general_data\n" +
            "where id in \n" +
            "    <foreach item='item' collection='sceneGeneralizationIdList' separator=',' open='(' close=')'>\n" +
            "      #{item}\n" +
            "    </foreach>" +
            "</script>")
    List<GeneralEntity> selectGeneralDataNotIn(@Param("sceneGeneralizationIdList") List<String> sceneGeneralizationIdList);

    @Delete("delete from scene_general_data where id = #{id}}")
    void deleteById(@Param("id")String id);
}
