From f895453711afae4e1a306c5ec77b87147997c99c Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 29 十月 2020 11:25:23 +0800
Subject: [PATCH] 优化代码

---
 java110-db/src/main/resources/mapper/goods/ProductLabelServiceDaoImplMapper.xml |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/goods/ProductLabelServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/goods/ProductLabelServiceDaoImplMapper.xml
index ff9a710..0a03593 100644
--- a/java110-db/src/main/resources/mapper/goods/ProductLabelServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/goods/ProductLabelServiceDaoImplMapper.xml
@@ -20,11 +20,13 @@
         select t.label_id,t.label_id labelId,p.product_id productId,p.store_id storeId,t.label_cd,t.label_cd labelCd,
         p.unit_name unitName,p.is_postage isPostage,p.sort,p.bar_code barCode,p.postage,p.prod_name prodName,
         p.state,p.keyword,p.prod_desc prodDesc,p.category_id categoryId,pc.category_name categoryName,td.name stateName,
-        t.create_time createTime
+        t.create_time createTime,
+        psv.cost_price costPrice,psv.ot_price otPrice,psv.price,psv.sales,psv.stock,psv.vip_price vipPrice
         from product p
         left join product_category pc on pc.category_id = p.category_id and pc.store_id = p.store_id and pc.status_cd = '0'
         left join t_dict td on p.state = td.status_cd and td.table_name= 'product' and td.table_columns = 'state'
         left join product_label t on t.product_id = p.product_id and t.store_id = p.store_id and t.status_cd = '0'
+        left join product_spec_value psv on psv.product_id = t.product_id and psv.store_id = t.store_id and psv.is_default = 'T'
         <if test="labelCd !=null and labelCd != ''">
             and t.label_cd= #{labelCd}
         </if>
@@ -43,6 +45,9 @@
         </if>
         <if test='hasProduct !=null and hasProduct == "N"'>
             and t.product_id is null
+        </if>
+        <if test='hasProduct !=null and hasProduct == "Y"'>
+            and t.product_id is not null
         </if>
         order by t.create_time desc
         <if test="page != -1 and page != null ">
@@ -100,6 +105,9 @@
         <if test='hasProduct !=null and hasProduct == "N"'>
             and t.product_id is null
         </if>
+        <if test='hasProduct !=null and hasProduct == "Y"'>
+            and t.product_id is not null
+        </if>
 
 
     </select>

--
Gitblit v1.8.0