Browse Source

fix: 修改确认单国籍信息有问题

luofeiyun 2 days ago
parent
commit
38cef7a902

+ 24 - 14
ship-module-trade/ship-module-trade-biz/src/main/resources/mapper/order/TradeOrderMapper.xml

@@ -1887,20 +1887,30 @@
     </select>
     <select id="selectConfirmationCountry"
             resultType="com.yc.ship.module.trade.controller.admin.order.vo.order.TradeOrderConfirmationCountryRespVO">
-        select t1.actual_price,
-               t2.room_model_id,
-               t3.short_name room_model_short_name,
-               t3.name room_model_name,t2.type,
-               ifnull(t2.nationality,1) nationality,
-               t2.floor,ifnull(t4.name, '中国') nationality_name,
-               count(t1.id) num
-        from trade_detail t1
-            LEFT JOIN trade_visitor t2 on t1.visitor_id = t2.id
-            LEFT JOIN resource_room_model t3 on t2.room_model_id = t3.id
-            LEFT JOIN area t4 on t2.nationality = t4.id
-        where t1.order_id = #{orderId} and t1.product_type = 0 and t1.deleted = 0 and t2.deleted = 0 and t3.deleted = 0
-        GROUP BY t2.room_model_id, t2.floor, t2.type
-        ORDER BY floor desc
+        SELECT
+            t1.real_money actual_price,
+            t1.room_model_id,
+            t2.short_name room_model_short_name,
+            t2.NAME room_model_name,
+            t3.type,
+            ifnull( t3.nationality, 1 ) nationality,
+            t3.floor,
+            IFNULL( t4.`name`, '中国' ) nationality_name,
+            count( t3.id ) num
+        FROM
+            trade_order_room_model t1
+                LEFT JOIN resource_room_model t2 ON t1.room_model_id = t2.id
+                LEFT JOIN trade_visitor t3 ON t1.room_index_id = t3.room_index_id
+                LEFT JOIN area t4 ON t3.nationality = t4.id
+        WHERE
+            t1.order_id = 2031362252762136577
+          AND t1.deleted = 0
+        GROUP BY
+            t1.room_model_id,
+            t1.floor,
+            t3.type
+        ORDER BY
+            floor DESC
     </select>
 
     <select id="getOrderCount" resultType="java.util.Map">