123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?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,
- 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)
- values (#{accidentId,jdbcType=VARCHAR},#{sceneName,jdbcType=VARCHAR},#{selfDriving,jdbcType=VARCHAR}, #{targetDriving,jdbcType=VARCHAR},
- #{selfReaction,jdbcType=VARCHAR}, #{conflictBehavior,jdbcType=VARCHAR},#{conflictType,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})
- </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,
- 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
- 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.length != 0 ">
- and self_driving in
- <foreach collection="selfDriving" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="targetDriving != null and targetDriving.length != 0">
- and target_driving in
- <foreach collection="targetDriving" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="selfReaction != null and selfReaction.length != 0">
- and self_reaction in
- <foreach collection="selfReaction" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="conflictBehavior != null and conflictBehavior.length != 0">
- and conflict_behavior in
- <foreach collection="conflictBehavior" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="conflictType != null and conflictType.length != 0">
- and conflict_type in
- <foreach collection="conflictType" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- order by create_time desc
- </where>
- </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="api.common.pojo.param.scene.SceneAccidentParam" resultType="api.common.pojo.po.scene.SceneAccidentPO">
- select
- accident_id,scene_name
- from simulation.scene_accident
- <where>
- is_deleted = '0'
- <if test="sceneName != null and sceneName != ''">
- and scene_name =#{sceneName,jdbcType=VARCHAR}
- </if>
- </where>
- </select>
- </mapper>
|