<?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.css.simulation.resource.server.infra.db.mysql.mapper.SceneGeneralExampleMapper">

    <insert id="saveSceneGeneralExampleAll" parameterType="java.util.List">

        insert into simulation.scene_general_example
        (id,scene_id,scenario_name,scenario_weather,scenario_time,
        scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
        ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
        ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
        obs_lateral_acceleration,obs_longitudinal_acceleration,
        obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
        obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
        video_link,file_name,template_id,sublist_id,
        create_user_id,create_time,modify_time,
        is_deleted,obs_type) values
        <foreach collection="list" index="index" item="item" separator=",">
            (#{item.id,jdbcType=VARCHAR},#{item.sceneId,jdbcType=VARCHAR},#{item.scenarioName,jdbcType=VARCHAR},#{item.scenarioWeather,jdbcType=VARCHAR},#{item.scenarioTime,jdbcType=VARCHAR},
            #{item.scenarioVehicleModel,jdbcType=VARCHAR}, #{item.scenarioRoadType,jdbcType=VARCHAR}, #{item.scenarioRadiusCurvature,jdbcType=VARCHAR},#{item.egoStartX,jdbcType=VARCHAR}, #{item.egoStartY,jdbcType=VARCHAR},
            #{item.egoStartVelocity,jdbcType=VARCHAR}, #{item.egoHeadingAngle,jdbcType=VARCHAR},#{item.egoVelocityStatus,jdbcType=VARCHAR},#{item.egoTrajectory,jdbcType=VARCHAR},#{item.egoDurationTime,jdbcType=VARCHAR},
            #{item.egoVelocityTime,jdbcType=VARCHAR}, #{item.egoTrajectoryTime,jdbcType=VARCHAR},#{item.obsStartX,jdbcType=VARCHAR},#{item.obsStartY,jdbcType=VARCHAR},#{item.obsStartVelocity,jdbcType=VARCHAR},
            #{item.obsLateralAcceleration,jdbcType=VARCHAR}, #{item.obsLongitudinalAcceleration,jdbcType=VARCHAR},
            #{item.obsHeadingAngleRel,jdbcType=VARCHAR}, #{item.obsVelocityStatus,jdbcType=VARCHAR},#{item.obsTrajectory,jdbcType=VARCHAR},#{item.obsDurationTime,jdbcType=VARCHAR},#{item.obsVelocityTime,jdbcType=VARCHAR},
            #{item.obsTrailTime,jdbcType=VARCHAR}, #{item.generalizationType,jdbcType=VARCHAR},#{item.scenarioResume,jdbcType=VARCHAR},#{item.sceneDetailedDescription},#{item.evaluatingIndicator,jdbcType=VARCHAR},
            #{item.videoLink},#{item.fileName},#{item.templateId},#{item.sublistId},

            #{item.createUserId,jdbcType=VARCHAR},#{item.createTime},#{item.modifyTime},
            #{item.isDeleted,jdbcType=VARCHAR},#{item.obsType})
        </foreach>
    </insert>

    <insert id="saveSceneGeneralExample" parameterType="api.common.pojo.po.scene.SceneGeneralExamplePO">

        insert into simulation.scene_general_example
        (id,scene_id,scenario_name,scenario_weather,scenario_time,
        scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
        ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
        ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
        obs_lateral_acceleration,obs_longitudinal_acceleration,
        obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
        obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
        video_link,file_name,template_id,sublist_id,
        create_user_id,create_time,modify_time,
        is_deleted,obs_type) values
          (#{id,jdbcType=VARCHAR},#{sceneId,jdbcType=VARCHAR},#{scenarioName,jdbcType=VARCHAR},#{scenarioWeather,jdbcType=VARCHAR},#{scenarioTime,jdbcType=VARCHAR},
            #{scenarioVehicleModel,jdbcType=VARCHAR}, #{scenarioRoadType,jdbcType=VARCHAR}, #{scenarioRadiusCurvature,jdbcType=VARCHAR},#{egoStartX,jdbcType=VARCHAR}, #{egoStartY,jdbcType=VARCHAR},
            #{egoStartVelocity,jdbcType=VARCHAR}, #{egoHeadingAngle,jdbcType=VARCHAR},#{egoVelocityStatus,jdbcType=VARCHAR},#{egoTrajectory,jdbcType=VARCHAR},#{egoDurationTime,jdbcType=VARCHAR},
            #{egoVelocityTime,jdbcType=VARCHAR}, #{egoTrajectoryTime,jdbcType=VARCHAR},#{obsStartX,jdbcType=VARCHAR},#{obsStartY,jdbcType=VARCHAR},#{obsStartVelocity,jdbcType=VARCHAR},
            #{obsLateralAcceleration,jdbcType=VARCHAR}, #{obsLongitudinalAcceleration,jdbcType=VARCHAR},
            #{obsHeadingAngleRel,jdbcType=VARCHAR}, #{obsVelocityStatus,jdbcType=VARCHAR},#{obsTrajectory,jdbcType=VARCHAR},#{obsDurationTime,jdbcType=VARCHAR},#{obsVelocityTime,jdbcType=VARCHAR},
            #{obsTrailTime,jdbcType=VARCHAR}, #{generalizationType,jdbcType=VARCHAR},#{scenarioResume,jdbcType=VARCHAR},#{sceneDetailedDescription},#{evaluatingIndicator,jdbcType=VARCHAR},
            #{videoLink},#{fileName},#{templateId},#{sublistId},

            #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyTime},
            #{isDeleted,jdbcType=VARCHAR},#{obsType})
    </insert>


    <select id="querySceneGeneralExampleById" parameterType="java.lang.String"
            resultType="api.common.pojo.po.scene.SceneGeneralExamplePO">
        select
        id,scene_id,scenario_name,scenario_weather,scenario_time,
        scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
        ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
        ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
        obs_lateral_acceleration,obs_longitudinal_acceleration,
        obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
        obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
        video_link,file_name,template_id,sublist_id,
        create_user_id,create_time,modify_time,obs_type
        from simulation.scene_general_example
        where id =#{id,jdbcType=VARCHAR}
    </select>


</mapper>
