StandardsRegulationsMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.css.simulation.resource.scene.mapper.StandardsRegulationsMapper">
  4. <insert id="saveStandardsRegulations" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO">
  5. insert into simulation.scene_standards_regulations
  6. (regulations_id, scene_name, regulation_type, standard_type,
  7. create_user_id, create_time, modify_user_id, modify_time,
  8. is_deleted, share, video_preview, video_address, osgb_address, xml_address, xodr_address,
  9. json_address, max_time)
  10. values (#{regulationsId,jdbcType=VARCHAR}, #{sceneName,jdbcType=VARCHAR}, #{regulationType,jdbcType=VARCHAR},
  11. #{standardType,jdbcType=VARCHAR},
  12. #{createUserId,jdbcType=VARCHAR}, #{createTime}, #{modifyUserId,jdbcType=VARCHAR}, #{modifyTime},
  13. #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR}, #{videoPreview,jdbcType=VARCHAR},
  14. #{videoAddress,jdbcType=VARCHAR}, #{osgbAddress,jdbcType=VARCHAR},
  15. #{xmlAddress,jdbcType=VARCHAR}, #{xodrAddress,jdbcType=VARCHAR}, #{jsonAddress,jdbcType=VARCHAR},
  16. #{maxTime,jdbcType=VARCHAR})
  17. </insert>
  18. <insert id="saveStandardsRegulationsList" parameterType="java.util.List">
  19. insert into simulation.scene_standards_regulations
  20. (regulations_id,scene_name,regulation_type,standard_type,
  21. create_user_id,create_time,modify_user_id,modify_time,
  22. is_deleted,share,video_preview,video_address,osgb_address,xml_address,xodr_address,
  23. json_address,max_time)
  24. values
  25. <foreach collection="list" index="index" item="item" separator=",">
  26. (#{item.regulationsId,jdbcType=VARCHAR},#{item.sceneName,jdbcType=VARCHAR},#{item.regulationType,jdbcType=VARCHAR},
  27. #{item.standardType,jdbcType=VARCHAR},
  28. #{item.createUserId,jdbcType=VARCHAR},#{item.createTime},#{item.modifyUserId,jdbcType=VARCHAR},#{item.modifyTime},
  29. #{item.isDeleted,jdbcType=VARCHAR},
  30. #{item.share,jdbcType=VARCHAR},#{item.videoPreview,jdbcType=VARCHAR},#{item.videoAddress,jdbcType=VARCHAR},#{item.osgbAddress,jdbcType=VARCHAR},
  31. #{item.xmlAddress,jdbcType=VARCHAR},
  32. #{item.xodrAddress,jdbcType=VARCHAR},#{item.jsonAddress,jdbcType=VARCHAR},#{item.maxTime,jdbcType=VARCHAR})
  33. </foreach>
  34. </insert>
  35. <select id="queryStandardsRegulationsList" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
  36. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  37. select
  38. regulations_id,scene_name,regulation_type,standard_type,
  39. create_user_id,create_time,modify_user_id,
  40. modify_time,is_deleted,share,video_address,osgb_address,
  41. xml_address,xodr_address,json_address,video_preview,max_time
  42. from simulation.scene_standards_regulations
  43. <where>
  44. (is_deleted = '0'
  45. <if test=
  46. "sceneName != null and sceneName != ''">
  47. and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
  48. </if>
  49. <if test="regulationType != null and regulationType.size()>0">
  50. and regulation_type in
  51. <foreach collection="regulationType" item="item" index="index"
  52. separator="," open="(" close=")">
  53. #{item}
  54. </foreach>
  55. </if>
  56. <if test="standardType != null and standardType != ''">
  57. and standard_type like CONCAT('%',#{standardType,jdbcType=VARCHAR},'%')
  58. </if>
  59. <if test="ids != null and ids.length>0">
  60. and regulations_id in
  61. <foreach collection="ids" item="item" index="index"
  62. separator="," open="(" close=")">
  63. #{item}
  64. </foreach>
  65. </if>
  66. <if test="allSceneNames != null and allSceneNames.length>0">
  67. and scene_name in
  68. <foreach collection="allSceneNames" item="item" index="index"
  69. separator="," open="(" close=")">
  70. #{item}
  71. </foreach>
  72. </if>
  73. <if test="AllIds != null and AllIds.size()>0">
  74. and regulations_id in
  75. <foreach collection="AllIds" item="item" index="index"
  76. separator="," open="(" close=")">
  77. #{item}
  78. </foreach>
  79. </if>
  80. )
  81. <if test="label != null and label.size()>0">
  82. or (regulation_type in
  83. <foreach collection="label" item="item" index="index"
  84. separator="," open="(" close=")">
  85. #{item}
  86. </foreach>
  87. and is_deleted = '0')
  88. </if>
  89. </where>
  90. order by modify_time desc
  91. </select>
  92. <select id="queryStandardsRegulationsListByBq" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
  93. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  94. select
  95. regulations_id,scene_name,regulation_type,standard_type,
  96. create_user_id,create_time,modify_user_id,
  97. modify_time,is_deleted,share,video_address,osgb_address,
  98. xml_address,xodr_address,json_address,video_preview,max_time
  99. from simulation.scene_standards_regulations
  100. <where>
  101. is_deleted = '0'
  102. <if test="AllIds != null and AllIds.size()>0">
  103. and regulations_id in
  104. <foreach collection="AllIds" item="item" index="index"
  105. separator="," open="(" close=")">
  106. #{item}
  107. </foreach>
  108. </if>
  109. <if test="label != null and label.size()>0">
  110. and regulation_type in
  111. <foreach collection="label" item="item" index="index"
  112. separator="," open="(" close=")">
  113. #{item}
  114. </foreach>
  115. </if>
  116. </where>
  117. order by modify_time desc
  118. </select>
  119. <update id="deleteStandardsRegulations" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO">
  120. update simulation.scene_standards_regulations
  121. <set>
  122. <if test="isDeleted != null and isDeleted!=''">
  123. is_deleted = #{isDeleted,jdbcType=VARCHAR},
  124. </if>
  125. <if test="modifyUserId != null and modifyUserId!=''">
  126. modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
  127. </if>
  128. <if test="modifyTime != null">
  129. modify_time = #{modifyTime},
  130. </if>
  131. </set>
  132. where regulations_id = #{regulationsId,jdbcType=VARCHAR}
  133. </update>
  134. <select id="queryStandardsRegulationsByName" parameterType="java.lang.String"
  135. resultType="java.lang.String">
  136. select regulations_id
  137. from simulation.scene_standards_regulations
  138. where is_deleted = '0'
  139. and scene_name = #{sceneName,jdbcType=VARCHAR}
  140. </select>
  141. <update id="updateStandardsRegulations" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO">
  142. update simulation.scene_standards_regulations
  143. set scene_name=#{sceneName},
  144. regulation_type=#{regulationType},
  145. standard_type=#{standardType},
  146. modify_user_id=#{modifyUserId},
  147. modify_time=#{modifyTime},
  148. video_address=#{videoAddress},
  149. osgb_address=#{osgbAddress},
  150. xml_address=#{xmlAddress},
  151. xodr_address=#{xodrAddress},
  152. json_address=#{jsonAddress},
  153. max_time=#{maxTime}
  154. where regulations_id = #{regulationsId,jdbcType=VARCHAR}
  155. </update>
  156. <update id="updateStandardsRegulationsList" parameterType="java.util.List">
  157. <foreach collection="list" index="index" item="item" separator=";">
  158. update simulation.scene_standards_regulations
  159. set scene_name=#{item.sceneName},regulation_type=#{item.regulationType},
  160. standard_type=#{item.standardType},modify_user_id=#{item.modifyUserId},
  161. modify_time=#{item.modifyTime},video_address=#{item.videoAddress},
  162. osgb_address=#{item.osgbAddress},xml_address=#{item.xmlAddress},
  163. xodr_address=#{item.xodrAddress},json_address=#{item.jsonAddress},max_time=#{item.maxTime}
  164. where regulations_id = #{item.regulationsId,jdbcType=VARCHAR}
  165. </foreach>
  166. </update>
  167. <select id="queryStandardsRegulationsListByQx" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
  168. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  169. select
  170. regulations_id,scene_name,regulation_type,standard_type,
  171. create_user_id,create_time,modify_user_id,
  172. modify_time,is_deleted,share,video_address,osgb_address,
  173. xml_address,xodr_address,json_address,video_preview,max_time
  174. from (select bz.* from( select s.scene_name
  175. FROM system_scene_package p
  176. JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
  177. JOIN system_scene_package_sublist s on p.id = s.scene_and_package
  178. where scene_type='2' and s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join
  179. scene_standards_regulations bz on qx.scene_name=bz.scene_name) dd
  180. <where>
  181. (is_deleted = '0'
  182. <if test=
  183. "sceneName != null and sceneName != ''">
  184. and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
  185. </if>
  186. <if test="regulationType != null and regulationType.size()>0">
  187. and regulation_type in
  188. <foreach collection="regulationType" item="item" index="index"
  189. separator="," open="(" close=")">
  190. #{item}
  191. </foreach>
  192. </if>
  193. <if test="standardType != null and standardType != ''">
  194. and standard_type like CONCAT('%',#{standardType,jdbcType=VARCHAR},'%')
  195. </if>
  196. <if test="ids != null and ids.length>0">
  197. and regulations_id in
  198. <foreach collection="ids" item="item" index="index"
  199. separator="," open="(" close=")">
  200. #{item}
  201. </foreach>
  202. </if>
  203. <if test="allSceneNames != null and allSceneNames.length>0">
  204. and scene_name in
  205. <foreach collection="allSceneNames" item="item" index="index"
  206. separator="," open="(" close=")">
  207. #{item}
  208. </foreach>
  209. </if>
  210. <if test="AllIds != null and AllIds.size()>0">
  211. and regulations_id in
  212. <foreach collection="AllIds" item="item" index="index"
  213. separator="," open="(" close=")">
  214. #{item}
  215. </foreach>
  216. </if>
  217. )
  218. <if test="label != null and label.size()>0">
  219. or (regulation_type in
  220. <foreach collection="label" item="item" index="index"
  221. separator="," open="(" close=")">
  222. #{item}
  223. </foreach>
  224. and is_deleted = '0')
  225. </if>
  226. </where>
  227. order by modify_time desc
  228. </select>
  229. <select id="queryStandardsRegulationsListByBqAndQx"
  230. parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
  231. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  232. select
  233. regulations_id,scene_name,regulation_type,standard_type,
  234. create_user_id,create_time,modify_user_id,
  235. modify_time,is_deleted,share,video_address,osgb_address,
  236. xml_address,xodr_address,json_address,video_preview,max_time
  237. from (select bz.* from( select s.scene_name
  238. FROM system_scene_package p
  239. JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
  240. JOIN system_scene_package_sublist s on p.id = s.scene_and_package
  241. where scene_type='2' and s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join
  242. scene_standards_regulations bz on qx.scene_name=bz.scene_name) dd
  243. <where>
  244. is_deleted = '0'
  245. <if test="AllIds != null and AllIds.size()>0">
  246. and regulations_id in
  247. <foreach collection="AllIds" item="item" index="index"
  248. separator="," open="(" close=")">
  249. #{item}
  250. </foreach>
  251. </if>
  252. <if test="label != null and label.size()>0">
  253. and regulation_type in
  254. <foreach collection="label" item="item" index="index"
  255. separator="," open="(" close=")">
  256. #{item}
  257. </foreach>
  258. </if>
  259. </where>
  260. order by modify_time desc
  261. </select>
  262. </mapper>