SceneAccidentMapper.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.SceneAccidentMapper" >
  4. <insert id="saveSceneAccident" parameterType="api.common.pojo.po.scene.SceneAccidentPO">
  5. insert into simulation.scene_accident
  6. (accident_id,scene_name,self_driving,target_driving,
  7. self_reaction,conflict_behavior,conflict_type,
  8. create_user_id,create_time,modify_user_id,modify_time,
  9. is_deleted,share,video_preview,video_address,osgb_address,xml_address,xodr_address,
  10. json_address)
  11. values (#{accidentId,jdbcType=VARCHAR},#{sceneName,jdbcType=VARCHAR},#{selfDriving,jdbcType=VARCHAR}, #{targetDriving,jdbcType=VARCHAR},
  12. #{selfReaction,jdbcType=VARCHAR}, #{conflictBehavior,jdbcType=VARCHAR},#{conflictType,jdbcType=VARCHAR},
  13. #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
  14. #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR},#{videoPreview,jdbcType=VARCHAR},#{videoAddress,jdbcType=VARCHAR},#{osgbAddress,jdbcType=VARCHAR},
  15. #{xmlAddress,jdbcType=VARCHAR}, #{xodrAddress,jdbcType=VARCHAR},#{jsonAddress,jdbcType=VARCHAR})
  16. </insert>
  17. <select id="querySceneAccidentList" parameterType="api.common.pojo.param.scene.SceneAccidentParam" resultType="api.common.pojo.po.scene.SceneAccidentPO">
  18. select
  19. accident_id,scene_name,self_driving,target_driving,
  20. self_reaction,conflict_behavior,conflict_type,
  21. create_user_id,create_time,modify_user_id,modify_time,
  22. is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
  23. json_address
  24. from simulation.scene_accident
  25. <where>
  26. is_deleted = '0'
  27. <if test="sceneName != null and sceneName != ''">
  28. and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
  29. </if>
  30. <if test="selfDriving != null and selfDriving.length != 0 ">
  31. and self_driving in
  32. <foreach collection="selfDriving" item="item" index="index"
  33. separator="," open="(" close=")">
  34. #{item}
  35. </foreach>
  36. </if>
  37. <if test="targetDriving != null and targetDriving.length != 0">
  38. and target_driving in
  39. <foreach collection="targetDriving" item="item" index="index"
  40. separator="," open="(" close=")">
  41. #{item}
  42. </foreach>
  43. </if>
  44. <if test="selfReaction != null and selfReaction.length != 0">
  45. and self_reaction in
  46. <foreach collection="selfReaction" item="item" index="index"
  47. separator="," open="(" close=")">
  48. #{item}
  49. </foreach>
  50. </if>
  51. <if test="conflictBehavior != null and conflictBehavior.length != 0">
  52. and conflict_behavior in
  53. <foreach collection="conflictBehavior" item="item" index="index"
  54. separator="," open="(" close=")">
  55. #{item}
  56. </foreach>
  57. </if>
  58. <if test="conflictType != null and conflictType.length != 0">
  59. and conflict_type in
  60. <foreach collection="conflictType" item="item" index="index"
  61. separator="," open="(" close=")">
  62. #{item}
  63. </foreach>
  64. </if>
  65. order by create_time desc
  66. </where>
  67. </select>
  68. </mapper>