From 3f1dc57d57ef0ceafcc59cd5ce34ff90cfe6d146 Mon Sep 17 00:00:00 2001
From: 1098226878 <1098226878@qq.com>
Date: 星期一, 13 九月 2021 17:06:16 +0800
Subject: [PATCH] 优化代码

---
 java110-db/src/main/resources/mapper/goods/ProductSpecServiceDaoImplMapper.xml |  114 +++++++++++++++++++++++++++-----------------------------
 1 files changed, 55 insertions(+), 59 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/goods/ProductSpecServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/goods/ProductSpecServiceDaoImplMapper.xml
old mode 100644
new mode 100755
index 0a0d869..9a78517
--- a/java110-db/src/main/resources/mapper/goods/ProductSpecServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/goods/ProductSpecServiceDaoImplMapper.xml
@@ -5,84 +5,80 @@
 <mapper namespace="productSpecServiceDaoImpl">
 
 
-
-
-
     <!-- 淇濆瓨浜у搧瑙勬牸淇℃伅 add by wuxw 2018-07-03 -->
     <insert id="saveProductSpecInfo" parameterType="Map">
         insert into product_spec(
-spec_id,spec_name,store_id
-) values (
-#{specId},#{specName},#{storeId}
-)
+        spec_id,spec_name,store_id
+        ) values (
+        #{specId},#{specName},#{storeId}
+        )
     </insert>
-
 
 
     <!-- 鏌ヨ浜у搧瑙勬牸淇℃伅 add by wuxw 2018-07-03 -->
     <select id="getProductSpecInfo" parameterType="Map" resultType="Map">
-        select  t.spec_id,t.spec_id specId,t.spec_name,t.spec_name specName,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id storeId 
-from product_spec t 
-where 1 =1 
-<if test="specId !=null and specId != ''">
-   and t.spec_id= #{specId}
-</if> 
-<if test="specName !=null and specName != ''">
-   and t.spec_name= #{specName}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="storeId !=null and storeId != ''">
-   and t.store_id= #{storeId}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.spec_id,t.spec_id specId,t.spec_name,t.spec_name specName,t.status_cd,t.status_cd
+        statusCd,t.store_id,t.store_id storeId,t.create_time createTime
+        from product_spec t
+        where 1 =1
+        <if test="specId !=null and specId != ''">
+            and t.spec_id= #{specId}
+        </if>
+        <if test="specName !=null and specName != ''">
+            and t.spec_name= #{specName}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            and t.store_id= #{storeId}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
 
     </select>
 
 
-
-
     <!-- 淇敼浜у搧瑙勬牸淇℃伅 add by wuxw 2018-07-03 -->
     <update id="updateProductSpecInfo" parameterType="Map">
-        update  product_spec t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="specName !=null and specName != ''">
-, t.spec_name= #{specName}
-</if> 
-<if test="storeId !=null and storeId != ''">
-, t.store_id= #{storeId}
-</if> 
- where 1=1 <if test="specId !=null and specId != ''">
-and t.spec_id= #{specId}
-</if> 
+        update product_spec t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="specName !=null and specName != ''">
+            , t.spec_name= #{specName}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            , t.store_id= #{storeId}
+        </if>
+        where 1=1
+        <if test="specId !=null and specId != ''">
+            and t.spec_id= #{specId}
+        </if>
 
     </update>
 
     <!-- 鏌ヨ浜у搧瑙勬牸鏁伴噺 add by wuxw 2018-07-03 -->
-     <select id="queryProductSpecsCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from product_spec t 
-where 1 =1 
-<if test="specId !=null and specId != ''">
-   and t.spec_id= #{specId}
-</if> 
-<if test="specName !=null and specName != ''">
-   and t.spec_name= #{specName}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="storeId !=null and storeId != ''">
-   and t.store_id= #{storeId}
-</if> 
+    <select id="queryProductSpecsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from product_spec t
+        where 1 =1
+        <if test="specId !=null and specId != ''">
+            and t.spec_id= #{specId}
+        </if>
+        <if test="specName !=null and specName != ''">
+            and t.spec_name= #{specName}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            and t.store_id= #{storeId}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>

--
Gitblit v1.8.0