From 15a4053cabeac5c41c092455f061f04737823387 Mon Sep 17 00:00:00 2001 From: liuyuxin Date: Fri, 6 Mar 2026 15:21:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/wisdom/RkRecordMapper.xml | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main/resources/mybatis/wisdom/RkRecordMapper.xml b/src/main/resources/mybatis/wisdom/RkRecordMapper.xml index d643bba..3b36f85 100644 --- a/src/main/resources/mybatis/wisdom/RkRecordMapper.xml +++ b/src/main/resources/mybatis/wisdom/RkRecordMapper.xml @@ -93,8 +93,8 @@ SELECT rr.*, - /* ===== 新增:统一计算总金额 ===== */ - rr.real_qty * rr.ht_dj AS total_amount, + /* 总金额 */ + COALESCE(rr.real_qty,0) * COALESCE(rr.ht_dj,0) AS total_amount, su.nick_name AS operator_name, mt.type_name AS wl_type_name, @@ -107,7 +107,10 @@ wh.parent_warehouse_code AS parent_warehouse_code, wh.parent_warehouse_name AS parent_warehouse_name, - ct.team_name AS team_name + ct.team_name AS team_name, + + -- 新增 gys_jh 主键 + gj.id AS gys_jh_id FROM rk_record rr LEFT JOIN sys_user su ON rr.operator = su.user_id @@ -120,6 +123,13 @@ LEFT JOIN construction_team ct ON rr.team_code = ct.team_code AND ct.is_delete = '0' + /* 新增关联 */ + LEFT JOIN gys_jh gj + ON rr.sap_no = gj.sap_no + AND rr.wl_no = gj.wl_no + AND rr.xm_no = gj.xm_no + AND gj.is_delete = '0' + @@ -282,7 +292,11 @@ WHERE rr.bill_no = #{billNo} AND (rr.is_delete = '0' OR rr.is_delete = 0 OR rr.is_delete IS NULL) - ORDER BY rr.exec_status = '0' DESC, rr.create_time ASC + + ORDER BY + rr.exec_status = '0' DESC, + rr.create_time ASC, + gj.id ASC