From a296c6bfa83cd0a4bbc92d93c015a010248e8455 Mon Sep 17 00:00:00 2001 From: wanglizhong <wlz> Date: 星期六, 03 五月 2025 19:49:45 +0800 Subject: [PATCH] feat:增加gps显示 --- ruoyi-system/src/main/resources/mapper/system/VehicleInfoMapper.xml | 38 +++++++++++++++++++++++--------------- 1 files changed, 23 insertions(+), 15 deletions(-) diff --git a/ruoyi-system/src/main/resources/mapper/system/VehicleInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/VehicleInfoMapper.xml index 844a0f5..fada6a4 100644 --- a/ruoyi-system/src/main/resources/mapper/system/VehicleInfoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/VehicleInfoMapper.xml @@ -6,26 +6,29 @@ <resultMap type="VehicleInfo" id="VehicleInfoResult"> <result property="vehicleId" column="vehicle_id" /> + <result property="deviceId" column="device_id" /> <result property="vehicleNo" column="vehicle_no" /> - <result property="vehicleType" column="vehicle_type" /> - <result property="vehicleBrand" column="vehicle_brand" /> - <result property="vehicleModel" column="vehicle_model" /> - <result property="status" column="status" /> - <result property="createBy" column="create_by" /> - <result property="createTime" column="create_time" /> - <result property="updateBy" column="update_by" /> - <result property="updateTime" column="update_time" /> - <result property="remark" column="remark" /> + <result property="vehicleType" column="vehicle_type" /> + <result property="vehicleBrand" column="vehicle_brand" /> + <result property="vehicleModel" column="vehicle_model" /> + <result property="status" column="status" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="remark" column="remark" /> </resultMap> <sql id="selectVehicleInfoVo"> - select vehicle_id, vehicle_no, vehicle_type, vehicle_brand, vehicle_model, status, create_by, create_time, update_by, update_time, remark from tb_vehicle_info + select vehicle_id, device_id, vehicle_no, vehicle_type, vehicle_brand, vehicle_model, status, create_by, create_time, update_by, update_time, remark + from tb_vehicle_info </sql> <select id="selectVehicleInfoList" parameterType="VehicleInfo" resultMap="VehicleInfoResult"> <include refid="selectVehicleInfoVo"/> <where> - <if test="vehicleNo != null and vehicleNo != ''"> and vehicle_no like concat('%', #{vehicleNo}, '%')</if> + <if test="vehicleNo != null and vehicleNo != ''"> and vehicle_no = #{vehicleNo}</if> + <if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if> <if test="vehicleType != null and vehicleType != ''"> and vehicle_type = #{vehicleType}</if> <if test="vehicleBrand != null and vehicleBrand != ''"> and vehicle_brand = #{vehicleBrand}</if> <if test="vehicleModel != null and vehicleModel != ''"> and vehicle_model = #{vehicleModel}</if> @@ -37,10 +40,16 @@ <include refid="selectVehicleInfoVo"/> where vehicle_id = #{vehicleId} </select> + + <select id="selectVehicleInfoByPlateNumber" parameterType="String" resultMap="VehicleInfoResult"> + <include refid="selectVehicleInfoVo"/> + where vehicle_no = #{plateNumber} + </select> <insert id="insertVehicleInfo" parameterType="VehicleInfo" useGeneratedKeys="true" keyProperty="vehicleId"> insert into tb_vehicle_info <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="deviceId != null">device_id,</if> <if test="vehicleNo != null">vehicle_no,</if> <if test="vehicleType != null">vehicle_type,</if> <if test="vehicleBrand != null">vehicle_brand,</if> @@ -53,6 +62,7 @@ <if test="remark != null">remark,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="deviceId != null">#{deviceId},</if> <if test="vehicleNo != null">#{vehicleNo},</if> <if test="vehicleType != null">#{vehicleType},</if> <if test="vehicleBrand != null">#{vehicleBrand},</if> @@ -69,16 +79,14 @@ <update id="updateVehicleInfo" parameterType="VehicleInfo"> update tb_vehicle_info <trim prefix="SET" suffixOverrides=","> + <if test="deviceId != null">device_id = #{deviceId},</if> <if test="vehicleNo != null">vehicle_no = #{vehicleNo},</if> <if test="vehicleType != null">vehicle_type = #{vehicleType},</if> <if test="vehicleBrand != null">vehicle_brand = #{vehicleBrand},</if> <if test="vehicleModel != null">vehicle_model = #{vehicleModel},</if> <if test="status != null">status = #{status},</if> - <if test="createBy != null">create_by = #{createBy},</if> - <if test="createTime != null">create_time = #{createTime},</if> <if test="updateBy != null">update_by = #{updateBy},</if> - <if test="updateTime != null">update_time = #{updateTime},</if> - <if test="remark != null">remark = #{remark},</if> + update_time = sysdate() </trim> where vehicle_id = #{vehicleId} </update> -- Gitblit v1.9.1