fuxubing преди 3 години
родител
ревизия
04b5bd537a
променени са 1 файла, в които са добавени 26 реда и са изтрити 16 реда
  1. 26 16
      src/main/resources/mybatis/mapper/hm/HmBookOrderMapper.xml

+ 26 - 16
src/main/resources/mybatis/mapper/hm/HmBookOrderMapper.xml

@@ -107,22 +107,32 @@
     </select>
     <select id="selectMatchList" resultType="java.util.Map">
         SELECT a.book_trade_no,
-               a.book_order_no,
-               a.`station_code`,
-               a.`payment_no`
-        FROM hm_book_trade_order AS a
-                 LEFT JOIN hm_book_order AS b
-                           ON b.book_order_no = a.book_order_no
-        <![CDATA[ WHERE LEFT (begin_time
-            , 12)
-            < CURRENT_DATE
-          AND LEFT (begin_time
-            , 12)
-            > DATE_SUB(CURRENT_DATE
-            , INTERVAL 31 DAY)
-          AND a.status <> 4
-          AND b.book_order_no IS NULL
-        ]]>
+        a.book_order_no,
+        a.`station_code`,
+        a.`payment_no`
+        FROM hm_book_trade_order a
+        LEFT JOIN hm_book_order b
+        ON b.book_trade_no = a.book_trade_no
+        WHERE a.status != 4
+        AND (
+        a.`start_time` BETWEEN (CURRENT_DATE - INTERVAL 31 DAY)
+        AND (CURRENT_DATE + INTERVAL 31 DAY)
+        )
+        AND b.book_order_no IS NULL
+        UNION
+        SELECT a.book_trade_no,
+        a.book_order_no,
+        a.`station_code`,
+        a.`payment_no`
+        FROM hm_book_trade_order a
+        LEFT JOIN hm_book_order b
+        ON b.book_trade_no = a.book_trade_no
+        WHERE a.status != 4
+        AND (
+        a.`start_time` BETWEEN (CURRENT_DATE - INTERVAL 31 DAY)
+        AND (CURRENT_DATE + INTERVAL 31 DAY)
+        )
+        AND b.shop_name IS NULL
     </select>
     <select id="selectByBookOrderNo" resultMap="BaseResultMap">
         select