Kaynağa Gözat

修改审核时候使用全字段update导致部分数据清空

Guos 3 hafta önce
ebeveyn
işleme
fe8892e7de

+ 5 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreScrmMapper.java

@@ -229,4 +229,9 @@ public interface FsStoreScrmMapper
      * 店铺名称是否已存在
      * **/
     Boolean isStoreNameExist(@Param("storeName") String storeName, @Param("storeId") Long storeId);
+
+    /**
+     * 店铺审核
+     * **/
+    Integer auditStore(FsStoreScrm FsStoreScrm);
 }

+ 2 - 2
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreScrmServiceImpl.java

@@ -361,10 +361,10 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
                 }
             }
         }
-        fsStoreMapper.updateFsStore(updateStore);
+        Integer rowNum = fsStoreMapper.auditStore(updateStore);
         //更新日志
         storeAuditLogUtil.addAudit(fsStore.getStoreId(), fsStore.getReason(), fsStore.getAttachImage());
-        return 1;
+        return rowNum;
     }
 
     @Override

+ 13 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml

@@ -345,6 +345,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </trim>
     </insert>
 
+    <update id="auditStore" parameterType="FsStoreScrm">
+        update fs_store_scrm
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="isAudit != null">is_audit = #{isAudit},</if>
+            <if test="qualificationUpdateTime !=null ">qualification_update_time = #{qualificationUpdateTime} , </if>
+            <if test="selectableProductTypes !=null and selectableProductTypes !=''"> selectable_product_types = #{selectableProductTypes} ,</if>
+            <if test="permStatus !=null ">perm_status = #{permStatus}, </if>
+        </trim>
+        where store_id = #{storeId}
+    </update>
+
+
     <update id="updateFsStore" parameterType="FsStoreScrm">
         update fs_store_scrm
         <trim prefix="SET" suffixOverrides=",">