From cdcc529ce5fb9aa0dd1dea5bb2a620fc09b7d25c Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 08 十一月 2025 20:03:56 +0800
Subject: [PATCH] feat: 上传附件

---
 ruoyi-system/src/main/resources/mapper/system/TbOrdersMapper.xml |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/TbOrdersMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TbOrdersMapper.xml
index 7404a74..c59df7d 100644
--- a/ruoyi-system/src/main/resources/mapper/system/TbOrdersMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/TbOrdersMapper.xml
@@ -42,10 +42,12 @@
         <result property="ServiceOrdNo"    column="ServiceOrdNo"    />
         <result property="CreateTime"    column="CreateTime"    />
         <result property="UpdateTime"    column="UpdateTime"    />
+        <result property="OrderStatus"    column="OrderStatus"    />
+        <result property="AppId"    column="AppId"    />
     </resultMap>
 
     <sql id="selectTbOrdersVo">
-        select OrderID, LinkPerson, LinkTel, AlarmTel, PatientName, Sex, Age, Kg, Sense, LocalAddress, LocalLongitude, LocalLatitude, LocalProvince, LocalCity, LocalDistrict, SendAddress, SendLongitude, SendLatitude, SendProvince, SendCity, SendDistrict, BookingPrice, BookingDate, Remark, Complaint, PatientCount, BookingKM, EscortCode, LiftingCode, LiftingFloor, RequirementCode, TypeCode, ThirdPartyResult, ServiceOrdID, ServiceOrdNo, CreateTime, UpdateTime from tb_orders
+        select OrderID, LinkPerson, LinkTel, AlarmTel, PatientName, Sex, Age, Kg, Sense, LocalAddress, LocalLongitude, LocalLatitude, LocalProvince, LocalCity, LocalDistrict, SendAddress, SendLongitude, SendLatitude, SendProvince, SendCity, SendDistrict, BookingPrice, BookingDate, Remark, Complaint, PatientCount, BookingKM, EscortCode, LiftingCode, LiftingFloor, RequirementCode, TypeCode, ThirdPartyResult, ServiceOrdID, ServiceOrdNo, CreateTime, UpdateTime, OrderStatus, AppId from tb_orders
     </sql>
 
     <select id="selectTbOrdersList" parameterType="TbOrders" resultMap="TbOrdersResult">
@@ -87,17 +89,22 @@
             <if test="ServiceOrdNo != null  and ServiceOrdNo != ''"> and ServiceOrdNo = #{ServiceOrdNo}</if>
             <if test="CreateTime != null "> and CreateTime = #{CreateTime}</if>
             <if test="UpdateTime != null "> and UpdateTime = #{UpdateTime}</if>
+            <if test="OrderStatus != null "> and OrderStatus = #{OrderStatus}</if>
+            <if test="AppId != null  and AppId != ''"> and AppId = #{AppId}</if>
         </where>
+        ORDER BY CreateTime DESC
     </select>
     
     <select id="selectTbOrdersByOrderID" parameterType="Long" resultMap="TbOrdersResult">
         <include refid="selectTbOrdersVo"/>
         where OrderID = #{OrderID}
+        ORDER BY CreateTime DESC
     </select>
 
-    <insert id="insertTbOrders" parameterType="TbOrders" useGeneratedKeys="true" keyProperty="OrderID">
+    <insert id="insertTbOrders" parameterType="TbOrders">
         insert into tb_orders
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="OrderID != null">OrderID,</if>
             <if test="LinkPerson != null">LinkPerson,</if>
             <if test="LinkTel != null">LinkTel,</if>
             <if test="AlarmTel != null">AlarmTel,</if>
@@ -134,8 +141,11 @@
             <if test="ServiceOrdNo != null">ServiceOrdNo,</if>
             <if test="CreateTime != null">CreateTime,</if>
             <if test="UpdateTime != null">UpdateTime,</if>
+            <if test="OrderStatus != null">OrderStatus,</if>
+            <if test="AppId != null">AppId,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="OrderID != null">#{OrderID},</if>
             <if test="LinkPerson != null">#{LinkPerson},</if>
             <if test="LinkTel != null">#{LinkTel},</if>
             <if test="AlarmTel != null">#{AlarmTel},</if>
@@ -172,6 +182,8 @@
             <if test="ServiceOrdNo != null">#{ServiceOrdNo},</if>
             <if test="CreateTime != null">#{CreateTime},</if>
             <if test="UpdateTime != null">#{UpdateTime},</if>
+            <if test="OrderStatus != null">#{OrderStatus},</if>
+            <if test="AppId != null">#{AppId},</if>
          </trim>
     </insert>
 
@@ -214,6 +226,8 @@
             <if test="ServiceOrdNo != null">ServiceOrdNo = #{ServiceOrdNo},</if>
             <if test="CreateTime != null">CreateTime = #{CreateTime},</if>
             <if test="UpdateTime != null">UpdateTime = #{UpdateTime},</if>
+            <if test="OrderStatus != null">OrderStatus = #{OrderStatus},</if>
+            <if test="AppId != null">AppId = #{AppId},</if>
         </trim>
         where OrderID = #{OrderID}
     </update>
@@ -228,4 +242,15 @@
             #{OrderID}
         </foreach>
     </delete>
+
+    <select id="checkServiceOrdIDExists" parameterType="String" resultType="Integer">
+        select count(1) from tb_orders where ServiceOrdID = #{ServiceOrdID}
+    </select>
+
+    <select id="selectTbOrdersByServiceOrdID" parameterType="String" resultMap="TbOrdersResult">
+        <include refid="selectTbOrdersVo"/>
+        where ServiceOrdID = #{ServiceOrdID}
+        LIMIT 1
+    </select>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1