SceneGeneralTemplateMapper.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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.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. order by modify_time desc
  120. </where>
  121. </select>
  122. <select id="querySceneGeneralTemplateById" parameterType="java.lang.String"
  123. resultType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  124. select
  125. id,scene_id,scenario_name,scenario_weather,scenario_time,
  126. scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
  127. ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
  128. ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
  129. obs_lateral_acceleration,obs_longitudinal_acceleration,
  130. obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
  131. obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
  132. video_link,file_name,version,is_deleted,
  133. create_user_id,create_time,modify_time,obs_type
  134. from simulation.scene_general_template
  135. where id = #{id,jdbcType=VARCHAR}
  136. </select>
  137. <select id="queryType" resultType="java.lang.String">
  138. select
  139. file_name
  140. from simulation.scene_general_template
  141. where is_deleted = '0' group by file_name
  142. </select>
  143. <update id="deleteSceneGeneralTemplateAll" parameterType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  144. update simulation.scene_general_template
  145. <set>
  146. <if test="modifyUserId != null and modifyUserId!=''">
  147. modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
  148. </if>
  149. <if test="modifyTime != null">
  150. modify_time = #{modifyTime},
  151. </if>
  152. is_deleted = '1'
  153. </set>
  154. <where>
  155. is_deleted = '0'
  156. <if test="fileNameAll != null and fileNameAll.size()>0 ">
  157. and file_name in
  158. <foreach collection="fileNameAll" item="item" index="index"
  159. separator="," open="(" close=")">
  160. #{item}
  161. </foreach>
  162. </if>
  163. </where>
  164. </update>
  165. <update id="deleteSceneGeneralTemplateByScendId" parameterType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  166. update simulation.scene_general_template
  167. <set>
  168. <if test="modifyUserId != null and modifyUserId!=''">
  169. modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
  170. </if>
  171. <if test="modifyTime != null">
  172. modify_time = #{modifyTime},
  173. </if>
  174. is_deleted = '1'
  175. </set>
  176. where is_deleted = '0' and scene_id=#{sceneId}
  177. </update>
  178. <select id="querySceneGeneralTemplateListByQx" parameterType="api.common.pojo.param.scene.SceneGeneralTemplateParam"
  179. resultType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  180. select
  181. id,scene_id,scenario_name,scenario_weather,scenario_time,
  182. scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
  183. ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
  184. ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
  185. obs_lateral_acceleration,obs_longitudinal_acceleration,
  186. obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
  187. obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
  188. video_link,file_name,version,share,
  189. create_user_id,create_time,modify_time
  190. from (select fh.* from( select s.scene_name
  191. FROM system_scene_package p
  192. JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
  193. JOIN system_scene_package_sublist s on p.id = s.scene_and_package
  194. 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
  195. <where>
  196. is_deleted = '0'
  197. <if test="id != null and id != ''">
  198. and id #{id,jdbcType=VARCHAR}
  199. </if>
  200. <if test="sceneId != null and sceneId != ''">
  201. and scene_id like CONCAT('%',#{sceneId,jdbcType=VARCHAR},'%')
  202. </if>
  203. <if test="scenarioWeather != null and scenarioWeather.size()>0 ">
  204. and scenario_weather in
  205. <foreach collection="scenarioWeather" item="item" index="index"
  206. separator="," open="(" close=")">
  207. #{item}
  208. </foreach>
  209. </if>
  210. <if test="fileName != null and fileName.size()>0 ">
  211. and file_name in
  212. <foreach collection="fileName" item="item" index="index"
  213. separator="," open="(" close=")">
  214. #{item}
  215. </foreach>
  216. </if>
  217. <if test="scenarioTime != null and scenarioTime != ''">
  218. and scenario_time= #{scenarioTime,jdbcType=VARCHAR}
  219. </if>
  220. <if test="version != null and version != ''">
  221. and version= #{version}
  222. </if>
  223. <if test="share != null and share==0">
  224. and share =#{share}
  225. </if>
  226. <if test="share != null and share!= '' and share!=0">
  227. and share !='0'
  228. </if>
  229. <if test="allSceneNames != null and allSceneNames.length>0">
  230. and scene_id in
  231. <foreach collection="allSceneNames" item="item" index="index"
  232. separator="," open="(" close=")">
  233. #{item}
  234. </foreach>
  235. </if>
  236. <if test="scenarioRoadType != null and scenarioRoadType.size()>0 ">
  237. and scenario_road_type in
  238. <foreach collection="scenarioRoadType" item="item" index="index"
  239. separator="," open="(" close=")">
  240. #{item}
  241. </foreach>
  242. </if>
  243. order by modify_time desc
  244. </where>
  245. </select>
  246. <select id="querySceneGeneralTemplateByName" parameterType="api.common.pojo.po.scene.SceneGeneralTemplatePO" resultType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  247. select id,scene_id,scenario_name,scenario_weather,scenario_time,
  248. scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
  249. ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
  250. ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
  251. obs_lateral_acceleration,obs_longitudinal_acceleration,
  252. obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
  253. obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
  254. video_link,file_name,version,share,
  255. create_user_id,create_time,modify_time,
  256. is_deleted,obs_type
  257. from simulation.scene_general_template
  258. <where >
  259. is_deleted = '0'
  260. <if test="sceneId != null and sceneId!=''">
  261. and scene_id =#{sceneId}
  262. </if>
  263. <if test="share != null and share==0">
  264. and share =#{share}
  265. </if>
  266. <if test="share != null and share!= '' and share!=0">
  267. and share !='0'
  268. </if>
  269. </where>
  270. </select>
  271. <update id="updateSceneGeneralTemplate" parameterType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
  272. update simulation.scene_general_template
  273. set scene_id=#{sceneId,jdbcType=VARCHAR},
  274. scenario_name=#{scenarioName,jdbcType=VARCHAR},
  275. scenario_weather=#{scenarioWeather,jdbcType=VARCHAR},
  276. scenario_time=#{scenarioTime,jdbcType=VARCHAR},
  277. scenario_vehicle_model= #{scenarioVehicleModel,jdbcType=VARCHAR},
  278. scenario_road_type=#{scenarioRoadType,jdbcType=VARCHAR},
  279. scenario_radius_curvature= #{scenarioRadiusCurvature,jdbcType=VARCHAR},
  280. ego_start_x= #{egoStartX,jdbcType=VARCHAR},
  281. ego_start_y= #{egoStartY,jdbcType=VARCHAR},
  282. ego_start_velocity= #{egoStartVelocity,jdbcType=VARCHAR},
  283. ego_heading_angle=#{egoHeadingAngle,jdbcType=VARCHAR},
  284. ego_velocity_status=#{egoVelocityStatus,jdbcType=VARCHAR},
  285. ego_trajectory= #{egoTrajectory,jdbcType=VARCHAR},
  286. ego_duration_time= #{egoDurationTime,jdbcType=VARCHAR},
  287. ego_velocity_time=#{egoVelocityTime,jdbcType=VARCHAR},
  288. ego_trajectory_time=#{egoTrajectoryTime,jdbcType=VARCHAR},
  289. obs_start_x=#{obsStartX,jdbcType=VARCHAR},
  290. obs_start_y=#{obsStartY,jdbcType=VARCHAR},
  291. obs_start_velocity=#{obsStartVelocity,jdbcType=VARCHAR},
  292. obs_lateral_acceleration=#{obsLateralAcceleration,jdbcType=VARCHAR},
  293. obs_longitudinal_acceleration=#{obsLongitudinalAcceleration,jdbcType=VARCHAR},
  294. obs_heading_angle_rel=#{obsHeadingAngleRel,jdbcType=VARCHAR},
  295. obs_velocity_status=#{obsVelocityStatus,jdbcType=VARCHAR},
  296. obs_trajectory=#{obsTrajectory,jdbcType=VARCHAR},
  297. obs_duration_time=#{obsDurationTime,jdbcType=VARCHAR},
  298. obs_velocity_time=#{obsVelocityTime,jdbcType=VARCHAR},
  299. obs_trail_time=#{obsTrailTime,jdbcType=VARCHAR},
  300. generalization_type= #{generalizationType,jdbcType=VARCHAR},
  301. scenario_resume=#{scenarioResume,jdbcType=VARCHAR},
  302. scene_detailed_description=#{sceneDetailedDescription},
  303. evaluating_indicator=#{evaluatingIndicator,jdbcType=VARCHAR},
  304. video_link=#{videoLink},
  305. file_name=#{fileName},
  306. version= #{version},
  307. share=#{share},
  308. create_user_id=#{createUserId,jdbcType=VARCHAR},
  309. create_time=#{createTime},
  310. modify_time=#{modifyTime},
  311. is_deleted=#{isDeleted,jdbcType=VARCHAR},
  312. obs_type=#{obsType}
  313. where id = #{id,jdbcType=VARCHAR}
  314. </update>
  315. <select id="queryIdBySceneId" resultType="java.lang.String">
  316. select id from simulation.scene_general_template where scene_id=#{sceneId} and is_deleted='0'
  317. </select>
  318. </mapper>