SceneGeneralTemplateMapper.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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.server.infra.db.mysql.mapper.SceneGeneralTemplateMapper">
  4. <insert id="saveSceneGeneralTemplateAll" parameterType="java.util.List">
  5. insert into simulation.scene_general_template
  6. (id,scene_id,scenario_name,scenario_weather,scenario_time,
  7. scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
  8. ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
  9. ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
  10. obs_lateral_acceleration,obs_longitudinal_acceleration,
  11. obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
  12. obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
  13. video_link,file_name,version,share,
  14. create_user_id,create_time,modify_time,
  15. is_deleted,obs_type) values
  16. <foreach collection="list" index="index" item="item" separator=",">
  17. (#{item.id,jdbcType=VARCHAR},#{item.sceneId,jdbcType=VARCHAR},#{item.scenarioName,jdbcType=VARCHAR},#{item.scenarioWeather,jdbcType=VARCHAR},#{item.scenarioTime,jdbcType=VARCHAR},
  18. #{item.scenarioVehicleModel,jdbcType=VARCHAR}, #{item.scenarioRoadType,jdbcType=VARCHAR}, #{item.scenarioRadiusCurvature,jdbcType=VARCHAR},#{item.egoStartX,jdbcType=VARCHAR}, #{item.egoStartY,jdbcType=VARCHAR},
  19. #{item.egoStartVelocity,jdbcType=VARCHAR}, #{item.egoHeadingAngle,jdbcType=VARCHAR},#{item.egoVelocityStatus,jdbcType=VARCHAR},#{item.egoTrajectory,jdbcType=VARCHAR},#{item.egoDurationTime,jdbcType=VARCHAR},
  20. #{item.egoVelocityTime,jdbcType=VARCHAR}, #{item.egoTrajectoryTime,jdbcType=VARCHAR},#{item.obsStartX,jdbcType=VARCHAR},#{item.obsStartY,jdbcType=VARCHAR},#{item.obsStartVelocity,jdbcType=VARCHAR},
  21. #{item.obsLateralAcceleration,jdbcType=VARCHAR}, #{item.obsLongitudinalAcceleration,jdbcType=VARCHAR},
  22. #{item.obsHeadingAngleRel,jdbcType=VARCHAR}, #{item.obsVelocityStatus,jdbcType=VARCHAR},#{item.obsTrajectory,jdbcType=VARCHAR},#{item.obsDurationTime,jdbcType=VARCHAR},#{item.obsVelocityTime,jdbcType=VARCHAR},
  23. #{item.obsTrailTime,jdbcType=VARCHAR}, #{item.generalizationType,jdbcType=VARCHAR},#{item.scenarioResume,jdbcType=VARCHAR},#{item.sceneDetailedDescription},#{item.evaluatingIndicator,jdbcType=VARCHAR},
  24. #{item.videoLink},#{item.fileName},#{item.version},#{item.share},
  25. #{item.createUserId,jdbcType=VARCHAR},#{item.createTime},#{item.modifyTime},
  26. #{item.isDeleted,jdbcType=VARCHAR},#{item.obsType})
  27. </foreach>
  28. </insert>
  29. <insert id="saveSceneGeneralTemplate" parameterType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  30. insert into simulation.scene_general_template
  31. (id,scene_id,scenario_name,scenario_weather,scenario_time,
  32. scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
  33. ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
  34. ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
  35. obs_lateral_acceleration,obs_longitudinal_acceleration,
  36. obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
  37. obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
  38. video_link,file_name,version,share,
  39. create_user_id,create_time,modify_time,
  40. is_deleted,obs_type) values
  41. (#{id,jdbcType=VARCHAR},#{sceneId,jdbcType=VARCHAR},#{scenarioName,jdbcType=VARCHAR},#{scenarioWeather,jdbcType=VARCHAR},#{scenarioTime,jdbcType=VARCHAR},
  42. #{scenarioVehicleModel,jdbcType=VARCHAR}, #{scenarioRoadType,jdbcType=VARCHAR}, #{scenarioRadiusCurvature,jdbcType=VARCHAR},#{egoStartX,jdbcType=VARCHAR}, #{egoStartY,jdbcType=VARCHAR},
  43. #{egoStartVelocity,jdbcType=VARCHAR}, #{egoHeadingAngle,jdbcType=VARCHAR},#{egoVelocityStatus,jdbcType=VARCHAR},#{egoTrajectory,jdbcType=VARCHAR},#{egoDurationTime,jdbcType=VARCHAR},
  44. #{egoVelocityTime,jdbcType=VARCHAR}, #{egoTrajectoryTime,jdbcType=VARCHAR},#{obsStartX,jdbcType=VARCHAR},#{obsStartY,jdbcType=VARCHAR},#{obsStartVelocity,jdbcType=VARCHAR},
  45. #{obsLateralAcceleration,jdbcType=VARCHAR}, #{obsLongitudinalAcceleration,jdbcType=VARCHAR},
  46. #{obsHeadingAngleRel,jdbcType=VARCHAR}, #{obsVelocityStatus,jdbcType=VARCHAR},#{obsTrajectory,jdbcType=VARCHAR},#{obsDurationTime,jdbcType=VARCHAR},#{obsVelocityTime,jdbcType=VARCHAR},
  47. #{obsTrailTime,jdbcType=VARCHAR}, #{generalizationType,jdbcType=VARCHAR},#{scenarioResume,jdbcType=VARCHAR},#{sceneDetailedDescription},#{evaluatingIndicator,jdbcType=VARCHAR},
  48. #{videoLink},#{fileName},#{version},#{share},
  49. #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyTime},
  50. #{isDeleted,jdbcType=VARCHAR},#{obsType})
  51. </insert>
  52. <select id="querySceneGeneralTemplateList" parameterType="api.common.pojo.param.scene.SceneGeneralTemplateParam"
  53. resultType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  54. select
  55. id,scene_id,scenario_name,scenario_weather,scenario_time,
  56. scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
  57. ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
  58. ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
  59. obs_lateral_acceleration,obs_longitudinal_acceleration,
  60. obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
  61. obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
  62. video_link,file_name,version,share,
  63. create_user_id,create_time,modify_time,obs_type
  64. from simulation.scene_general_template
  65. <where>
  66. is_deleted = '0'
  67. <if test="id != null and id != ''">
  68. and id #{id,jdbcType=VARCHAR}
  69. </if>
  70. <if test="sceneId != null and sceneId != ''">
  71. and scene_id like CONCAT('%',#{sceneId,jdbcType=VARCHAR},'%')
  72. </if>
  73. <if test="scenarioWeather != null and scenarioWeather.size()>0 ">
  74. and scenario_weather in
  75. <foreach collection="scenarioWeather" item="item" index="index"
  76. separator="," open="(" close=")">
  77. #{item}
  78. </foreach>
  79. </if>
  80. <if test="fileName != null and fileName.size()>0 ">
  81. and file_name in
  82. <foreach collection="fileName" item="item" index="index"
  83. separator="," open="(" close=")">
  84. #{item}
  85. </foreach>
  86. </if>
  87. <if test="scenarioTime != null and scenarioTime != ''">
  88. and scenario_time= #{scenarioTime,jdbcType=VARCHAR}
  89. </if>
  90. <if test="version != null and version != ''">
  91. and version= #{version}
  92. </if>
  93. <if test="obsType != null and obsType != ''">
  94. and obs_type= #{obsType}
  95. </if>
  96. <if test="share != null and share==0">
  97. and share =#{share}
  98. </if>
  99. <if test="share != null and share!= '' and share!=0">
  100. and share !='0'
  101. </if>
  102. <if test="allSceneNames != null and allSceneNames.length>0">
  103. and scene_id in
  104. <foreach collection="allSceneNames" item="item" index="index"
  105. separator="," open="(" close=")">
  106. #{item}
  107. </foreach>
  108. </if>
  109. <if test="scenarioRoadType != null and scenarioRoadType.size()>0 ">
  110. and scenario_road_type in
  111. <foreach collection="scenarioRoadType" item="item" index="index"
  112. separator="," open="(" close=")">
  113. #{item}
  114. </foreach>
  115. </if>
  116. <if test="userId != null and userId != ''">
  117. and create_user_id =#{userId}
  118. </if>
  119. <if test="scenarioResume != null and scenarioResume != ''">
  120. and scenario_resume like CONCAT('%',#{scenarioResume,jdbcType=VARCHAR},'%')
  121. </if>
  122. order by modify_time desc
  123. </where>
  124. </select>
  125. <select id="querySceneGeneralTemplateById" parameterType="java.lang.String"
  126. resultType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  127. select
  128. id,scene_id,scenario_name,scenario_weather,scenario_time,
  129. scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
  130. ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
  131. ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
  132. obs_lateral_acceleration,obs_longitudinal_acceleration,
  133. obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
  134. obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
  135. video_link,file_name,version,is_deleted,
  136. create_user_id,create_time,modify_time,obs_type
  137. from simulation.scene_general_template
  138. where id = #{id,jdbcType=VARCHAR}
  139. </select>
  140. <select id="queryType" resultType="java.lang.String">
  141. select
  142. file_name
  143. from simulation.scene_general_template
  144. where is_deleted = '0' group by file_name
  145. </select>
  146. <update id="deleteSceneGeneralTemplateAll" parameterType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  147. update simulation.scene_general_template
  148. <set>
  149. <if test="modifyUserId != null and modifyUserId!=''">
  150. modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
  151. </if>
  152. <if test="modifyTime != null">
  153. modify_time = #{modifyTime},
  154. </if>
  155. is_deleted = '1'
  156. </set>
  157. <where>
  158. is_deleted = '0'
  159. <if test="fileNameAll != null and fileNameAll.size()>0 ">
  160. and file_name in
  161. <foreach collection="fileNameAll" item="item" index="index"
  162. separator="," open="(" close=")">
  163. #{item}
  164. </foreach>
  165. </if>
  166. </where>
  167. </update>
  168. <update id="deleteSceneGeneralTemplateByScendId" parameterType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  169. update simulation.scene_general_template
  170. <set>
  171. <if test="modifyUserId != null and modifyUserId!=''">
  172. modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
  173. </if>
  174. <if test="modifyTime != null">
  175. modify_time = #{modifyTime},
  176. </if>
  177. is_deleted = '1'
  178. </set>
  179. where is_deleted = '0' and scene_id=#{sceneId}
  180. </update>
  181. <select id="querySceneGeneralTemplateListByQx" parameterType="api.common.pojo.param.scene.SceneGeneralTemplateParam"
  182. resultType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  183. select
  184. id,scene_id,scenario_name,scenario_weather,scenario_time,
  185. scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
  186. ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
  187. ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
  188. obs_lateral_acceleration,obs_longitudinal_acceleration,
  189. obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
  190. obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
  191. video_link,file_name,version,share,
  192. create_user_id,create_time,modify_time
  193. from (select fh.* from( select s.scene_name
  194. FROM system_scene_package p
  195. JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
  196. JOIN system_scene_package_sublist s on p.id = s.scene_and_package
  197. where scene_type='4' and s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_general_template fh on qx.scene_name=fh.scene_id and fh.is_deleted = '0' and fh.share='2' union select jtNew.* from scene_general_template jtNew where jtNew.share='1' and is_deleted='0') dd
  198. <where>
  199. is_deleted = '0'
  200. <if test="id != null and id != ''">
  201. and id #{id,jdbcType=VARCHAR}
  202. </if>
  203. <if test="sceneId != null and sceneId != ''">
  204. and scene_id like CONCAT('%',#{sceneId,jdbcType=VARCHAR},'%')
  205. </if>
  206. <if test="scenarioWeather != null and scenarioWeather.size()>0 ">
  207. and scenario_weather in
  208. <foreach collection="scenarioWeather" item="item" index="index"
  209. separator="," open="(" close=")">
  210. #{item}
  211. </foreach>
  212. </if>
  213. <if test="fileName != null and fileName.size()>0 ">
  214. and file_name in
  215. <foreach collection="fileName" item="item" index="index"
  216. separator="," open="(" close=")">
  217. #{item}
  218. </foreach>
  219. </if>
  220. <if test="scenarioTime != null and scenarioTime != ''">
  221. and scenario_time= #{scenarioTime,jdbcType=VARCHAR}
  222. </if>
  223. <if test="version != null and version != ''">
  224. and version= #{version}
  225. </if>
  226. <if test="share != null and share==0">
  227. and share =#{share}
  228. </if>
  229. <if test="share != null and share!= '' and share!=0">
  230. and share !='0'
  231. </if>
  232. <if test="allSceneNames != null and allSceneNames.length>0">
  233. and scene_id in
  234. <foreach collection="allSceneNames" item="item" index="index"
  235. separator="," open="(" close=")">
  236. #{item}
  237. </foreach>
  238. </if>
  239. <if test="scenarioRoadType != null and scenarioRoadType.size()>0 ">
  240. and scenario_road_type in
  241. <foreach collection="scenarioRoadType" item="item" index="index"
  242. separator="," open="(" close=")">
  243. #{item}
  244. </foreach>
  245. </if>
  246. <if test="scenarioResume != null and scenarioResume != ''">
  247. and scenario_resume like CONCAT('%',#{scenarioResume,jdbcType=VARCHAR},'%')
  248. </if>
  249. order by modify_time desc
  250. </where>
  251. </select>
  252. <select id="querySceneGeneralTemplateByName" parameterType="api.common.pojo.po.scene.SceneGeneralTemplatePO" resultType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  253. select id,scene_id,scenario_name,scenario_weather,scenario_time,
  254. scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
  255. ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
  256. ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
  257. obs_lateral_acceleration,obs_longitudinal_acceleration,
  258. obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
  259. obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
  260. video_link,file_name,version,share,
  261. create_user_id,create_time,modify_time,
  262. is_deleted,obs_type
  263. from simulation.scene_general_template
  264. <where >
  265. is_deleted = '0'
  266. <if test="sceneId != null and sceneId!=''">
  267. and scene_id =#{sceneId}
  268. </if>
  269. <if test="share != null and share==0">
  270. and share =#{share}
  271. </if>
  272. <if test="share != null and share!= '' and share!=0">
  273. and share !='0'
  274. </if>
  275. </where>
  276. </select>
  277. <update id="updateSceneGeneralTemplate" parameterType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  278. update simulation.scene_general_template
  279. set scene_id=#{sceneId,jdbcType=VARCHAR},
  280. scenario_name=#{scenarioName,jdbcType=VARCHAR},
  281. scenario_weather=#{scenarioWeather,jdbcType=VARCHAR},
  282. scenario_time=#{scenarioTime,jdbcType=VARCHAR},
  283. scenario_vehicle_model= #{scenarioVehicleModel,jdbcType=VARCHAR},
  284. scenario_road_type=#{scenarioRoadType,jdbcType=VARCHAR},
  285. scenario_radius_curvature= #{scenarioRadiusCurvature,jdbcType=VARCHAR},
  286. ego_start_x= #{egoStartX,jdbcType=VARCHAR},
  287. ego_start_y= #{egoStartY,jdbcType=VARCHAR},
  288. ego_start_velocity= #{egoStartVelocity,jdbcType=VARCHAR},
  289. ego_heading_angle=#{egoHeadingAngle,jdbcType=VARCHAR},
  290. ego_velocity_status=#{egoVelocityStatus,jdbcType=VARCHAR},
  291. ego_trajectory= #{egoTrajectory,jdbcType=VARCHAR},
  292. ego_duration_time= #{egoDurationTime,jdbcType=VARCHAR},
  293. ego_velocity_time=#{egoVelocityTime,jdbcType=VARCHAR},
  294. ego_trajectory_time=#{egoTrajectoryTime,jdbcType=VARCHAR},
  295. obs_start_x=#{obsStartX,jdbcType=VARCHAR},
  296. obs_start_y=#{obsStartY,jdbcType=VARCHAR},
  297. obs_start_velocity=#{obsStartVelocity,jdbcType=VARCHAR},
  298. obs_lateral_acceleration=#{obsLateralAcceleration,jdbcType=VARCHAR},
  299. obs_longitudinal_acceleration=#{obsLongitudinalAcceleration,jdbcType=VARCHAR},
  300. obs_heading_angle_rel=#{obsHeadingAngleRel,jdbcType=VARCHAR},
  301. obs_velocity_status=#{obsVelocityStatus,jdbcType=VARCHAR},
  302. obs_trajectory=#{obsTrajectory,jdbcType=VARCHAR},
  303. obs_duration_time=#{obsDurationTime,jdbcType=VARCHAR},
  304. obs_velocity_time=#{obsVelocityTime,jdbcType=VARCHAR},
  305. obs_trail_time=#{obsTrailTime,jdbcType=VARCHAR},
  306. generalization_type= #{generalizationType,jdbcType=VARCHAR},
  307. scenario_resume=#{scenarioResume,jdbcType=VARCHAR},
  308. scene_detailed_description=#{sceneDetailedDescription},
  309. evaluating_indicator=#{evaluatingIndicator,jdbcType=VARCHAR},
  310. video_link=#{videoLink},
  311. file_name=#{fileName},
  312. version= #{version},
  313. share=#{share},
  314. create_user_id=#{createUserId,jdbcType=VARCHAR},
  315. create_time=#{createTime},
  316. modify_time=#{modifyTime},
  317. is_deleted=#{isDeleted,jdbcType=VARCHAR},
  318. obs_type=#{obsType}
  319. where id = #{id,jdbcType=VARCHAR}
  320. </update>
  321. <select id="queryIdBySceneId" resultType="java.lang.String">
  322. select id from simulation.scene_general_template where scene_id=#{sceneId} and is_deleted='0'
  323. </select>
  324. </mapper>