From 91b4d899403587e6982c6f76674307cd5612b17b Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 26 十月 2025 18:53:07 +0800
Subject: [PATCH] feat: 任务状态
---
ruoyi-system/src/main/resources/mapper/system/VehicleInfoMapper.xml | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/VehicleInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/VehicleInfoMapper.xml
index b6bbf51..e44b722 100644
--- a/ruoyi-system/src/main/resources/mapper/system/VehicleInfoMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/VehicleInfoMapper.xml
@@ -39,11 +39,30 @@
<if test="vehicleModel != null and vehicleModel != ''"> and v.vehicle_model = #{vehicleModel}</if>
<if test="status != null and status != ''"> and v.status = #{status}</if>
<if test="platformCode != null and platformCode != ''"> and v.platform_code = #{platformCode}</if>
- <if test="deptId != null"> and v.dept_id = #{deptId}</if>
+ <!-- 閮ㄩ棬杩囨护锛氳嚜鍔ㄦ煡鎵句紶鍏ラ儴闂ㄦ墍灞炵殑鍒嗗叕鍙革紙parent_id=100锛� -->
+ <if test="deptId != null">
+ and v.dept_id = (
+ <!-- 濡傛灉浼犲叆鐨勫氨鏄垎鍏徃锛坧arent_id=100锛夛紝鐩存帴杩斿洖 -->
+ select case
+ when exists(select 1 from sys_dept where dept_id = #{deptId} and parent_id = 100) then #{deptId}
+ else (
+ <!-- 鍚﹀垯浠� ancestors 涓煡鎵惧垎鍏徃ID -->
+ select d.dept_id
+ from sys_dept d
+ where d.parent_id = 100
+ and FIND_IN_SET(d.dept_id, (
+ select ancestors from sys_dept where dept_id = #{deptId}
+ ))
+ limit 1
+ )
+ end
+ )
+ </if>
<!-- 浠诲姟杞﹁締閫夋嫨蹇呴』杩囨护锛氬彧鏄剧ずcar_id鍜宒ept_id閮戒笉涓虹┖鐨勮溅杈� -->
and v.car_id is not null and v.car_id != ''
and v.dept_id is not null
and v.status=0
+
</where>
</select>
@@ -56,6 +75,11 @@
<include refid="selectVehicleInfoVo"/>
where v.vehicle_no = #{plateNumber}
</select>
+
+ <select id="selectVehicleInfoByVehicleNo" parameterType="String" resultMap="VehicleInfoResult">
+ <include refid="selectVehicleInfoVo"/>
+ where v.vehicle_no = #{vehicleNo}
+ </select>
<insert id="insertVehicleInfo" parameterType="VehicleInfo" useGeneratedKeys="true" keyProperty="vehicleId">
insert into tb_vehicle_info
--
Gitblit v1.9.1