Przeglądaj źródła

new 优化订单列表SQL查询语句

xian 6 lat temu
rodzic
commit
4b822ba773

+ 3 - 3
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml

@@ -71,8 +71,7 @@
         (
             SELECT
               soi.*
-            FROM
-            tb_rst_sales_order_info soi
+            FROM tb_rst_sales_order_info soi
             LEFT JOIN tb_rst_sales_order_item oi ON soi.sales_id = oi.item_order_id
             <where>
                 <if test="salesIsDownload !=null and salesIsDownload !=''">
@@ -334,6 +333,7 @@
         select
           count(tb_rst_sales_order_info.sales_id)
         from tb_rst_sales_order_info
+        LEFT JOIN tb_rst_sales_order_item oi ON tb_rst_sales_order_info.sales_id = oi.item_order_id
         <where>
             <if test="salesIsDownload !=null and salesIsDownload !=''">
                 AND sales_is_download = #{salesIsDownload}
@@ -381,7 +381,7 @@
                 AND sales_address_info like CONCAT('%',#{salesAddressInfo},'%')
             </if>
             <if test="itemProductName !=null and itemProductName !=''">
-                AND oi.item_product_color like CONCAT('%',#{itemProductName},'%')
+                AND oi.item_product_color like CONCAT('%',#{itemProductName},'%') OR oi.item_product_name LIKE CONCAT('%',#{itemProductName},'%')
             </if>
             <if test="startDate != null and startDate != ''">
                 AND sales_create_time <![CDATA[>=]]> #{startDate}