123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- <?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.SceneReferenceLibMapper">
- <insert id="saveSceneReference" parameterType="api.common.pojo.po.scene.SceneReferenceLibPO">
- insert into simulation.scene_reference_lib
- (scene_id, scene_name, main_behavior, other_behavior, weather,road_type,road_geometry_plane,road_geometry_vertical,
- auto_drive_function, operation_area,scene_description,label,
- create_user_id, create_time, modify_user_id, modify_time,
- is_deleted, video_preview, video_address, osgb_address, xml_address, xodr_address,
- json_address, max_time)
- values (#{sceneId,jdbcType=VARCHAR},#{sceneName,jdbcType=VARCHAR}, #{mainBehavior,jdbcType=VARCHAR}, #{otherBehavior,jdbcType=VARCHAR},
- #{weather,jdbcType=VARCHAR}, #{roadType,jdbcType=VARCHAR}, #{roadGeometryPlane,jdbcType=VARCHAR}, #{roadGeometryVertical,jdbcType=VARCHAR},
- #{autoDriveFunction,jdbcType=VARCHAR}, #{operationArea,jdbcType=VARCHAR}, #{sceneDescription,jdbcType=VARCHAR}, #{label,jdbcType=VARCHAR},
- #{createUserId,jdbcType=VARCHAR}, #{createTime}, #{modifyUserId,jdbcType=VARCHAR}, #{modifyTime},
- #{isDeleted,jdbcType=VARCHAR}, #{videoPreview,jdbcType=VARCHAR},
- #{videoAddress,jdbcType=VARCHAR}, #{osgbAddress,jdbcType=VARCHAR},
- #{xmlAddress,jdbcType=VARCHAR}, #{xodrAddress,jdbcType=VARCHAR}, #{jsonAddress,jdbcType=VARCHAR},
- #{maxTime,jdbcType=VARCHAR})
- </insert>
- <select id="selectAllByName" parameterType="api.common.pojo.po.scene.SceneReferenceLibPO"
- resultType="api.common.pojo.po.scene.SceneReferenceLibPO">
- select scene_id,
- scene_name,
- main_behavior,
- other_behavior,
- create_user_id,
- create_time,
- modify_user_id,
- modify_time,
- is_deleted,
- video_preview,
- video_address,
- osgb_address,
- xml_address,
- xodr_address,
- json_address,
- max_time
- from simulation.scene_reference_lib
- where is_deleted = '0'
- and scene_name = #{sceneName,jdbcType=VARCHAR}
- </select>
- <update id="updateSceneReference" parameterType="api.common.pojo.po.scene.SceneReferenceLibPO">
- update simulation.scene_reference_lib
- set scene_name=#{sceneName},
- main_behavior=#{mainBehavior},
- other_behavior=#{otherBehavior},
- weather=#{weather},
- road_type=#{roadType},
- road_geometry_plane=#{roadGeometryPlane},
- road_geometry_vertical=#{roadGeometryVertical},
- auto_drive_function=#{autoDriveFunction},
- operation_area=#{operationArea},
- scene_description=#{sceneDescription},
- label=#{label},
- modify_user_id=#{modifyUserId},
- modify_time=#{modifyTime},
- video_address=#{videoAddress},
- osgb_address=#{osgbAddress},
- xml_address=#{xmlAddress},
- xodr_address=#{xodrAddress},
- json_address=#{jsonAddress},
- video_preview=#{videoPreview},
- max_time=#{maxTime}
- where scene_id = #{sceneId,jdbcType=VARCHAR}
- </update>
- <select id="querySceneReferenceLibList" parameterType="api.common.pojo.param.scene.SceneReferenceLibParam"
- resultType="api.common.pojo.po.scene.SceneReferenceLibPO">
- SELECT
- scene_id,
- scene_name,
- main_behavior,
- other_behavior,
- weather,
- road_type,
- road_geometry_plane,
- road_geometry_vertical,
- auto_drive_function,
- operation_area,
- scene_description,
- label,
- create_time,
- modify_user_id,
- modify_time,
- video_preview,
- video_address,
- osgb_address,
- xml_address,
- xodr_address,
- json_address,
- max_time
- FROM simulation.scene_reference_lib
- <where>
- is_deleted = '0'
- <if test="ids != null and ids.length>0">
- and scene_id in
- <foreach collection="ids" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="names != null and names.length>0">
- and scene_name in
- <foreach collection="names" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="sceneName != null and sceneName != ''">
- AND scene_name LIKE CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
- </if>
- <if test="sceneDescription != null and sceneDescription != ''">
- AND scene_description LIKE CONCAT('%',#{sceneDescription,jdbcType=VARCHAR},'%')
- </if>
- <if test="label != null and label != ''">
- AND label LIKE CONCAT('%',#{label,jdbcType=VARCHAR},'%')
- </if>
- <if test="mainBehavior != null and mainBehavior.size()>0">
- AND
- <foreach collection="mainBehavior" item="item" index="index"
- separator=" or " open="(" close=")">
- main_behavior LIKE CONCAT('%,',#{item},',%')
- OR main_behavior LIKE CONCAT('%,',#{item}) OR
- main_behavior LIKE CONCAT(#{item},',%') OR
- main_behavior=#{item}
- </foreach>
- </if>
- <if test="otherBehavior != null and otherBehavior.size()>0">
- and
- <foreach collection="otherBehavior" item="item" index="index"
- separator=" or " open="(" close=")">
- other_behavior LIKE CONCAT('%,',#{item},',%')
- OR other_behavior LIKE CONCAT('%,',#{item}) OR
- other_behavior LIKE CONCAT(#{item},',%') OR
- other_behavior=#{item}
- </foreach>
- </if>
- <if test="weather != null and weather.size()>0 ">
- AND weather IN
- <foreach collection="weather" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="roadType != null and roadType.size()>0">
- AND road_type IN
- <foreach collection="roadType" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="roadGeometryPlane != null and roadGeometryPlane.size()>0">
- AND road_geometry_plane IN
- <foreach collection="roadGeometryPlane" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="roadGeometryVertical != null and roadGeometryVertical.size()>0">
- AND road_geometry_vertical IN
- <foreach collection="roadGeometryVertical" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="autoDriveFunction != null and autoDriveFunction.size()>0">
- AND auto_drive_function IN
- <foreach collection="autoDriveFunction" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="operationArea != null and operationArea.size()>0">
- AND operation_area IN
- <foreach collection="operationArea" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="needComplexity != null and needComplexity != ''">
- and scene_id in (select scene_id from scene_complexity where is_deleted = '0'
- <if test="minComplexity != null and minComplexity != ''">
- AND complexity+0 >= #{minComplexity}
- </if>
- <if test="maxComplexity != null and maxComplexity != ''">
- AND complexity+0 <= #{maxComplexity}
- </if>
- <if test="complexityLevels != null and complexityLevels.size()>0">
- AND complexity_level IN
- <foreach collection="complexityLevels" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- )
- </if>
- <if test="needRisk != null and needRisk != ''">
- and scene_id in (select scene_id from scene_risk where is_deleted = '0'
- <if test="minRisk != null and minRisk != ''">
- AND risk+0 >= #{minRisk}
- </if>
- <if test="maxRisk != null and maxRisk != ''">
- AND risk+0 <= #{maxRisk}
- </if>
- <if test="riskLevels != null and riskLevels.size()>0">
- AND risk_level IN
- <foreach collection="riskLevels" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- )
- </if>
- </where>
- ORDER BY create_time,scene_name DESC
- </select>
- <select id="selectIdsByNames" resultType="java.lang.String">
- select scene_id
- from scene_reference_lib
- where is_deleted = '0'
- and scene_name in
- <foreach item="item" collection="list" separator="," open="(" close=")">
- #{item}
- </foreach>
- </select>
- <update id="deleteBySceneNames">
- update scene_reference_lib
- set is_deleted = '1',
- modify_user_id = #{modifyUserId},
- modify_time = #{modifyTime}
- where is_deleted = '0' and scene_name in
- <foreach item="item" collection="sceneNames" separator="," open="(" close=")">
- #{item}
- </foreach>
- </update>
- </mapper>
|