123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297 |
- <?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.StandardsRegulationsMapper">
- <insert id="saveStandardsRegulations" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO">
- insert into simulation.scene_standards_regulations
- (regulations_id, scene_name, regulation_type, standard_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, max_time)
- values (#{regulationsId,jdbcType=VARCHAR}, #{sceneName,jdbcType=VARCHAR}, #{regulationType,jdbcType=VARCHAR},
- #{standardType,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="saveStandardsRegulationsList" parameterType="java.util.List">
- insert into simulation.scene_standards_regulations
- (regulations_id,scene_name,regulation_type,standard_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,max_time)
- values
- <foreach collection="list" index="index" item="item" separator=",">
- (#{item.regulationsId,jdbcType=VARCHAR},#{item.sceneName,jdbcType=VARCHAR},#{item.regulationType,jdbcType=VARCHAR},
- #{item.standardType,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="queryStandardsRegulationsList" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
- resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
- select
- regulations_id,scene_name,regulation_type,standard_type,
- create_user_id,create_time,modify_user_id,
- modify_time,is_deleted,share,video_address,osgb_address,
- xml_address,xodr_address,json_address,video_preview,max_time
- from simulation.scene_standards_regulations
- <where>
- is_deleted = '0'
- <if test="sceneName != null and sceneName != ''">
- and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
- </if>
- <if test="regulationType != null and regulationType.size()>0">
- and regulation_type in
- <foreach collection="regulationType" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="standardType != null and standardType != ''">
- and standard_type like CONCAT('%',#{standardType,jdbcType=VARCHAR},'%')
- </if>
- <if test="ids != null and ids.length>0">
- and regulations_id in
- <foreach collection="ids" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="allSceneNames != null and allSceneNames.length>0">
- and scene_name in
- <foreach collection="allSceneNames" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="AllIds != null and AllIds.size()>0">
- and regulations_id in
- <foreach collection="AllIds" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="share != null and share==0">
- and share =#{share}
- </if>
- <if test="share != null and share==1">
- and share !='0'
- </if>
- <if test="userId != null and userId != ''">
- and create_user_id =#{userId}
- </if>
- </where>
- order by modify_time desc
- </select>
- <select id="queryStandardsRegulationsListByBq" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
- resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
- select
- regulations_id,scene_name,regulation_type,standard_type,
- create_user_id,create_time,modify_user_id,
- modify_time,is_deleted,share,video_address,osgb_address,
- xml_address,xodr_address,json_address,video_preview,max_time
- from simulation.scene_standards_regulations
- <where>
- is_deleted = '0'
- <if test="AllIds != null and AllIds.size()>0">
- and regulations_id in
- <foreach collection="AllIds" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="label != null and label.size()>0">
- and regulation_type in
- <foreach collection="label" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- </where>
- order by modify_time desc
- </select>
- <update id="deleteStandardsRegulations" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO">
- update simulation.scene_standards_regulations
- <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 regulations_id = #{regulationsId,jdbcType=VARCHAR}
- </update>
- <select id="queryStandardsRegulationsByName" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO"
- resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
- select regulations_id, scene_name, regulation_type, standard_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, max_time
- from simulation.scene_standards_regulations
- <where>
- is_deleted = '0'
- <if test="sceneName != null and sceneName!=''">
- and scene_name = #{sceneName,jdbcType=VARCHAR}
- </if>
- <if test="share != null and share==0">
- and share =#{share}
- </if>
- <if test="share != null and share!= '' and share!=0">
- and share !='0'
- </if>
- </where>
- </select>
- <update id="updateStandardsRegulations" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO">
- update simulation.scene_standards_regulations
- set scene_name=#{sceneName},
- regulation_type=#{regulationType},
- standard_type=#{standardType},
- modify_user_id=#{modifyUserId},
- modify_time=#{modifyTime},
- video_address=#{videoAddress},
- osgb_address=#{osgbAddress},
- xml_address=#{xmlAddress},
- xodr_address=#{xodrAddress},
- json_address=#{jsonAddress},
- max_time=#{maxTime}
- where regulations_id = #{regulationsId,jdbcType=VARCHAR}
- </update>
- <update id="updateStandardsRegulationsList" parameterType="java.util.List">
- <foreach collection="list" index="index" item="item" separator=";">
- update simulation.scene_standards_regulations
- set scene_name=#{item.sceneName},regulation_type=#{item.regulationType},
- standard_type=#{item.standardType},modify_user_id=#{item.modifyUserId},
- modify_time=#{item.modifyTime},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 regulations_id = #{item.regulationsId,jdbcType=VARCHAR}
- </foreach>
- </update>
- <select id="queryStandardsRegulationsListByQx" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
- resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
- select
- regulations_id,scene_name,regulation_type,standard_type,
- create_user_id,create_time,modify_user_id,
- modify_time,is_deleted,share,video_address,osgb_address,
- xml_address,xodr_address,json_address,video_preview,max_time
- from (select bz.* 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='2' and s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join
- scene_standards_regulations bz on qx.scene_name=bz.scene_name and bz.share='2' union select jtNew.* from scene_standards_regulations jtNew where jtNew.share='1' and is_deleted='0') dd
- <where>
- is_deleted = '0'
- <if test="sceneName != null and sceneName != ''">
- and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
- </if>
- <if test="regulationType != null and regulationType.size()>0">
- and regulation_type in
- <foreach collection="regulationType" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="standardType != null and standardType != ''">
- and standard_type like CONCAT('%',#{standardType,jdbcType=VARCHAR},'%')
- </if>
- <if test="ids != null and ids.length>0">
- and regulations_id in
- <foreach collection="ids" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="allSceneNames != null and allSceneNames.length>0">
- and scene_name in
- <foreach collection="allSceneNames" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="AllIds != null and AllIds.size()>0">
- and regulations_id in
- <foreach collection="AllIds" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="share != null and share==0">
- and share =#{share}
- </if>
- <if test="share != null and share!= '' and share!=0">
- and share !='0'
- </if>
- </where>
- order by modify_time desc
- </select>
- <select id="queryStandardsRegulationsListByBqAndQx"
- parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
- resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
- select
- regulations_id,scene_name,regulation_type,standard_type,
- create_user_id,create_time,modify_user_id,
- modify_time,is_deleted,share,video_address,osgb_address,
- xml_address,xodr_address,json_address,video_preview,max_time
- from (select bz.* 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='2' and s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join
- scene_standards_regulations bz on qx.scene_name=bz.scene_name) dd
- <where>
- is_deleted = '0'
- <if test="AllIds != null and AllIds.size()>0">
- and regulations_id in
- <foreach collection="AllIds" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="label != null and label.size()>0">
- and regulation_type in
- <foreach collection="label" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- </where>
- order by modify_time desc
- </select>
- <select id="queryStandardsRegulationsById" parameterType="java.lang.String"
- resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
- select regulations_id, scene_name, regulation_type, standard_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, max_time
- from simulation.scene_standards_regulations
- where regulations_id=#{id}
- </select>
- </mapper>
|