wenhongquan 6 miesięcy temu
rodzic
commit
91551791ca

+ 1 - 3
ruoyi-modules/ruoyi-dzbc/src/main/java/org/dromara/system/service/impl/TblDzbcDriverTripServiceImpl.java

@@ -47,9 +47,7 @@ public class TblDzbcDriverTripServiceImpl implements ITblDzbcDriverTripService {
 
     @Override
     public TblDzbcDriverTripVo queryByTripNo(String tripNo) {
-        // 使用 LambdaQueryWrapper 替代未实现的 XML 方法 selectByTripNo
-        TblDzbcDriverTripVo vo = baseMapper.selectVoOne(new LambdaQueryWrapper<TblDzbcDriverTrip>()
-            .eq(TblDzbcDriverTrip::getTripNo, tripNo));
+        TblDzbcDriverTripVo vo = baseMapper.selectByTripNo(tripNo);
         if (vo != null) {
             fillDetails(vo);
         }

+ 40 - 0
ruoyi-modules/ruoyi-dzbc/src/main/resources/mapper/system/TblDzbcDriverTripMapper.xml

@@ -0,0 +1,40 @@
+<?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="org.dromara.system.mapper.TblDzbcDriverTripMapper">
+
+    <resultMap type="org.dromara.system.domain.vo.TblDzbcDriverTripVo" id="TblDzbcDriverTripResult">
+        <result property="id" column="id"/>
+        <result property="tripNo" column="trip_no"/>
+        <result property="pathId" column="path_id"/>
+        <result property="pathName" column="path_name"/>
+        <result property="driverId" column="driver_id"/>
+        <result property="driverName" column="driver_name"/>
+        <result property="driverPhone" column="driver_phone"/>
+        <result property="carId" column="car_id"/>
+        <result property="carPlate" column="car_plate"/>
+        <result property="startTime" column="start_time"/>
+        <result property="endTime" column="end_time"/>
+        <result property="status" column="status"/>
+        <result property="qrCode" column="qr_code"/>
+        <result property="currentSiteId" column="current_site_id"/>
+        <result property="currentSiteName" column="current_site_name"/>
+        <result property="cargoCount" column="cargo_count"/>
+        <result property="cargoTotalPrice" column="cargo_total_price"/>
+        <result property="remark" column="remark"/>
+        <result property="ext1" column="ext1"/>
+        <result property="ext2" column="ext2"/>
+    </resultMap>
+
+    <sql id="selectTblDzbcDriverTripVo">
+        select id, trip_no, path_id, path_name, driver_id, driver_name, driver_phone, car_id, car_plate, start_time, end_time, status, qr_code, current_site_id, current_site_name, cargo_count, cargo_total_price, remark, ext1, ext2
+        from tbl_dzbc_driver_trip
+    </sql>
+
+    <select id="selectByTripNo" parameterType="String" resultMap="TblDzbcDriverTripResult">
+        <include refid="selectTblDzbcDriverTripVo"/>
+        where trip_no = #{tripNo}
+    </select>
+
+</mapper>

+ 25 - 15
ruoyi-modules/ruoyi-dzbc/src/main/resources/mapper/system/TblDzbcPathSiteMapper.xml

@@ -8,6 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="pathId"    column="path_id"    />
         <result property="siteId"    column="site_id"    />
+        <result property="siteName"    column="site_name"    />
+        <result property="siteAddr"    column="site_addr"    />
         <result property="siteOrder"    column="site_order"    />
         <result property="remark"    column="remark"    />
         <result property="ext1"    column="ext1"    />
@@ -15,39 +17,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <select id="selectVoList" parameterType="org.dromara.system.domain.vo.TblDzbcPathSiteVo" resultMap="TblDzbcPathSiteResult">
-        select id, path_id, site_id, site_order, remark, ext1, ext2
-        from tbl_dzbc_path_site
+        select ps.id, ps.path_id, ps.site_id, ps.site_order, ps.remark, ps.ext1, ps.ext2,
+               s.name as site_name, s.addr as site_addr
+        from tbl_dzbc_path_site ps
+        left join tbl_dzbc_site s on ps.site_id = s.id
         <where>
             <if test="pathId != null">
-                and path_id = #{pathId}
+                and ps.path_id = #{pathId}
             </if>
             <if test="siteId != null">
-                and site_id = #{siteId}
+                and ps.site_id = #{siteId}
             </if>
         </where>
-        order by site_order asc
+        order by ps.site_order asc
     </select>
 
     <select id="selectVoById" parameterType="Long" resultMap="TblDzbcPathSiteResult">
-        select id, path_id, site_id, site_order, remark, ext1, ext2
-        from tbl_dzbc_path_site
-        where id = #{id}
+        select ps.id, ps.path_id, ps.site_id, ps.site_order, ps.remark, ps.ext1, ps.ext2,
+               s.name as site_name, s.addr as site_addr
+        from tbl_dzbc_path_site ps
+        left join tbl_dzbc_site s on ps.site_id = s.id
+        where ps.id = #{id}
     </select>
 
     <select id="selectVoByIds" parameterType="Collection" resultMap="TblDzbcPathSiteResult">
-        select id, path_id, site_id, site_order, remark, ext1, ext2
-        from tbl_dzbc_path_site
-        where id in
+        select ps.id, ps.path_id, ps.site_id, ps.site_order, ps.remark, ps.ext1, ps.ext2,
+               s.name as site_name, s.addr as site_addr
+        from tbl_dzbc_path_site ps
+        left join tbl_dzbc_site s on ps.site_id = s.id
+        where ps.id in
         <foreach item="id" collection="ids" open="(" separator="," close=")">
             #{id}
         </foreach>
     </select>
 
     <select id="selectByPathId" parameterType="Long" resultMap="TblDzbcPathSiteResult">
-        select id, path_id, site_id, site_order, remark, ext1, ext2
-        from tbl_dzbc_path_site
-        where path_id = #{pathId}
-        order by site_order asc
+        select ps.id, ps.path_id, ps.site_id, ps.site_order, ps.remark, ps.ext1, ps.ext2,
+               s.name as site_name, s.addr as site_addr
+        from tbl_dzbc_path_site ps
+        left join tbl_dzbc_site s on ps.site_id = s.id
+        where ps.path_id = #{pathId}
+        order by ps.site_order asc
     </select>
 
 </mapper>