StandardsRegulationsMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  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="sceneName != null and sceneName != ''">
  46. and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
  47. </if>
  48. <if test="regulationType != null and regulationType.size()>0">
  49. and regulation_type in
  50. <foreach collection="regulationType" item="item" index="index"
  51. separator="," open="(" close=")">
  52. #{item}
  53. </foreach>
  54. </if>
  55. <if test="standardType != null and standardType != ''">
  56. and standard_type like CONCAT('%',#{standardType,jdbcType=VARCHAR},'%')
  57. </if>
  58. <if test="ids != null and ids.length>0">
  59. and regulations_id in
  60. <foreach collection="ids" item="item" index="index"
  61. separator="," open="(" close=")">
  62. #{item}
  63. </foreach>
  64. </if>
  65. <if test="allSceneNames != null and allSceneNames.length>0">
  66. and scene_name in
  67. <foreach collection="allSceneNames" item="item" index="index"
  68. separator="," open="(" close=")">
  69. #{item}
  70. </foreach>
  71. </if>
  72. <if test="AllIds != null and AllIds.size()>0">
  73. and regulations_id in
  74. <foreach collection="AllIds" item="item" index="index"
  75. separator="," open="(" close=")">
  76. #{item}
  77. </foreach>
  78. </if>
  79. <if test="share != null and share==0">
  80. and share =#{share}
  81. </if>
  82. <if test="share != null and share==1">
  83. and share !='0'
  84. </if>
  85. <if test="userId != null and userId != ''">
  86. and create_user_id =#{userId}
  87. </if>
  88. </where>
  89. order by modify_time desc
  90. </select>
  91. <select id="queryStandardsRegulationsListByBq" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
  92. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  93. select
  94. regulations_id,scene_name,regulation_type,standard_type,
  95. create_user_id,create_time,modify_user_id,
  96. modify_time,is_deleted,share,video_address,osgb_address,
  97. xml_address,xodr_address,json_address,video_preview,max_time
  98. from simulation.scene_standards_regulations
  99. <where>
  100. is_deleted = '0'
  101. <if test="AllIds != null and AllIds.size()>0">
  102. and regulations_id in
  103. <foreach collection="AllIds" item="item" index="index"
  104. separator="," open="(" close=")">
  105. #{item}
  106. </foreach>
  107. </if>
  108. <if test="label != null and label.size()>0">
  109. and regulation_type in
  110. <foreach collection="label" item="item" index="index"
  111. separator="," open="(" close=")">
  112. #{item}
  113. </foreach>
  114. </if>
  115. </where>
  116. order by modify_time desc
  117. </select>
  118. <update id="deleteStandardsRegulations" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO">
  119. update simulation.scene_standards_regulations
  120. <set>
  121. <if test="isDeleted != null and isDeleted!=''">
  122. is_deleted = #{isDeleted,jdbcType=VARCHAR},
  123. </if>
  124. <if test="modifyUserId != null and modifyUserId!=''">
  125. modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
  126. </if>
  127. <if test="modifyTime != null">
  128. modify_time = #{modifyTime},
  129. </if>
  130. </set>
  131. where regulations_id = #{regulationsId,jdbcType=VARCHAR}
  132. </update>
  133. <select id="queryStandardsRegulationsByName" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO"
  134. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  135. select regulations_id, scene_name, regulation_type, standard_type,
  136. create_user_id, create_time, modify_user_id, modify_time,
  137. is_deleted, share, video_preview, video_address, osgb_address, xml_address, xodr_address,
  138. json_address, max_time
  139. from simulation.scene_standards_regulations
  140. <where>
  141. is_deleted = '0'
  142. <if test="sceneName != null and sceneName!=''">
  143. and scene_name = #{sceneName,jdbcType=VARCHAR}
  144. </if>
  145. <if test="share != null and share==0">
  146. and share =#{share}
  147. </if>
  148. <if test="share != null and share!= '' and share!=0">
  149. and share !='0'
  150. </if>
  151. </where>
  152. </select>
  153. <update id="updateStandardsRegulations" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO">
  154. update simulation.scene_standards_regulations
  155. set scene_name=#{sceneName},
  156. regulation_type=#{regulationType},
  157. standard_type=#{standardType},
  158. modify_user_id=#{modifyUserId},
  159. modify_time=#{modifyTime},
  160. video_address=#{videoAddress},
  161. osgb_address=#{osgbAddress},
  162. xml_address=#{xmlAddress},
  163. xodr_address=#{xodrAddress},
  164. json_address=#{jsonAddress},
  165. max_time=#{maxTime}
  166. where regulations_id = #{regulationsId,jdbcType=VARCHAR}
  167. </update>
  168. <update id="updateStandardsRegulationsList" parameterType="java.util.List">
  169. <foreach collection="list" index="index" item="item" separator=";">
  170. update simulation.scene_standards_regulations
  171. set scene_name=#{item.sceneName},regulation_type=#{item.regulationType},
  172. standard_type=#{item.standardType},modify_user_id=#{item.modifyUserId},
  173. modify_time=#{item.modifyTime},video_address=#{item.videoAddress},
  174. osgb_address=#{item.osgbAddress},xml_address=#{item.xmlAddress},
  175. xodr_address=#{item.xodrAddress},json_address=#{item.jsonAddress},max_time=#{item.maxTime}
  176. where regulations_id = #{item.regulationsId,jdbcType=VARCHAR}
  177. </foreach>
  178. </update>
  179. <select id="queryStandardsRegulationsListByQx" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
  180. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  181. select
  182. regulations_id,scene_name,regulation_type,standard_type,
  183. create_user_id,create_time,modify_user_id,
  184. modify_time,is_deleted,share,video_address,osgb_address,
  185. xml_address,xodr_address,json_address,video_preview,max_time
  186. from (select bz.* from( select s.scene_name
  187. FROM system_scene_package p
  188. JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
  189. JOIN system_scene_package_sublist s on p.id = s.scene_and_package
  190. where scene_type='2' and s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join
  191. 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
  192. <where>
  193. is_deleted = '0'
  194. <if test="sceneName != null and sceneName != ''">
  195. and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
  196. </if>
  197. <if test="regulationType != null and regulationType.size()>0">
  198. and regulation_type in
  199. <foreach collection="regulationType" item="item" index="index"
  200. separator="," open="(" close=")">
  201. #{item}
  202. </foreach>
  203. </if>
  204. <if test="standardType != null and standardType != ''">
  205. and standard_type like CONCAT('%',#{standardType,jdbcType=VARCHAR},'%')
  206. </if>
  207. <if test="ids != null and ids.length>0">
  208. and regulations_id in
  209. <foreach collection="ids" item="item" index="index"
  210. separator="," open="(" close=")">
  211. #{item}
  212. </foreach>
  213. </if>
  214. <if test="allSceneNames != null and allSceneNames.length>0">
  215. and scene_name in
  216. <foreach collection="allSceneNames" item="item" index="index"
  217. separator="," open="(" close=")">
  218. #{item}
  219. </foreach>
  220. </if>
  221. <if test="AllIds != null and AllIds.size()>0">
  222. and regulations_id in
  223. <foreach collection="AllIds" item="item" index="index"
  224. separator="," open="(" close=")">
  225. #{item}
  226. </foreach>
  227. </if>
  228. <if test="share != null and share==0">
  229. and share =#{share}
  230. </if>
  231. <if test="share != null and share!= '' and share!=0">
  232. and share !='0'
  233. </if>
  234. </where>
  235. order by modify_time desc
  236. </select>
  237. <select id="queryStandardsRegulationsListByBqAndQx"
  238. parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
  239. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  240. select
  241. regulations_id,scene_name,regulation_type,standard_type,
  242. create_user_id,create_time,modify_user_id,
  243. modify_time,is_deleted,share,video_address,osgb_address,
  244. xml_address,xodr_address,json_address,video_preview,max_time
  245. from (select bz.* from( select s.scene_name
  246. FROM system_scene_package p
  247. JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
  248. JOIN system_scene_package_sublist s on p.id = s.scene_and_package
  249. where scene_type='2' and s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join
  250. scene_standards_regulations bz on qx.scene_name=bz.scene_name) dd
  251. <where>
  252. is_deleted = '0'
  253. <if test="AllIds != null and AllIds.size()>0">
  254. and regulations_id in
  255. <foreach collection="AllIds" item="item" index="index"
  256. separator="," open="(" close=")">
  257. #{item}
  258. </foreach>
  259. </if>
  260. <if test="label != null and label.size()>0">
  261. and regulation_type in
  262. <foreach collection="label" item="item" index="index"
  263. separator="," open="(" close=")">
  264. #{item}
  265. </foreach>
  266. </if>
  267. </where>
  268. order by modify_time desc
  269. </select>
  270. <select id="queryStandardsRegulationsById" parameterType="java.lang.String"
  271. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  272. select regulations_id, scene_name, regulation_type, standard_type,
  273. create_user_id, create_time, modify_user_id, modify_time,
  274. is_deleted, share, video_preview, video_address, osgb_address, xml_address, xodr_address,
  275. json_address, max_time
  276. from simulation.scene_standards_regulations
  277. where regulations_id=#{id}
  278. </select>
  279. </mapper>