123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?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.project.mapper.SimulationProjectTaskMapper" >
- <!--查询任务列表-->
- <select id="selectprojectTaskByQuery" parameterType="api.common.pojo.param.project.ProjectTaskParam" resultType="api.common.pojo.po.project.ManualProjectTaskPo">
- select *
- 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 *
- from simulation_manual_project_task
- where is_deleted = '0' and p_id = #{pId,jdbcType=VARCHAR}
- </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'
- group by run_result
- </select>
- <!--运行任务状态-->
- <select id="selectRunTaskByState" parameterType="java.util.Map" resultType="java.util.Map">
- select count(run_state) num,run_state runState from simulation_manual_project_task
- where
- is_deleted = '0'
- <if test="createUserId != null and createUserId != ''">
- and create_user_id=#{createUserId,jdbcType=VARCHAR}
- </if>
- group by run_state
- </select>
- <!--查询某天运行任务数量-->
- <select id="selectRunTaskBySy" parameterType="java.util.Map" resultType="java.lang.Integer">
- select count(id) from simulation_manual_project_task
- where
- is_deleted = '0'
- <if test="createUserId != null and createUserId != ''">
- and create_user_id=#{createUserId,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null">
- and run_start_time >= #{startDate}
- </if>
- <if test="endDate != null">
- and run_start_time <= #{endDate}
- </if>
- </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>
- </mapper>
|