123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.css.simulation.resource.server.infrastructure.mysql.mapper.SimulationProjectTaskMapper">
- <!--查询任务列表-->
- <select id="selectProjectTask" parameterType="api.common.pojo.param.project.ProjectTaskParam"
- resultType="api.common.pojo.po.project.ManualProjectTaskPO">
- select id,
- p_id,
- last_targer_id,
- scene_id,
- scene_name,
- scene_type,
- run_start_time,
- run_end_time,
- run_state,
- run_result,
- run_result_file_path,
- score,
- target_evaluate,
- return_scene_id,
- score_explain,
- mileage,
- average_velocity,
- maximun_speed,
- minimun_velocity,
- maximum_acceleration,
- maximum_deceleration,
- maximum_swingSpeed,
- speed_variance,
- speed_comfort_level,
- swing_speed_mean_square_root,
- swing_comfort_level,
- acceleration,
- lane_offset,
- brake,
- steeting_wheel,
- throttle,
- yaw_rate,
- velocity,
- other_curve,
- timer_shaft,
- create_time,
- create_user_id,
- modify_time,
- modify_user_id,
- is_deleted,
- retry_count
- from simulation_manual_project_task
- <where>
- is_deleted = '0'
- <if test="id != null and id != ''">
- and id = #{id,jdbcType=VARCHAR}
- </if>
- <if test="pId != null and pId != ''">
- and p_id = #{pId,jdbcType=VARCHAR}
- </if>
- <if test="sceneId != null and sceneId != ''">
- and scene_id = #{sceneId,jdbcType=VARCHAR}
- </if>
- </where>
- </select>
- <!--根据项目id查询任务列表-->
- <select id="selectProjectTaskByProjectId" parameterType="api.common.pojo.param.project.ProjectTaskParam"
- resultType="api.common.pojo.vo.project.ManualProjectTaskVo">
- select id,
- p_id,
- last_targer_id,
- scene_id,
- scene_name,
- scene_type,
- run_start_time,
- run_end_time,
- run_state,
- run_result,
- run_result_file_path,
- score,
- target_evaluate,
- return_scene_id,
- score_explain,
- mileage,
- average_velocity,
- maximun_speed,
- minimun_velocity,
- maximum_acceleration,
- maximum_deceleration,
- maximum_swingSpeed,
- speed_variance,
- speed_comfort_level,
- swing_speed_mean_square_root,
- swing_comfort_level,
- acceleration,
- lane_offset,
- brake,
- steeting_wheel,
- throttle,
- yaw_rate,
- velocity,
- other_curve,
- timer_shaft,
- create_time,
- create_user_id,
- modify_time,
- modify_user_id,
- is_deleted,
- retry_count
- from simulation_manual_project_task
- where is_deleted = '0' and p_id = #{pId,jdbcType=VARCHAR}
- <if test="taskId != null and taskId != ''">
- and id = #{taskId, jdbcType=VARCHAR}
- </if>
- order by run_start_time desc
- </select>
- <!--根据项目id查询任务列表总数-->
- <select id="selectProjectTaskNumByProjectId" parameterType="api.common.pojo.param.project.ProjectTaskParam"
- resultType="int">
- select count(*) as num
- from simulation_manual_project_task
- where is_deleted = '0'
- and p_id = #{pId,jdbcType=VARCHAR}
- </select>
- <!--根据任务运行状态分组查询统计数量-->
- <select id="selectRunStateCount" parameterType="string"
- resultType="api.common.pojo.vo.project.ProjectRunStateNumVo">
- select run_state as stateName, count(*) as num
- from simulation_manual_project_task
- where p_id = #{id,jdbcType=VARCHAR}
- and is_deleted = '0'
- group by run_state
- </select>
- <!--根据任务运行状态分组查询统计数量-->
- <select id="selectRunResultCount" parameterType="string"
- resultType="api.common.pojo.vo.project.ProjectRunResultRatioNumVo">
- select run_result as resultName, count(*) as num
- from simulation_manual_project_task
- where p_id = #{id,jdbcType=VARCHAR}
- and is_deleted = '0'
- and run_result is not null
- and run_result != ""
- group by run_result
- </select>
- <!--任务得分统计分组-->
- <select id="selectScoreCount" parameterType="string"
- resultType="api.common.pojo.vo.project.ProjectRunResultRatioNumVo">
- select score as resultName, count(*) as num
- from simulation_manual_project_task
- where p_id = #{id,jdbcType=VARCHAR}
- and is_deleted = '0'
- group by score
- </select>
- <!--运行任务状态-->
- <select id="selectRunTaskByState" parameterType="java.util.Map" resultType="java.util.Map">
- select count(1) num, smpt.run_state runState
- from simulation_manual_project_task smpt
- left join simulation_manual_project smp on smpt.p_id = smp.id
- left join simulation_automatic_subproject sas on smpt.p_id = sas.id
- where smpt.is_deleted = '0'
- and (smp.is_deleted = '0' or sas.is_deleted = '0')
- <if test="createUserId != null and createUserId != ''">
- and smpt.create_user_id = #{createUserId}
- </if>
- group by smpt.run_state
- </select>
- <!--查询场景不等于0的得分的数量-->
- <select id="selectSceneScoreNumQuery" parameterType="api.common.pojo.po.project.SimulationMptSceneScorePO"
- resultType="api.common.pojo.vo.project.SceneScoreVo">
- select count(*) as num
- from simulation_manual_project_task
- where p_id = #{pId,jdbcType=VARCHAR}
- and last_targer_id = #{lastTargerId}
- and score != 0 and is_deleted = '0'
- </select>
- <!--批量查询场景得分-->
- <select id="selectSceneScoreByIds" parameterType="api.common.pojo.param.project.SceneScoreParam"
- resultType="api.common.pojo.vo.project.SceneScoreVo">
- select id, scene_id, scene_type,score, target_evaluate, return_scene_id, score_explain
- from simulation_manual_project_task
- where p_id = #{pId,jdbcType=VARCHAR} and scene_type = #{sceneType,jdbcType=VARCHAR}
- and last_targer_id = #{lastTargerId,jdbcType=VARCHAR} and is_deleted = '0'
- and scene_id in
- <foreach collection="sceneIds" open="(" separator="," close=")" item="id">
- #{id,jdbcType=VARCHAR}
- </foreach>
- </select>
- <!--更新仿真结果到数据库-->
- <update id="updateTaksResult" parameterType="api.common.pojo.po.project.ManualProjectTaskPO">
- update simulation_manual_project_task
- set mileage = #{mileage, jdbcType=VARCHAR},
- average_velocity = #{averageVelocity, jdbcType=VARCHAR},
- maximun_speed = #{maximunSpeed, jdbcType=VARCHAR},
- minimun_velocity = #{minimunVelocity, jdbcType=VARCHAR},
- maximum_acceleration = #{maximumAcceleration, jdbcType=VARCHAR},
- maximum_deceleration = #{maximumDeceleration, jdbcType=VARCHAR},
- maximum_swingSpeed = #{maximumSwingSpeed, jdbcType=VARCHAR},
- speed_variance = #{speedVariance, jdbcType=VARCHAR},
- swing_speed_mean_square_root = #{swingSpeedMeanSquareRoot, jdbcType=VARCHAR},
- acceleration = #{acceleration, jdbcType=LONGVARCHAR},
- lane_offset = #{laneOffset, jdbcType=LONGVARCHAR},
- brake = #{brake, jdbcType=LONGVARCHAR},
- steeting_wheel = #{steetingWheel, jdbcType=LONGVARCHAR},
- throttle = #{throttle, jdbcType=LONGVARCHAR},
- yaw_rate = #{yawRate, jdbcType=LONGVARCHAR},
- velocity = #{velocity, jdbcType=LONGVARCHAR},
- other_curve = #{otherCurve, jdbcType=LONGVARCHAR},
- timer_shaft = #{timerShaft, jdbcType=LONGVARCHAR}
- where id = #{id, jdbcType=VARCHAR}
- and p_id = #{pId, jdbcType=VARCHAR}
- and is_deleted = '0'
- </update>
- <!--查询Aborted的数量-->
- <select id="selectRunStateByAborted" parameterType="api.common.pojo.po.project.SimulationMptSceneScorePO"
- resultType="api.common.pojo.vo.project.SceneScoreVo">
- select count(*) as num
- from simulation_manual_project_task
- where p_id = #{pId,jdbcType=VARCHAR}
- and run_state = 'Aborted'
- and is_deleted = '0'
- </select>
- <select id="selectProjectTaskById" parameterType="string"
- resultType="api.common.pojo.vo.project.ManualProjectTaskVo">
- select *
- from simulation_manual_project_task
- where id = #{id}
- </select>
- </mapper>
|