From 0fe7faa4395a8f3e2dfcc41818de5fa715c57518 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期一, 12 十月 2020 01:25:50 +0800
Subject: [PATCH] 修改商品

---
 java110-db/src/main/resources/mapper/goods/ProductSpecValueServiceDaoImplMapper.xml |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/goods/ProductSpecValueServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/goods/ProductSpecValueServiceDaoImplMapper.xml
index c94690c..03d3a99 100644
--- a/java110-db/src/main/resources/mapper/goods/ProductSpecValueServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/goods/ProductSpecValueServiceDaoImplMapper.xml
@@ -19,8 +19,9 @@
     <select id="getProductSpecValueInfo" parameterType="Map" resultType="Map">
         select t.spec_id,t.spec_id specId,t.value_id,t.value_id valueId,t.product_id,t.product_id
         productId,t.price,t.ot_price,t.ot_price otPrice,t.cost_price,t.cost_price costPrice,t.vip_price,t.vip_price
-        vipPrice,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id storeId,t.stock,t.sales
+        vipPrice,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id storeId,t.stock,t.sales,ps.spec_name specName
         from product_spec_value t
+        left join product_spec ps on t.spec_id = ps.spec_id and ps.store_id = t.store_id and ps.status_cd = '0'
         where 1 =1
         <if test="specId !=null and specId != ''">
             and t.spec_id= #{specId}
@@ -65,7 +66,7 @@
 
     <!-- 鏌ヨ浜у搧搴撳瓨鍜岄攢閲� add by wuxw 2018-07-03 -->
     <select id="queryProductStockAndSales" parameterType="Map" resultType="Map">
-        select t.product_id productId,sum(psv.stock) stock,SUM(psv.sales) sales
+        select t.product_id productId,sum(t.stock) stock,SUM(t.sales) sales
         from product_spec_value t
         where 1 =1
         and t.status_cd= '0'
@@ -93,9 +94,7 @@
         <if test="specId !=null and specId != ''">
             , t.spec_id= #{specId}
         </if>
-        <if test="productId !=null and productId != ''">
-            , t.product_id= #{productId}
-        </if>
+
         <if test="price !=null and price != ''">
             , t.price= #{price}
         </if>
@@ -121,6 +120,9 @@
         <if test="valueId !=null and valueId != ''">
             and t.value_id= #{valueId}
         </if>
+        <if test="productId !=null and productId != ''">
+            and t.product_id= #{productId}
+        </if>
 
     </update>
 

--
Gitblit v1.8.0