SceneAccidentMapper.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. <update id="deleteSceneAccidentList" parameterType="api.common.pojo.po.scene.SceneAccidentPO">
  69. update simulation.scene_accident
  70. <set>
  71. <if test="isDeleted != null and isDeleted!=''">
  72. is_deleted = #{isDeleted,jdbcType=VARCHAR},
  73. </if>
  74. <if test="modifyUserId != null and modifyUserId!=''">
  75. modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
  76. </if>
  77. <if test="modifyTime != null">
  78. modify_time = #{modifyTime},
  79. </if>
  80. </set>
  81. where accident_id = #{accidentId,jdbcType=VARCHAR}
  82. </update>
  83. <select id="querySceneAccidentByNmae" parameterType="api.common.pojo.param.scene.SceneAccidentParam" resultType="api.common.pojo.po.scene.SceneAccidentPO">
  84. select
  85. accident_id,scene_name
  86. from simulation.scene_accident
  87. <where>
  88. is_deleted = '0'
  89. <if test="sceneName != null and sceneName != ''">
  90. and scene_name =#{sceneName,jdbcType=VARCHAR}
  91. </if>
  92. </where>
  93. </select>
  94. </mapper>