123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471 |
- <?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.scene.mapper.SceneAccidentMapper">
- <insert id="saveSceneAccident" parameterType="api.common.pojo.po.scene.SceneAccidentPO">
- insert into simulation.scene_accident
- (accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_preview,video_address,osgb_address,xml_address,xodr_address,
- json_address,max_time)
- values (#{accidentId,jdbcType=VARCHAR},#{sceneName,jdbcType=VARCHAR},#{selfDriving,jdbcType=VARCHAR}, #{targetDriving,jdbcType=VARCHAR},
- #{selfReaction,jdbcType=VARCHAR}, #{conflictBehavior,jdbcType=VARCHAR},#{conflictType,jdbcType=VARCHAR},
- #{scenceResume,jdbcType=VARCHAR}, #{sceneTime,jdbcType=VARCHAR},#{sceneWeather,jdbcType=VARCHAR},
- #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
- #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR},#{videoPreview,jdbcType=VARCHAR},#{videoAddress,jdbcType=VARCHAR},#{osgbAddress,jdbcType=VARCHAR},
- #{xmlAddress,jdbcType=VARCHAR}, #{xodrAddress,jdbcType=VARCHAR},#{jsonAddress,jdbcType=VARCHAR},#{maxTime,jdbcType=VARCHAR})
- </insert>
- <insert id="saveSceneAccidentList" parameterType="java.util.List">
- insert into simulation.scene_accident
- (accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_preview,video_address,osgb_address,xml_address,xodr_address,
- json_address,max_time)
- values
- <foreach collection="list" index="index" item="item" separator=",">
- (#{item.accidentId,jdbcType=VARCHAR},#{item.sceneName,jdbcType=VARCHAR},#{item.selfDriving,jdbcType=VARCHAR}, #{item.targetDriving,jdbcType=VARCHAR},
- #{item.selfReaction,jdbcType=VARCHAR}, #{item.conflictBehavior,jdbcType=VARCHAR},#{item.conflictType,jdbcType=VARCHAR},
- #{item.scenceResume,jdbcType=VARCHAR}, #{item.sceneTime,jdbcType=VARCHAR},#{item.sceneWeather,jdbcType=VARCHAR},
- #{item.createUserId,jdbcType=VARCHAR},#{item.createTime},#{item.modifyUserId,jdbcType=VARCHAR},#{item.modifyTime},
- #{item.isDeleted,jdbcType=VARCHAR}, #{item.share,jdbcType=VARCHAR},#{item.videoPreview,jdbcType=VARCHAR},#{item.videoAddress,jdbcType=VARCHAR},#{item.osgbAddress,jdbcType=VARCHAR},
- #{item.xmlAddress,jdbcType=VARCHAR}, #{item.xodrAddress,jdbcType=VARCHAR},#{item.jsonAddress,jdbcType=VARCHAR},#{item.maxTime,jdbcType=VARCHAR})
- </foreach>
- </insert>
- <select id="querySceneAccidentList" parameterType="api.common.pojo.param.scene.SceneAccidentParam"
- resultType="api.common.pojo.po.scene.SceneAccidentPO">
- select
- accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
- json_address,max_time
- from(
- select
- accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
- json_address,max_time
- from simulation.scene_accident
- <where>
- <if test="sceneName != null and sceneName != ''">
- and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
- </if>
- <if test="selfDriving != null and selfDriving.size()>0 ">
- and self_driving in
- <foreach collection="selfDriving" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="targetDriving != null and targetDriving.size()>0">
- and target_driving in
- <foreach collection="targetDriving" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="selfReaction != null and selfReaction.size()>0">
- and self_reaction in
- <foreach collection="selfReaction" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="conflictBehavior != null and conflictBehavior.size()>0">
- and conflict_behavior in
- <foreach collection="conflictBehavior" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="conflictType != null and conflictType.size()>0">
- and conflict_type in
- <foreach collection="conflictType" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="ids != null and ids.length>0">
- and accident_id in
- <foreach collection="ids" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- </where>
- <if test="bq != null and bq.equals(1)">
- union
- select
- accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
- json_address,max_time
- from simulation.scene_accident
- <where>
- <if test="rearEndCollision != null and rearEndCollision!=''">
- or conflict_behavior =#{rearEndCollision}
- </if>
- <if test="cutIn != null and cutIn!=''">
- or target_driving =#{cutIn}
- </if>
- <if test="driveCurve != null and driveCurve!=''">
- or target_driving =#{driveCurve}
- </if>
- <if test="carConflict != null and carConflict!=''">
- or conflict_type =#{carConflict}
- </if>
- </where>
- </if>
- ) a where
- a.is_deleted = '0'
- <if test="AllIds != null and AllIds.size()>0">
- and a.accident_id in
- <foreach collection="AllIds" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- order by a.modify_time desc
- </select>
- <select id="querySceneAccidentListByBq" parameterType="api.common.pojo.param.scene.SceneAccidentParam"
- resultType="api.common.pojo.po.scene.SceneAccidentPO">
- select
- accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
- json_address,max_time
- from( select
- accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
- json_address,max_time
- from simulation.scene_accident
- <where>
- <if test="rearEndCollision != null and rearEndCollision!=''">
- conflict_behavior =#{rearEndCollision}
- </if>
- <if test="cutIn != null and cutIn!=''">
- or target_driving =#{cutIn}
- </if>
- <if test="driveCurve != null and driveCurve!=''">
- or target_driving =#{driveCurve}
- </if>
- <if test="carConflict != null and carConflict!=''">
- or conflict_type =#{carConflict}
- </if>
- </where>
- ) a where a.is_deleted = '0'
- <if test="AllIds != null and AllIds.size()>0">
- and a.accident_id in
- <foreach collection="AllIds" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- order by a.modify_time desc
- </select>
- <select id="querySceneAccidentListByXlk" parameterType="api.common.pojo.param.scene.SceneAccidentParam"
- resultType="api.common.pojo.po.scene.SceneAccidentPO">
- select
- accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
- json_address,max_time
- from simulation.scene_accident
- <where>
- is_deleted = '0'
- <if test="sceneName != null and sceneName != ''">
- and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
- </if>
- <if test="selfDriving != null and selfDriving.size()>0 ">
- and self_driving in
- <foreach collection="selfDriving" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="targetDriving != null and targetDriving.size()>0">
- and target_driving in
- <foreach collection="targetDriving" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="selfReaction != null and selfReaction.size()>0">
- and self_reaction in
- <foreach collection="selfReaction" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="conflictBehavior != null and conflictBehavior.size()>0">
- and conflict_behavior in
- <foreach collection="conflictBehavior" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="conflictType != null and conflictType.size()>0">
- and conflict_type in
- <foreach collection="conflictType" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="ids != null and ids.length>0">
- and accident_id in
- <foreach collection="ids" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="AllIds != null and AllIds.size()>0">
- and accident_id in
- <foreach collection="AllIds" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- </where>
- order by modify_time desc
- </select>
- <update id="deleteSceneAccidentList" parameterType="api.common.pojo.po.scene.SceneAccidentPO">
- update simulation.scene_accident
- <set>
- <if test="isDeleted != null and isDeleted!=''">
- is_deleted = #{isDeleted,jdbcType=VARCHAR},
- </if>
- <if test="modifyUserId != null and modifyUserId!=''">
- modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
- </if>
- <if test="modifyTime != null">
- modify_time = #{modifyTime},
- </if>
- </set>
- where accident_id = #{accidentId,jdbcType=VARCHAR}
- </update>
- <select id="querySceneAccidentByNmae" parameterType="java.lang.String" resultType="java.lang.String">
- select
- accident_id sceneId
- from simulation.scene_accident
- where
- is_deleted = '0'
- and scene_name =#{sceneName,jdbcType=VARCHAR}
- </select>
- <update id="updateSceneAccident" parameterType="api.common.pojo.po.scene.SceneAccidentPO">
- update simulation.scene_accident
- set scene_name=#{sceneName},self_driving=#{selfDriving},
- target_driving=#{targetDriving},self_reaction=#{selfReaction},
- conflict_behavior=#{conflictBehavior},conflict_type=#{conflictType},
- scence_resume=#{scenceResume},scene_time=#{sceneTime},
- scene_weather=#{sceneWeather},modify_time=#{modifyTime},
- modify_user_id=#{modifyUserId},video_address=#{videoAddress},
- osgb_address=#{osgbAddress},xml_address=#{xmlAddress},
- xodr_address=#{xodrAddress},json_address=#{jsonAddress},max_time=#{maxTime}
- where accident_id = #{accidentId,jdbcType=VARCHAR}
- </update>
- <update id="updateSceneAccidentList" parameterType="java.util.List">
- <foreach collection="list" index="index" item="item" separator=";">
- update simulation.scene_accident
- set scene_name=#{item.sceneName},self_driving=#{item.selfDriving},
- target_driving=#{item.targetDriving},self_reaction=#{item.selfReaction},
- conflict_behavior=#{item.conflictBehavior},conflict_type=#{item.conflictType},
- scence_resume=#{item.scenceResume},scene_time=#{item.sceneTime},
- scene_weather=#{item.sceneWeather},modify_time=#{item.modifyTime},
- modify_user_id=#{item.modifyUserId},video_address=#{item.videoAddress},
- osgb_address=#{item.osgbAddress},xml_address=#{item.xmlAddress},
- xodr_address=#{item.xodrAddress},json_address=#{item.jsonAddress},max_time=#{item.maxTime}
- where accident_id = #{item.accidentId,jdbcType=VARCHAR}
- </foreach>
- </update>
- <select id="querySceneAccidentListByQx" parameterType="api.common.pojo.param.scene.SceneAccidentParam"
- resultType="api.common.pojo.po.scene.SceneAccidentPO">
- select
- accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
- json_address,max_time
- from(
- select
- accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
- json_address,max_time
- from ( select jt.* from( select s.scene_name
- FROM system_scene_package p
- JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
- JOIN system_scene_package_sublist s on p.id = s.scene_and_package
- where scene_type='3' and s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_accident jt on qx.scene_name=jt.scene_name) cc
- <where>
- <if test="sceneName != null and sceneName != ''">
- and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
- </if>
- <if test="selfDriving != null and selfDriving.size()>0 ">
- and self_driving in
- <foreach collection="selfDriving" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="targetDriving != null and targetDriving.size()>0">
- and target_driving in
- <foreach collection="targetDriving" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="selfReaction != null and selfReaction.size()>0">
- and self_reaction in
- <foreach collection="selfReaction" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="conflictBehavior != null and conflictBehavior.size()>0">
- and conflict_behavior in
- <foreach collection="conflictBehavior" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="conflictType != null and conflictType.size()>0">
- and conflict_type in
- <foreach collection="conflictType" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="ids != null and ids.length>0">
- and accident_id in
- <foreach collection="ids" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- </where>
- <if test="bq != null and bq.equals(1)">
- union
- select
- accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
- json_address,max_time
- from ( select jt.* from( select s.scene_name
- FROM system_scene_package p
- JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
- JOIN system_scene_package_sublist s on p.id = s.scene_and_package
- where scene_type='3' and s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_accident jt on qx.scene_name=jt.scene_name) dd
- <where>
- <if test="rearEndCollision != null and rearEndCollision!=''">
- or conflict_behavior =#{rearEndCollision}
- </if>
- <if test="cutIn != null and cutIn!=''">
- or target_driving =#{cutIn}
- </if>
- <if test="driveCurve != null and driveCurve!=''">
- or target_driving =#{driveCurve}
- </if>
- <if test="carConflict != null and carConflict!=''">
- or conflict_type =#{carConflict}
- </if>
- </where>
- </if>
- ) a where
- a.is_deleted = '0'
- <if test="AllIds != null and AllIds.size()>0">
- and a.accident_id in
- <foreach collection="AllIds" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- order by a.modify_time desc
- </select>
- <select id="querySceneAccidentListByBqAndQx" parameterType="api.common.pojo.param.scene.SceneAccidentParam"
- resultType="api.common.pojo.po.scene.SceneAccidentPO">
- select
- accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
- json_address,max_time
- from( select
- accident_id,scene_name,self_driving,target_driving,
- self_reaction,conflict_behavior,conflict_type,
- scence_resume,scene_time,scene_weather,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
- json_address,max_time
- from ( select jt.* from( select s.scene_name
- FROM system_scene_package p
- JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
- JOIN system_scene_package_sublist s on p.id = s.scene_and_package
- where scene_type='3' and s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_accident jt on qx.scene_name=jt.scene_name) dd
- <where>
- <if test="rearEndCollision != null and rearEndCollision!=''">
- conflict_behavior =#{rearEndCollision}
- </if>
- <if test="cutIn != null and cutIn!=''">
- or target_driving =#{cutIn}
- </if>
- <if test="driveCurve != null and driveCurve!=''">
- or target_driving =#{driveCurve}
- </if>
- <if test="carConflict != null and carConflict!=''">
- or conflict_type =#{carConflict}
- </if>
- </where>
- ) a where a.is_deleted = '0'
- <if test="AllIds != null and AllIds.size()>0">
- and a.accident_id in
- <foreach collection="AllIds" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- order by a.modify_time desc
- </select>
- </mapper>
|