<?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.infra.db.mysql.mapper.VehicleMapper">

    <resultMap id="VehicleVOMap" type="api.common.pojo.vo.model.VehicleVO">
        <id column="ID" property="id" jdbcType="VARCHAR"/>
        <result column="vehicle_code" property="vehicleCode" jdbcType="VARCHAR"/>
        <result column="vehicle_name" property="vehicleName" jdbcType="VARCHAR"/>
        <result column="description" property="description" jdbcType="VARCHAR"/>
        <result column="vehicle_type" property="vehicleTypeStr" jdbcType="VARCHAR"/>
        <result column="model_label" property="modelLabel" jdbcType="VARCHAR"/>
        <result column="max_speed" property="maxSpeed" jdbcType="DECIMAL"/>
        <result column="engine_power" property="enginePower" jdbcType="DECIMAL"/>
        <result column="max_deceleration" property="maxDeceleration" jdbcType="DECIMAL"/>
        <result column="max_steering_angle" property="maxSteeringAngle" jdbcType="DECIMAL"/>
        <result column="mass" property="mass" jdbcType="DECIMAL"/>
        <result column="front_surface_effective" property="frontSurfaceEffective" jdbcType="DECIMAL"/>
        <result column="air_drag_coefficient" property="airDragCoefficient" jdbcType="DECIMAL"/>
        <result column="rolling_resistance_coefficient" property="rollingResistanceCoefficient" jdbcType="DECIMAL"/>
        <result column="wheel_diameter" property="wheelDiameter" jdbcType="DECIMAL"/>
        <result column="wheel_drive" property="wheelDrive" jdbcType="VARCHAR"/>
        <result column="overall_efficiency" property="overallEfficiency" jdbcType="DECIMAL"/>
        <result column="front_distance" property="frontDistance" jdbcType="DECIMAL"/>
        <result column="rear_distance" property="rearDistance" jdbcType="DECIMAL"/>
        <result column="left_distance" property="leftDistance" jdbcType="DECIMAL"/>
        <result column="right_distance" property="rightDistance" jdbcType="DECIMAL"/>
        <result column="height_distance" property="heightDistance" jdbcType="DECIMAL"/>
        <result column="wheelbase" property="wheelbase" jdbcType="DECIMAL"/>
        <result column="share" property="share" jdbcType="VARCHAR"/>
        <result column="parameter_type" property="parameterType" jdbcType="VARCHAR"/>
        <result column="wheelCenterToGround" property="wheelCenterToGround" jdbcType="VARCHAR"/>
        <result column="centroidToFrontWheelCenter" property="centroidToFrontWheelCenter" jdbcType="VARCHAR"/>
        <result column="centroidToGround" property="centroidToGround" jdbcType="VARCHAR"/>
        <result column="sprungMass" property="sprungMass" jdbcType="VARCHAR"/>
        <result column="vehicleWidth" property="vehicleWidth" jdbcType="VARCHAR"/>
        <result column="vehicleLength" property="vehicleLength" jdbcType="VARCHAR"/>
        <result column="rotationalInertiaX" property="rotationalInertiaX" jdbcType="VARCHAR"/>
        <result column="rotationalInertiaY" property="rotationalInertiaY" jdbcType="VARCHAR"/>
        <result column="rotationalInertiaZ" property="rotationalInertiaZ" jdbcType="VARCHAR"/>
        <result column="frontLeftWheelEffectiveRollingRadius" property="frontLeftWheelEffectiveRollingRadius" jdbcType="VARCHAR"/>
        <result column="frontLeftWheelRollingResistanceCoefficient" property="frontLeftWheelRollingResistanceCoefficient" jdbcType="VARCHAR"/>
        <result column="frontLeftWheelFreeRadius" property="frontLeftWheelFreeRadius" jdbcType="VARCHAR"/>
        <result column="frontLeftWheelRelationCurvePositiveMomentAndSideslipAngle" property="frontLeftWheelRelationCurvePositiveMomentAndSideslipAngleJson" jdbcType="VARCHAR"/>
        <result column="frontLeftWheelRelationCurveLateralForceAndSideslipAngle" property="frontLeftWheelRelationCurveLateralForceAndSideslipAngleJson" jdbcType="VARCHAR"/>
        <result column="frontLeftWheelRelationCurveLongitudinalForceAndSideslipAngle" property="frontLeftWheelRelationCurveLongitudinalForceAndSideslipAngleJson"
                jdbcType="VARCHAR"/>
        <result column="rearLeftWheelEffectiveRollingRadius" property="rearLeftWheelEffectiveRollingRadius" jdbcType="VARCHAR"/>
        <result column="rearLeftWheelRollingResistanceCoefficient" property="rearLeftWheelRollingResistanceCoefficient" jdbcType="VARCHAR"/>
        <result column="rearLeftWheelFreeRadius" property="rearLeftWheelFreeRadius" jdbcType="VARCHAR"/>
        <result column="rearLeftWheelRelationCurvePositiveMomentAndSideslipAngle" property="rearLeftWheelRelationCurvePositiveMomentAndSideslipAngleJson" jdbcType="VARCHAR"/>
        <result column="rearLeftWheelRelationCurveLateralForceAndSideslipAngle" property="rearLeftWheelRelationCurveLateralForceAndSideslipAngleJson" jdbcType="VARCHAR"/>
        <result column="rearLeftWheelRelationCurveLongitudinalForceAndSideslipAngle" property="rearLeftWheelRelationCurveLongitudinalForceAndSideslipAngleJson"
                jdbcType="VARCHAR"/>
        <result column="frontRightWheelEffectiveRollingRadius" property="frontRightWheelEffectiveRollingRadius" jdbcType="VARCHAR"/>
        <result column="frontRightWheelRollingResistanceCoefficient" property="frontRightWheelRollingResistanceCoefficient" jdbcType="VARCHAR"/>
        <result column="frontRightWheelFreeRadius" property="frontRightWheelFreeRadius" jdbcType="VARCHAR"/>
        <result column="frontRightWheelRelationCurvePositiveMomentAndSideslipAngle" property="frontRightWheelRelationCurvePositiveMomentAndSideslipAngleJson"
                jdbcType="VARCHAR"/>
        <result column="frontRightWheelRelationCurveLateralForceAndSideslipAngle" property="frontRightWheelRelationCurveLateralForceAndSideslipAngleJson" jdbcType="VARCHAR"/>
        <result column="frontRightWheelRelationCurveLongitudinalForceAndSideslipAngle" property="frontRightWheelRelationCurveLongitudinalForceAndSideslipAngleJson"
                jdbcType="VARCHAR"/>
        <result column="rearRightWheelEffectiveRollingRadius" property="rearRightWheelEffectiveRollingRadius" jdbcType="VARCHAR"/>
        <result column="rearRightWheelRollingResistanceCoefficient" property="rearRightWheelRollingResistanceCoefficient" jdbcType="VARCHAR"/>
        <result column="rearRightWheelFreeRadius" property="rearRightWheelFreeRadius" jdbcType="VARCHAR"/>
        <result column="rearRightWheelRelationCurvePositiveMomentAndSideslipAngle" property="rearRightWheelRelationCurvePositiveMomentAndSideslipAngleJson" jdbcType="VARCHAR"/>
        <result column="rearRightWheelRelationCurveLateralForceAndSideslipAngle" property="rearRightWheelRelationCurveLateralForceAndSideslipAngleJson" jdbcType="VARCHAR"/>
        <result column="rearRightWheelRelationCurveLongitudinalForceAndSideslipAngle" property="rearRightWheelRelationCurveLongitudinalForceAndSideslipAngleJson"
                jdbcType="VARCHAR"/>
        <result column="frontWheelSuspensionType" property="frontWheelSuspensionType" jdbcType="VARCHAR"/>
        <result column="frontWheelSuspensionKinematicsCoefficient" property="frontWheelSuspensionKinematicsCoefficient" jdbcType="VARCHAR"/>
        <result column="frontWheelUnsprungMass" property="frontWheelUnsprungMass" jdbcType="VARCHAR"/>
        <result column="frontWheelTrackWidth" property="frontWheelTrackWidth" jdbcType="VARCHAR"/>
        <result column="rearWheelSuspensionType" property="rearWheelSuspensionType" jdbcType="VARCHAR"/>
        <result column="rearWheelSuspensionKinematicsCoefficient" property="rearWheelSuspensionKinematicsCoefficient" jdbcType="VARCHAR"/>
        <result column="rearWheelUnsprungMass" property="rearWheelUnsprungMass" jdbcType="VARCHAR"/>
        <result column="rearWheelTrackWidth" property="rearWheelTrackWidth" jdbcType="VARCHAR"/>
        <result column="windwardArea" property="windwardArea" jdbcType="VARCHAR"/>
        <result column="airDensity" property="airDensity" jdbcType="VARCHAR"/>
        <result column="engineCrankshaftMomentInertia" property="engineCrankshaftMomentInertia" jdbcType="VARCHAR"/>
        <result column="idleSpeed" property="idleSpeed" jdbcType="VARCHAR"/>
        <result column="relationCurveEngineTorqueSpeedAndThrottleOpening" property="relationCurveEngineTorqueSpeedAndThrottleOpeningJson" jdbcType="VARCHAR"/>
        <result column="momentInertiaInputShaft" property="momentInertiaInputShaft" jdbcType="VARCHAR"/>
        <result column="momentInertiaOutputShaft" property="momentInertiaOutputShaft" jdbcType="VARCHAR"/>
        <result column="finalDriveRatio" property="finalDriveRatio" jdbcType="VARCHAR"/>
        <result column="transmissionEfficiency" property="transmissionEfficiency" jdbcType="VARCHAR"/>
        <result column="gearRatio" property="gearRatioJson" jdbcType="VARCHAR"/>
        <result column="inertia" property="inertiaJson" jdbcType="VARCHAR"/>
        <result column="driving" property="drivingJson" jdbcType="VARCHAR"/>
        <result column="coasting" property="coastingJson" jdbcType="VARCHAR"/>
        <result column="shiftTime" property="shiftTime" jdbcType="VARCHAR"/>
        <result column="shiftTimeUp12" property="shiftTimeUp12Json" jdbcType="VARCHAR"/>
        <result column="shiftTimeDown12" property="shiftTimeDown12Json" jdbcType="VARCHAR"/>
        <result column="shiftTimeUp23" property="shiftTimeUp23Json" jdbcType="VARCHAR"/>
        <result column="shiftTimeDown23" property="shiftTimeDown23Json" jdbcType="VARCHAR"/>
        <result column="shiftTimeUp34" property="shiftTimeUp34Json" jdbcType="VARCHAR"/>
        <result column="shiftTimeDown34" property="shiftTimeDown34Json" jdbcType="VARCHAR"/>
        <result column="shiftTimeUp45" property="shiftTimeUp45Json" jdbcType="VARCHAR"/>
        <result column="shiftTimeDown45" property="shiftTimeDown45Json" jdbcType="VARCHAR"/>
        <result column="shiftTimeUp56" property="shiftTimeUp56Json" jdbcType="VARCHAR"/>
        <result column="shiftTimeDown56" property="shiftTimeDown56Json" jdbcType="VARCHAR"/>
        <result column="brakeType" property="brakeType" jdbcType="VARCHAR"/>
        <result column="frontLeftWheelBrakingTorque" property="frontLeftWheelBrakingTorque" jdbcType="VARCHAR"/>
        <result column="rearLeftWheelBrakingTorque" property="rearLeftWheelBrakingTorque" jdbcType="VARCHAR"/>
        <result column="frontRightWheelBrakingTorque" property="frontRightWheelBrakingTorque" jdbcType="VARCHAR"/>
        <result column="rearRightWheelBrakingTorque" property="rearRightWheelBrakingTorque" jdbcType="VARCHAR"/>
        <result column="steeringType" property="steeringType" jdbcType="VARCHAR"/>
        <result column="steeringGearType" property="steeringGearType" jdbcType="VARCHAR"/>
        <result column="steeringGearRatio" property="steeringGearRatio" jdbcType="VARCHAR"/>
        <result column="relationCurveRightWheelAngleAndSteeringGearOutput" property="relationCurveRightWheelAngleAndSteeringGearOutputJson" jdbcType="VARCHAR"/>
        <result column="relationCurveLeftWheelAngleAndSteeringGearOutput" property="relationCurveLeftWheelAngleAndSteeringGearOutputJson" jdbcType="VARCHAR"/>
        <result column="wheelCenterToTop" property="wheelCenterToTop" jdbcType="VARCHAR"/>
        <result column="driver_type" property="driverType" jdbcType="VARCHAR"/>
    </resultMap>

    <select id="getVehicleList" parameterType="api.common.pojo.param.model.VehicleParam" resultMap="VehicleVOMap">
        select
        id,
        vehicle_name,
        description,
        vehicle_front_view,
        vehicle_top_view,
        parameter_type,
        share
        from model_vehicle v
        where v.is_deleted = '0'
        <if test="vehicleName != null and vehicleName != ''">
            and v.vehicle_name like CONCAT('%',#{vehicleName,jdbcType=VARCHAR},'%')
        </if>
        <if test="share != null and share != ''">
            and v.create_user_id = #{createUserId,jdbcType=VARCHAR}
            and v.share = '0'
        </if>
        <if test="share == null or share == ''">
            and (v.create_user_id = #{createUserId,jdbcType=VARCHAR} or v.share = '1')
        </if>
        order by v.create_time desc
    </select>

    <select id="selectPrivateAndPublicByCreateUserId" parameterType="api.common.pojo.param.model.VehicleParam"
            resultMap="VehicleVOMap">
        select id,
               if(share = '1', concat(vehicle_name, '（公有）'), vehicle_name) vehicle_name,
               description,
               vehicle_front_view,
               vehicle_top_view,
               parameter_type,
               share
        from model_vehicle
        where is_deleted = '0'
          and ((share = '0' and create_user_id = #{createUserId}) or (share = '1'))
        order by create_time desc
    </select>


    <select id="getVehicleInfo" parameterType="api.common.pojo.param.model.VehicleParam" resultMap="VehicleVOMap">
        select id,
               vehicle_code,
               vehicle_name,
               description,
               vehicle_type,
               model_label,
               vehicle_front_view,
               vehicle_top_view,
               max_speed,
               engine_power,
               max_deceleration,
               max_steering_angle,
               mass,
               front_surface_effective,
               air_drag_coefficient,
               rolling_resistance_coefficient,
               wheel_diameter,
               wheel_drive,
               overall_efficiency,
               front_distance,
               rear_distance,
               left_distance,
               right_distance,
               height_distance,
               wheelbase,
               share,
               parameter_type,
               driver_type,
               wheelCenterToGround,
               centroidToFrontWheelCenter,
               centroidToGround,
               sprungMass,
               vehicleWidth,
               vehicleLength,
               rotationalInertiaX,
               rotationalInertiaY,
               rotationalInertiaZ,
               frontLeftWheelEffectiveRollingRadius,
               frontLeftWheelRollingResistanceCoefficient,
               frontLeftWheelFreeRadius,
               frontLeftWheelRelationCurvePositiveMomentAndSideslipAngle,
               frontLeftWheelRelationCurveLateralForceAndSideslipAngle,
               frontLeftWheelRelationCurveLongitudinalForceAndSideslipAngle,
               rearLeftWheelEffectiveRollingRadius,
               rearLeftWheelRollingResistanceCoefficient,
               rearLeftWheelFreeRadius,
               rearLeftWheelRelationCurvePositiveMomentAndSideslipAngle,
               rearLeftWheelRelationCurveLateralForceAndSideslipAngle,
               rearLeftWheelRelationCurveLongitudinalForceAndSideslipAngle,
               frontRightWheelEffectiveRollingRadius,
               frontRightWheelRollingResistanceCoefficient,
               frontRightWheelFreeRadius,
               frontRightWheelRelationCurvePositiveMomentAndSideslipAngle,
               frontRightWheelRelationCurveLateralForceAndSideslipAngle,
               frontRightWheelRelationCurveLongitudinalForceAndSideslipAngle,
               rearRightWheelEffectiveRollingRadius,
               rearRightWheelRollingResistanceCoefficient,
               rearRightWheelFreeRadius,
               rearRightWheelRelationCurvePositiveMomentAndSideslipAngle,
               rearRightWheelRelationCurveLateralForceAndSideslipAngle,
               rearRightWheelRelationCurveLongitudinalForceAndSideslipAngle,
               frontWheelSuspensionType,
               frontWheelSuspensionKinematicsCoefficient,
               frontWheelUnsprungMass,
               frontWheelTrackWidth,
               rearWheelSuspensionType,
               rearWheelSuspensionKinematicsCoefficient,
               rearWheelUnsprungMass,
               rearWheelTrackWidth,
               windwardArea,
               airDensity,
               engineCrankshaftMomentInertia,
               idleSpeed,
               relationCurveEngineTorqueSpeedAndThrottleOpening,
               momentInertiaInputShaft,
               momentInertiaOutputShaft,
               finalDriveRatio,
               transmissionEfficiency,
               gearRatio,
               inertia,
               driving,
               coasting,
               shiftTime,
               shiftTimeUp12,
               shiftTimeDown12,
               shiftTimeUp23,
               shiftTimeDown23,
               shiftTimeUp34,
               shiftTimeDown34,
               shiftTimeUp45,
               shiftTimeDown45,
               shiftTimeUp56,
               shiftTimeDown56,
               brakeType,
               frontLeftWheelBrakingTorque,
               rearLeftWheelBrakingTorque,
               frontRightWheelBrakingTorque,
               rearRightWheelBrakingTorque,
               steeringType,
               steeringGearType,
               steeringGearRatio,
               relationCurveRightWheelAngleAndSteeringGearOutput,
               relationCurveLeftWheelAngleAndSteeringGearOutput,
               wheelCenterToTop
        from model_vehicle
        where id = #{id}
    </select>

    <select id="checkVehicleName" parameterType="api.common.pojo.po.model.VehiclePO" resultMap="VehicleVOMap">
        select
        id
        from model_vehicle v
        where v.is_deleted = '0'
        and v.vehicle_name = #{vehicleName,jdbcType=VARCHAR}
        <if test="share != null and share != ''">
            and v.share = #{share,jdbcType=VARCHAR}
        </if>
        <if test="createUserId != null and createUserId != ''">
            and v.create_user_id = #{createUserId,jdbcType=VARCHAR}
            and v.id &lt;&gt; #{id,jdbcType=VARCHAR}
        </if>
    </select>

    <insert id="insert" parameterType="api.common.pojo.po.model.VehiclePO">
        insert into model_vehicle(id,
                                  vehicle_code,
                                  vehicle_name,
                                  description,
                                  vehicle_type,
                                  model_label,
                                  vehicle_front_view,
                                  vehicle_top_view,
                                  max_speed,
                                  engine_power,
                                  max_deceleration,
                                  max_steering_angle,
                                  mass,
                                  front_surface_effective,
                                  air_drag_coefficient,
                                  rolling_resistance_coefficient,
                                  wheel_diameter,
                                  wheel_drive,
                                  overall_efficiency,
                                  front_distance,
                                  rear_distance,
                                  left_distance,
                                  right_distance,
                                  height_distance,
                                  wheelbase,
                                  share,
                                  create_time,
                                  modify_time,
                                  create_user_id,
                                  modify_user_id,
                                  is_deleted,
                                  parameter_type,
                                  driver_type,
                                  par_file_path,
                                  wheelCenterToGround, centroidToFrontWheelCenter, centroidToGround, sprungMass,
                                  vehicleWidth,
                                  vehicleLength,
                                  rotationalInertiaX, rotationalInertiaY, rotationalInertiaZ,
                                  frontLeftWheelEffectiveRollingRadius, frontLeftWheelRollingResistanceCoefficient,
                                  frontLeftWheelFreeRadius, frontLeftWheelRelationCurvePositiveMomentAndSideslipAngle,
                                  frontLeftWheelRelationCurveLateralForceAndSideslipAngle,
                                  frontLeftWheelRelationCurveLongitudinalForceAndSideslipAngle,
                                  rearLeftWheelEffectiveRollingRadius, rearLeftWheelRollingResistanceCoefficient,
                                  rearLeftWheelFreeRadius, rearLeftWheelRelationCurvePositiveMomentAndSideslipAngle,
                                  rearLeftWheelRelationCurveLateralForceAndSideslipAngle,
                                  rearLeftWheelRelationCurveLongitudinalForceAndSideslipAngle,
                                  frontRightWheelEffectiveRollingRadius, frontRightWheelRollingResistanceCoefficient,
                                  frontRightWheelFreeRadius, frontRightWheelRelationCurvePositiveMomentAndSideslipAngle,
                                  frontRightWheelRelationCurveLateralForceAndSideslipAngle,
                                  frontRightWheelRelationCurveLongitudinalForceAndSideslipAngle,
                                  rearRightWheelEffectiveRollingRadius, rearRightWheelRollingResistanceCoefficient,
                                  rearRightWheelFreeRadius, rearRightWheelRelationCurvePositiveMomentAndSideslipAngle,
                                  rearRightWheelRelationCurveLateralForceAndSideslipAngle,
                                  rearRightWheelRelationCurveLongitudinalForceAndSideslipAngle,
                                  frontWheelSuspensionType,
                                  frontWheelSuspensionKinematicsCoefficient, frontWheelUnsprungMass,
                                  frontWheelTrackWidth,
                                  rearWheelSuspensionType, rearWheelSuspensionKinematicsCoefficient,
                                  rearWheelUnsprungMass,
                                  rearWheelTrackWidth, windwardArea, airDensity, engineCrankshaftMomentInertia,
                                  idleSpeed,
                                  relationCurveEngineTorqueSpeedAndThrottleOpening, momentInertiaInputShaft,
                                  momentInertiaOutputShaft, finalDriveRatio, transmissionEfficiency, gearRatio, inertia,
                                  driving, coasting, shiftTime, shiftTimeUp12, shiftTimeDown12, shiftTimeUp23,
                                  shiftTimeDown23,
                                  shiftTimeUp34, shiftTimeDown34, shiftTimeUp45, shiftTimeDown45, shiftTimeUp56,
                                  shiftTimeDown56, brakeType, frontLeftWheelBrakingTorque, rearLeftWheelBrakingTorque,
                                  frontRightWheelBrakingTorque, rearRightWheelBrakingTorque, steeringType,
                                  steeringGearType,
                                  steeringGearRatio, relationCurveRightWheelAngleAndSteeringGearOutput,
                                  relationCurveLeftWheelAngleAndSteeringGearOutput, wheelCenterToTop)
        values (#{id,jdbcType=VARCHAR},
                #{vehicleCode,jdbcType=VARCHAR},
                #{vehicleName,jdbcType=VARCHAR},
                #{description,jdbcType=VARCHAR},
                #{vehicleType,jdbcType=VARCHAR},
                #{modelLabel,jdbcType=VARCHAR},
                #{vehicleFrontView,jdbcType=VARCHAR},
                #{vehicleTopView,jdbcType=VARCHAR},
                #{maxSpeed,jdbcType=DECIMAL},
                #{enginePower,jdbcType=DECIMAL},
                #{maxDeceleration,jdbcType=DECIMAL},
                #{maxSteeringAngle,jdbcType=DECIMAL},
                #{mass,jdbcType=DECIMAL},
                #{frontSurfaceEffective,jdbcType=DECIMAL},
                #{airDragCoefficient,jdbcType=DECIMAL},
                #{rollingResistanceCoefficient,jdbcType=DECIMAL},
                #{wheelDiameter,jdbcType=DECIMAL},
                #{wheelDrive,jdbcType=VARCHAR},
                #{overallEfficiency,jdbcType=DECIMAL},
                #{frontDistance,jdbcType=DECIMAL},
                #{rearDistance,jdbcType=DECIMAL},
                #{leftDistance,jdbcType=DECIMAL},
                #{rightDistance,jdbcType=DECIMAL},
                #{heightDistance,jdbcType=DECIMAL},
                #{wheelbase,jdbcType=DECIMAL},
                #{share,jdbcType=VARCHAR},
                #{createTime,jdbcType=TIMESTAMP},
                #{modifyTime,jdbcType=TIMESTAMP},
                #{createUserId,jdbcType=VARCHAR},
                #{modifyUserId,jdbcType=VARCHAR},
                #{isDeleted,jdbcType=VARCHAR},
                #{parameterType},
                #{driverType},
                #{parFilePath},
                #{wheelCenterToGround},
                #{centroidToFrontWheelCenter},
                #{centroidToGround},
                #{sprungMass},
                #{vehicleWidth},
                #{vehicleLength},
                #{rotationalInertiaX},
                #{rotationalInertiaY},
                #{rotationalInertiaZ},
                #{frontLeftWheelEffectiveRollingRadius},
                #{frontLeftWheelRollingResistanceCoefficient},
                #{frontLeftWheelFreeRadius},
                #{frontLeftWheelRelationCurvePositiveMomentAndSideslipAngleJson},
                #{frontLeftWheelRelationCurveLateralForceAndSideslipAngleJson},
                #{frontLeftWheelRelationCurveLongitudinalForceAndSideslipAngleJson},
                #{rearLeftWheelEffectiveRollingRadius},
                #{rearLeftWheelRollingResistanceCoefficient},
                #{rearLeftWheelFreeRadius},
                #{rearLeftWheelRelationCurvePositiveMomentAndSideslipAngleJson},
                #{rearLeftWheelRelationCurveLateralForceAndSideslipAngleJson},
                #{rearLeftWheelRelationCurveLongitudinalForceAndSideslipAngleJson},
                #{frontRightWheelEffectiveRollingRadius},
                #{frontRightWheelRollingResistanceCoefficient},
                #{frontRightWheelFreeRadius},
                #{frontRightWheelRelationCurvePositiveMomentAndSideslipAngleJson},
                #{frontRightWheelRelationCurveLateralForceAndSideslipAngleJson},
                #{frontRightWheelRelationCurveLongitudinalForceAndSideslipAngleJson},
                #{rearRightWheelEffectiveRollingRadius},
                #{rearRightWheelRollingResistanceCoefficient},
                #{rearRightWheelFreeRadius},
                #{rearRightWheelRelationCurvePositiveMomentAndSideslipAngleJson},
                #{rearRightWheelRelationCurveLateralForceAndSideslipAngleJson},
                #{rearRightWheelRelationCurveLongitudinalForceAndSideslipAngleJson},
                #{frontWheelSuspensionType},
                #{frontWheelSuspensionKinematicsCoefficient},
                #{frontWheelUnsprungMass},
                #{frontWheelTrackWidth},
                #{rearWheelSuspensionType},
                #{rearWheelSuspensionKinematicsCoefficient},
                #{rearWheelUnsprungMass},
                #{rearWheelTrackWidth},
                #{windwardArea},
                #{airDensity},
                #{engineCrankshaftMomentInertia},
                #{idleSpeed},
                #{relationCurveEngineTorqueSpeedAndThrottleOpeningJson},
                #{momentInertiaInputShaft},
                #{momentInertiaOutputShaft},
                #{finalDriveRatio},
                #{transmissionEfficiency},
                #{gearRatioJson},
                #{inertiaJson},
                #{drivingJson},
                #{coastingJson},
                #{shiftTime},
                #{shiftTimeUp12Json},
                #{shiftTimeDown12Json},
                #{shiftTimeUp23Json},
                #{shiftTimeDown23Json},
                #{shiftTimeUp34Json},
                #{shiftTimeDown34Json},
                #{shiftTimeUp45Json},
                #{shiftTimeDown45Json},
                #{shiftTimeUp56Json},
                #{shiftTimeDown56Json},
                #{brakeType},
                #{frontLeftWheelBrakingTorque},
                #{rearLeftWheelBrakingTorque},
                #{frontRightWheelBrakingTorque},
                #{rearRightWheelBrakingTorque},
                #{steeringType},
                #{steeringGearType},
                #{steeringGearRatio},
                #{relationCurveRightWheelAngleAndSteeringGearOutputJson},
                #{relationCurveLeftWheelAngleAndSteeringGearOutputJson},
                #{wheelCenterToTop})
    </insert>

    <update id="update" parameterType="api.common.pojo.po.model.VehiclePO">
        update model_vehicle
        set vehicle_name                                                  = #{vehicleName,jdbcType=VARCHAR},
            description                                                   = #{description,jdbcType=VARCHAR},
            vehicle_type                                                  = #{vehicleType,jdbcType=VARCHAR},
            model_label                                                   = #{modelLabel,jdbcType=VARCHAR},
            vehicle_front_view                                            = #{vehicleFrontView,jdbcType=VARCHAR},
            vehicle_top_view                                              = #{vehicleTopView,jdbcType=VARCHAR},
            max_speed                                                     = #{maxSpeed,jdbcType=DECIMAL},
            engine_power                                                  = #{enginePower,jdbcType=DECIMAL},
            max_deceleration                                              = #{maxDeceleration,jdbcType=DECIMAL},
            max_steering_angle                                            = #{maxSteeringAngle,jdbcType=DECIMAL},
            mass                                                          = #{mass,jdbcType=DECIMAL},
            front_surface_effective                                       = #{frontSurfaceEffective,jdbcType=DECIMAL},
            air_drag_coefficient                                          = #{airDragCoefficient,jdbcType=DECIMAL},
            rolling_resistance_coefficient                                = #{rollingResistanceCoefficient,jdbcType=DECIMAL},
            wheel_diameter                                                = #{wheelDiameter,jdbcType=DECIMAL},
            wheel_drive                                                   = #{wheelDrive,jdbcType=VARCHAR},
            overall_efficiency                                            = #{overallEfficiency,jdbcType=DECIMAL},
            front_distance                                                = #{frontDistance,jdbcType=DECIMAL},
            rear_distance                                                 = #{rearDistance,jdbcType=DECIMAL},
            left_distance                                                 = #{leftDistance,jdbcType=DECIMAL},
            right_distance                                                = #{rightDistance,jdbcType=DECIMAL},
            height_distance                                               = #{heightDistance,jdbcType=DECIMAL},
            wheelbase                                                     = #{wheelbase,jdbcType=DECIMAL},
            modify_time                                                   = #{modifyTime,jdbcType=TIMESTAMP},
            modify_user_id                                                = #{modifyUserId,jdbcType=VARCHAR},
            parameter_type                                                = #{parameterType},
            driver_type                                                   = #{driverType},
            par_file_path                                                 = #{parFilePath},
            wheelCenterToTop                                              = #{wheelCenterToTop},
            wheelCenterToGround                                           = #{wheelCenterToGround},
            centroidToFrontWheelCenter                                    = #{centroidToFrontWheelCenter},
            centroidToGround                                              = #{centroidToGround},
            sprungMass                                                    = #{sprungMass},
            vehicleWidth                                                  = #{vehicleWidth},
            vehicleLength                                                 = #{vehicleLength},
            rotationalInertiaX                                            = #{rotationalInertiaX},
            rotationalInertiaY                                            = #{rotationalInertiaY},
            rotationalInertiaZ                                            = #{rotationalInertiaZ},
            frontLeftWheelEffectiveRollingRadius                          = #{frontLeftWheelEffectiveRollingRadius},
            frontLeftWheelRollingResistanceCoefficient                    = #{frontLeftWheelRollingResistanceCoefficient},
            frontLeftWheelFreeRadius                                      = #{frontLeftWheelFreeRadius},
            frontLeftWheelRelationCurvePositiveMomentAndSideslipAngle     = #{frontLeftWheelRelationCurvePositiveMomentAndSideslipAngleJson},
            frontLeftWheelRelationCurveLateralForceAndSideslipAngle       = #{frontLeftWheelRelationCurveLateralForceAndSideslipAngleJson},
            frontLeftWheelRelationCurveLongitudinalForceAndSideslipAngle  = #{frontLeftWheelRelationCurveLongitudinalForceAndSideslipAngleJson},
            rearLeftWheelEffectiveRollingRadius                           = #{rearLeftWheelEffectiveRollingRadius},
            rearLeftWheelRollingResistanceCoefficient                     = #{rearLeftWheelRollingResistanceCoefficient},
            rearLeftWheelFreeRadius                                       = #{rearLeftWheelFreeRadius},
            rearLeftWheelRelationCurvePositiveMomentAndSideslipAngle      = #{rearLeftWheelRelationCurvePositiveMomentAndSideslipAngleJson},
            rearLeftWheelRelationCurveLateralForceAndSideslipAngle        = #{rearLeftWheelRelationCurveLateralForceAndSideslipAngleJson},
            rearLeftWheelRelationCurveLongitudinalForceAndSideslipAngle   = #{rearLeftWheelRelationCurveLongitudinalForceAndSideslipAngleJson},
            frontRightWheelEffectiveRollingRadius                         = #{frontRightWheelEffectiveRollingRadius},
            frontRightWheelRollingResistanceCoefficient                   = #{frontRightWheelRollingResistanceCoefficient},
            frontRightWheelFreeRadius                                     = #{frontRightWheelFreeRadius},
            frontRightWheelRelationCurvePositiveMomentAndSideslipAngle    = #{frontRightWheelRelationCurvePositiveMomentAndSideslipAngleJson},
            frontRightWheelRelationCurveLateralForceAndSideslipAngle      = #{frontRightWheelRelationCurveLateralForceAndSideslipAngleJson},
            frontRightWheelRelationCurveLongitudinalForceAndSideslipAngle = #{frontRightWheelRelationCurveLongitudinalForceAndSideslipAngleJson},
            rearRightWheelEffectiveRollingRadius                          = #{rearRightWheelEffectiveRollingRadius},
            rearRightWheelRollingResistanceCoefficient                    = #{rearRightWheelRollingResistanceCoefficient},
            rearRightWheelFreeRadius                                      = #{rearRightWheelFreeRadius},
            rearRightWheelRelationCurvePositiveMomentAndSideslipAngle     = #{rearRightWheelRelationCurvePositiveMomentAndSideslipAngleJson},
            rearRightWheelRelationCurveLateralForceAndSideslipAngle       = #{rearRightWheelRelationCurveLateralForceAndSideslipAngleJson},
            rearRightWheelRelationCurveLongitudinalForceAndSideslipAngle  = #{rearRightWheelRelationCurveLongitudinalForceAndSideslipAngleJson},
            frontWheelSuspensionType                                      = #{frontWheelSuspensionType},
            frontWheelSuspensionKinematicsCoefficient                     = #{frontWheelSuspensionKinematicsCoefficient},
            frontWheelUnsprungMass                                        = #{frontWheelUnsprungMass},
            frontWheelTrackWidth                                          = #{frontWheelTrackWidth},
            rearWheelSuspensionType                                       = #{rearWheelSuspensionType},
            rearWheelSuspensionKinematicsCoefficient                      = #{rearWheelSuspensionKinematicsCoefficient},
            rearWheelUnsprungMass                                         = #{rearWheelUnsprungMass},
            rearWheelTrackWidth                                           = #{rearWheelTrackWidth},
            windwardArea                                                  = #{windwardArea},
            airDensity                                                    = #{airDensity},
            engineCrankshaftMomentInertia                                 = #{engineCrankshaftMomentInertia},
            idleSpeed                                                     = #{idleSpeed},
            relationCurveEngineTorqueSpeedAndThrottleOpening              = #{relationCurveEngineTorqueSpeedAndThrottleOpeningJson},
            momentInertiaInputShaft                                       = #{momentInertiaInputShaft},
            momentInertiaOutputShaft                                      = #{momentInertiaOutputShaft},
            finalDriveRatio                                               = #{finalDriveRatio},
            transmissionEfficiency                                        = #{transmissionEfficiency},
            gearRatio                                                     = #{gearRatioJson},
            inertia                                                       = #{inertiaJson},
            driving                                                       = #{drivingJson},
            coasting                                                      = #{coastingJson},
            shiftTime                                                     = #{shiftTime},
            shiftTimeUp12                                                 = #{shiftTimeUp12Json},
            shiftTimeDown12                                               = #{shiftTimeDown12Json},
            shiftTimeUp23                                                 = #{shiftTimeUp23Json},
            shiftTimeDown23                                               = #{shiftTimeDown23Json},
            shiftTimeUp34                                                 = #{shiftTimeUp34Json},
            shiftTimeDown34                                               = #{shiftTimeDown34Json},
            shiftTimeUp45                                                 = #{shiftTimeUp45Json},
            shiftTimeDown45                                               = #{shiftTimeDown45Json},
            shiftTimeUp56                                                 = #{shiftTimeUp56Json},
            shiftTimeDown56                                               = #{shiftTimeDown56Json},
            brakeType                                                     = #{brakeType},
            frontLeftWheelBrakingTorque                                   = #{frontLeftWheelBrakingTorque},
            rearLeftWheelBrakingTorque                                    = #{rearLeftWheelBrakingTorque},
            frontRightWheelBrakingTorque                                  = #{frontRightWheelBrakingTorque},
            rearRightWheelBrakingTorque                                   = #{rearRightWheelBrakingTorque},
            steeringType                                                  = #{steeringType},
            steeringGearType                                              = #{steeringGearType},
            steeringGearRatio                                             = #{steeringGearRatio},
            relationCurveRightWheelAngleAndSteeringGearOutput             = #{relationCurveRightWheelAngleAndSteeringGearOutputJson},
            relationCurveLeftWheelAngleAndSteeringGearOutput              = #{relationCurveLeftWheelAngleAndSteeringGearOutputJson}
        where id = #{id,jdbcType=VARCHAR}
    </update>

    <update id="delVehicleById" parameterType="api.common.pojo.po.model.VehiclePO">
        update model_vehicle
        set modify_time    = #{modifyTime,jdbcType=TIMESTAMP},
            modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
            is_deleted     = #{isDeleted,jdbcType=VARCHAR}
        where id = #{id,jdbcType=VARCHAR}
    </update>

    <select id="selectPrivateAndPublicByCreateUserIdGy" parameterType="api.common.pojo.param.model.VehicleParam"
            resultMap="VehicleVOMap">
        select id,
               vehicle_name,
               description,
               vehicle_front_view,
               vehicle_top_view,
               parameter_type,
               share
        from model_vehicle
        where is_deleted = '0'
          and share = '1'
        order by create_time desc
    </select>
    <select id="selectPrivateAndPublicByCreateUserIdSy" parameterType="api.common.pojo.param.model.VehicleParam"
            resultMap="VehicleVOMap">
        select id,
               vehicle_name,
               description,
               vehicle_front_view,
               vehicle_top_view,
               parameter_type,
               share
        from model_vehicle
        where is_deleted = '0'
          and share = '0' and create_user_id = #{createUserId}
        order by create_time desc
    </select>
</mapper>
