StandardsRegulationsMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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 create_time,scene_name 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 is_deleted = '0'
  141. <if test="sceneName != null and sceneName!=''">
  142. and scene_name = #{sceneName,jdbcType=VARCHAR}
  143. </if>
  144. <if test="share != null and share==0">
  145. and share =#{share}
  146. </if>
  147. <if test="share != null and share!= '' and share!=0">
  148. and share !='0'
  149. </if>
  150. </select>
  151. <select id="selectAllByName" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO"
  152. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  153. select regulations_id,
  154. scene_name,
  155. regulation_type,
  156. standard_type,
  157. create_user_id,
  158. create_time,
  159. modify_user_id,
  160. modify_time,
  161. is_deleted,
  162. share,
  163. video_preview,
  164. video_address,
  165. osgb_address,
  166. xml_address,
  167. xodr_address,
  168. json_address,
  169. max_time
  170. from simulation.scene_standards_regulations
  171. where is_deleted = '0'
  172. and scene_name = #{sceneName,jdbcType=VARCHAR}
  173. </select>
  174. <update id="updateStandardsRegulations" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO">
  175. update simulation.scene_standards_regulations
  176. set scene_name=#{sceneName},
  177. regulation_type=#{regulationType},
  178. standard_type=#{standardType},
  179. modify_user_id=#{modifyUserId},
  180. modify_time=#{modifyTime},
  181. video_address=#{videoAddress},
  182. osgb_address=#{osgbAddress},
  183. xml_address=#{xmlAddress},
  184. xodr_address=#{xodrAddress},
  185. json_address=#{jsonAddress},
  186. max_time=#{maxTime}
  187. where regulations_id = #{regulationsId,jdbcType=VARCHAR}
  188. </update>
  189. <update id="updateStandardsRegulationsList" parameterType="java.util.List">
  190. <foreach collection="list" index="index" item="item" separator=";">
  191. update simulation.scene_standards_regulations
  192. set scene_name=#{item.sceneName},regulation_type=#{item.regulationType},
  193. standard_type=#{item.standardType},modify_user_id=#{item.modifyUserId},
  194. modify_time=#{item.modifyTime},video_address=#{item.videoAddress},
  195. osgb_address=#{item.osgbAddress},xml_address=#{item.xmlAddress},
  196. xodr_address=#{item.xodrAddress},json_address=#{item.jsonAddress},max_time=#{item.maxTime}
  197. where regulations_id = #{item.regulationsId,jdbcType=VARCHAR}
  198. </foreach>
  199. </update>
  200. <select id="queryStandardsRegulationsListByQx" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
  201. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  202. select
  203. regulations_id,scene_name,regulation_type,standard_type,
  204. create_user_id,create_time,modify_user_id,
  205. modify_time,is_deleted,share,video_address,osgb_address,
  206. xml_address,xodr_address,json_address,video_preview,max_time
  207. from (select bz.* from( select s.scene_name
  208. FROM system_scene_package p
  209. JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
  210. JOIN system_scene_package_sublist s on p.id = s.scene_and_package
  211. where scene_type='2' and s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join
  212. 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
  213. <where>
  214. is_deleted = '0'
  215. <if test="sceneName != null and sceneName != ''">
  216. and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
  217. </if>
  218. <if test="regulationType != null and regulationType.size()>0">
  219. and regulation_type in
  220. <foreach collection="regulationType" item="item" index="index"
  221. separator="," open="(" close=")">
  222. #{item}
  223. </foreach>
  224. </if>
  225. <if test="standardType != null and standardType != ''">
  226. and standard_type like CONCAT('%',#{standardType,jdbcType=VARCHAR},'%')
  227. </if>
  228. <if test="ids != null and ids.length>0">
  229. and regulations_id in
  230. <foreach collection="ids" item="item" index="index"
  231. separator="," open="(" close=")">
  232. #{item}
  233. </foreach>
  234. </if>
  235. <if test="allSceneNames != null and allSceneNames.length>0">
  236. and scene_name in
  237. <foreach collection="allSceneNames" item="item" index="index"
  238. separator="," open="(" close=")">
  239. #{item}
  240. </foreach>
  241. </if>
  242. <if test="AllIds != null and AllIds.size()>0">
  243. and regulations_id in
  244. <foreach collection="AllIds" item="item" index="index"
  245. separator="," open="(" close=")">
  246. #{item}
  247. </foreach>
  248. </if>
  249. <if test="share != null and share==0">
  250. and share =#{share}
  251. </if>
  252. <if test="share != null and share!= '' and share!=0">
  253. and share !='0'
  254. </if>
  255. </where>
  256. order by create_time,scene_name desc
  257. </select>
  258. <select id="queryStandardsRegulationsListByBqAndQx"
  259. parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
  260. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  261. select
  262. regulations_id,scene_name,regulation_type,standard_type,
  263. create_user_id,create_time,modify_user_id,
  264. modify_time,is_deleted,share,video_address,osgb_address,
  265. xml_address,xodr_address,json_address,video_preview,max_time
  266. from (select bz.* from( select s.scene_name
  267. FROM system_scene_package p
  268. JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
  269. JOIN system_scene_package_sublist s on p.id = s.scene_and_package
  270. where scene_type='2' and s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join
  271. scene_standards_regulations bz on qx.scene_name=bz.scene_name) dd
  272. <where>
  273. is_deleted = '0'
  274. <if test="AllIds != null and AllIds.size()>0">
  275. and regulations_id in
  276. <foreach collection="AllIds" item="item" index="index"
  277. separator="," open="(" close=")">
  278. #{item}
  279. </foreach>
  280. </if>
  281. <if test="label != null and label.size()>0">
  282. and regulation_type in
  283. <foreach collection="label" item="item" index="index"
  284. separator="," open="(" close=")">
  285. #{item}
  286. </foreach>
  287. </if>
  288. </where>
  289. order by modify_time desc
  290. </select>
  291. <select id="queryStandardsRegulationsById" parameterType="java.lang.String"
  292. resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
  293. select regulations_id, scene_name, regulation_type, standard_type,
  294. create_user_id, create_time, modify_user_id, modify_time,
  295. is_deleted, share, video_preview, video_address, osgb_address, xml_address, xodr_address,
  296. json_address, max_time
  297. from simulation.scene_standards_regulations
  298. where regulations_id=#{id}
  299. </select>
  300. <select id="queryRegulationType" resultType="java.lang.String"></select>
  301. </mapper>