SimulationProjectTaskMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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.project.mapper.SimulationProjectTaskMapper" >
  4. <!--查询任务列表-->
  5. <select id="selectprojectTaskByQuery" parameterType="api.common.pojo.param.project.ProjectTaskParam" resultType="api.common.pojo.po.project.ManualProjectTaskPo">
  6. select *
  7. from simulation_manual_project_task
  8. <where>
  9. is_deleted = '0'
  10. <if test="id != null and id != ''">
  11. and id = #{id,jdbcType=VARCHAR}
  12. </if>
  13. <if test="pId != null and pId != ''">
  14. and p_id = #{pId,jdbcType=VARCHAR}
  15. </if>
  16. <if test="sceneId != null and sceneId != ''">
  17. and scene_id = #{sceneId,jdbcType=VARCHAR}
  18. </if>
  19. </where>
  20. </select>
  21. <!--根据项目id查询任务列表-->
  22. <select id="selectProjectTaskByProjectId" parameterType="api.common.pojo.param.project.ProjectTaskParam" resultType="api.common.pojo.vo.project.ManualProjectTaskVo">
  23. select *
  24. from simulation_manual_project_task
  25. where is_deleted = '0' and p_id = #{pId,jdbcType=VARCHAR}
  26. </select>
  27. <!--根据项目id查询任务列表总数-->
  28. <select id="selectProjectTaskNumByProjectId" parameterType="api.common.pojo.param.project.ProjectTaskParam" resultType="int">
  29. select count(*) as num
  30. from simulation_manual_project_task
  31. where is_deleted = '0' and p_id = #{pId,jdbcType=VARCHAR}
  32. </select>
  33. <!--根据任务运行状态分组查询统计数量-->
  34. <select id="selectRunStateCount" parameterType="string" resultType="api.common.pojo.vo.project.ProjectRunStateNumVo">
  35. select run_state as stateName, count(*) as num
  36. from simulation_manual_project_task
  37. where p_id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  38. group by run_state
  39. </select>
  40. <!--根据任务运行状态分组查询统计数量-->
  41. <select id="selectRunResultCount" parameterType="string" resultType="api.common.pojo.vo.project.ProjectRunResultRatioNumVo">
  42. select run_result as resultName, count(*) as num
  43. from simulation_manual_project_task
  44. where p_id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  45. group by run_result
  46. </select>
  47. <!--运行任务状态-->
  48. <select id="selectRunTaskByState" parameterType="java.util.Map" resultType="java.util.Map">
  49. select count(run_state) num,run_state runState from simulation_manual_project_task
  50. where
  51. is_deleted = '0'
  52. <if test="createUserId != null and createUserId != ''">
  53. and create_user_id=#{createUserId,jdbcType=VARCHAR}
  54. </if>
  55. group by run_state
  56. </select>
  57. <!--查询某天运行任务数量-->
  58. <select id="selectRunTaskBySy" parameterType="java.util.Map" resultType="java.lang.Integer">
  59. select count(id) from simulation_manual_project_task
  60. where
  61. is_deleted = '0'
  62. <if test="createUserId != null and createUserId != ''">
  63. and create_user_id=#{createUserId,jdbcType=VARCHAR}
  64. </if>
  65. <if test="startDate != null">
  66. and run_start_time &gt;= #{startDate}
  67. </if>
  68. <if test="endDate != null">
  69. and run_start_time &lt;= #{endDate}
  70. </if>
  71. </select>
  72. <!--查询场景不等于0的得分的数量-->
  73. <select id="selectSceneScoreNumQuery" parameterType="api.common.pojo.po.project.SimulationMptSceneScorePo" resultType="api.common.pojo.vo.project.SceneScoreVo">
  74. select count(*) as num
  75. from simulation_manual_project_task
  76. where p_id = #{pId,jdbcType=VARCHAR} and last_targer_id = #{lastTargerId}
  77. and score != 0 and is_deleted = '0'
  78. </select>
  79. <!--批量查询场景得分-->
  80. <select id="selectSceneScoreByIds" parameterType="api.common.pojo.param.project.SceneScoreParam" resultType="api.common.pojo.vo.project.SceneScoreVo">
  81. select id, scene_id, scene_type,score, target_evaluate, return_scene_id, score_explain
  82. from simulation_manual_project_task
  83. where p_id = #{pId,jdbcType=VARCHAR} and scene_type = #{sceneType,jdbcType=VARCHAR}
  84. and last_targer_id = #{lastTargerId,jdbcType=VARCHAR} and is_deleted = '0'
  85. and scene_id in
  86. <foreach collection="sceneIds" open="(" separator="," close=")" item="id">
  87. #{id,jdbcType=VARCHAR}
  88. </foreach>
  89. </select>
  90. <!--更新仿真结果到数据库-->
  91. <update id="updateTaksResult" parameterType="api.common.pojo.po.project.ManualProjectTaskPo">
  92. update simulation_manual_project_task
  93. set
  94. mileage = #{mileage, jdbcType=VARCHAR},
  95. average_velocity = #{averageVelocity, jdbcType=VARCHAR},
  96. maximun_speed = #{maximunSpeed, jdbcType=VARCHAR},
  97. minimun_velocity = #{minimunVelocity, jdbcType=VARCHAR},
  98. maximum_acceleration = #{maximumAcceleration, jdbcType=VARCHAR},
  99. maximum_deceleration = #{maximumDeceleration, jdbcType=VARCHAR},
  100. maximum_swingSpeed = #{maximumSwingSpeed, jdbcType=VARCHAR},
  101. speed_variance = #{speedVariance, jdbcType=VARCHAR},
  102. swing_speed_mean_square_root = #{swingSpeedMeanSquareRoot, jdbcType=VARCHAR},
  103. acceleration = #{acceleration, jdbcType=LONGVARCHAR},
  104. lane_offset = #{laneOffset, jdbcType=LONGVARCHAR},
  105. brake = #{brake, jdbcType=LONGVARCHAR},
  106. steeting_wheel = #{steetingWheel, jdbcType=LONGVARCHAR},
  107. throttle = #{throttle, jdbcType=LONGVARCHAR},
  108. yaw_rate = #{yawRate, jdbcType=LONGVARCHAR},
  109. velocity = #{velocity, jdbcType=LONGVARCHAR},
  110. other_curve = #{otherCurve, jdbcType=LONGVARCHAR},
  111. timer_shaft = #{timerShaft, jdbcType=LONGVARCHAR}
  112. where id = #{id, jdbcType=VARCHAR} and p_id = #{pId, jdbcType=VARCHAR} and is_deleted = '0'
  113. </update>
  114. </mapper>