Kaynağa Gözat

直播-店铺/商品收藏和取消收藏接口调整,新增查询店铺接口

Long 3 hafta önce
ebeveyn
işleme
d51a7bfb13
20 değiştirilmiş dosya ile 235 ekleme ve 129 silme
  1. 0 8
      fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java
  2. 19 15
      fs-live-app/src/main/java/com/fs/app/controller/FsStoreController.java
  3. 13 4
      fs-live-app/src/main/java/com/fs/app/controller/LiveDataController.java
  4. 8 0
      fs-service/src/main/java/com/fs/his/mapper/FsStoreMapper.java
  5. 8 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreService.java
  6. 11 1
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreServiceImpl.java
  7. 2 2
      fs-service/src/main/java/com/fs/live/domain/LiveUserFavorite.java
  8. 7 0
      fs-service/src/main/java/com/fs/live/mapper/LiveGoodsMapper.java
  9. 0 11
      fs-service/src/main/java/com/fs/live/mapper/LiveUserFavoriteMapper.java
  10. 9 1
      fs-service/src/main/java/com/fs/live/service/ILiveDataService.java
  11. 5 2
      fs-service/src/main/java/com/fs/live/service/ILiveGoodsService.java
  12. 0 12
      fs-service/src/main/java/com/fs/live/service/ILiveUserFavoriteService.java
  13. 42 32
      fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java
  14. 8 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveGoodsServiceImpl.java
  15. 0 21
      fs-service/src/main/java/com/fs/live/service/impl/LiveUserFavoriteServiceImpl.java
  16. 83 0
      fs-service/src/main/java/com/fs/live/vo/FsStoreLiveVO.java
  17. 3 0
      fs-service/src/main/java/com/fs/live/vo/LiveGoodsVo.java
  18. 8 0
      fs-service/src/main/resources/mapper/his/FsStoreMapper.xml
  19. 9 0
      fs-service/src/main/resources/mapper/live/LiveGoodsMapper.xml
  20. 0 20
      fs-service/src/main/resources/mapper/live/LiveUserFavoriteMapper.xml

+ 0 - 8
fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java

@@ -58,14 +58,6 @@ public class LiveDataController {
         return R.ok(liveDataService.follow(liveId, getUserId()));
     }
 
-    /**
-     * 收藏店铺/店铺商品
-     * */
-    @GetMapping("/collectStore")
-    public R collectStore(Long storeId, Long productId, Long liveId) {
-        return R.ok(liveDataService.collectStore(storeId, productId, liveId, getUserId()));
-    }
-
     /**
      * 获取直播内数据
      * */

+ 19 - 15
fs-live-app/src/main/java/com/fs/app/controller/FsStoreController.java

@@ -1,20 +1,17 @@
 package com.fs.app.controller;
 
-import com.fs.common.annotation.Log;
+import com.fs.app.annotation.Login;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.page.TableDataInfo;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.ParseUtils;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.his.domain.FsStore;
-import com.fs.his.param.FsStoreAuditParam;
 import com.fs.his.service.IFsStoreService;
+import com.fs.live.service.ILiveGoodsService;
+import com.fs.live.vo.FsStoreLiveVO;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
 
 /**
  * 店铺管理Controller
@@ -24,21 +21,28 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/app/live/store")
-public class FsStoreController extends BaseController
+public class FsStoreController extends AppBaseController
 {
     @Autowired
     private IFsStoreService fsStoreService;
-
+    @Autowired
+    private ILiveGoodsService liveGoodsService;
 
     /**
      * 获取店铺管理详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('his:store:query')")
-    @GetMapping(value = "/{storeId}")
+    @Login
+    @GetMapping("/{storeId}")
     public AjaxResult getInfo(@PathVariable("storeId") Long storeId)
     {
-        FsStore fsStore = fsStoreService.selectFsStoreByStoreId(storeId);
-        fsStore.setPhone(ParseUtils.parsePhone(fsStore.getPhone()));
+        Map<String, Object> params = new HashMap<>();
+        params.put("storeId", storeId);
+        params.put("userId", getUserId());
+        FsStoreLiveVO fsStore = fsStoreService.selectFsStoreLiveByMap(params);
+        if (Objects.nonNull(fsStore)) {
+            fsStore.setGoodsList(liveGoodsService.selectLiveGoodsListByMap(params));
+        }
+
         return AjaxResult.success(fsStore);
     }
 

+ 13 - 4
fs-live-app/src/main/java/com/fs/app/controller/LiveDataController.java

@@ -68,12 +68,21 @@ public class LiveDataController extends AppBaseController{
     }
 
     /**
-     * 收藏店铺/店铺商品
+     * 收藏/取消收藏店铺
      * */
     @Login
-    @GetMapping("/collectStore")
-    public R collectStore(Long storeId, Long productId, Long liveId) {
-        return R.ok(liveDataService.collectStore(storeId, productId, liveId,  Long.parseLong(getUserId())));
+    @PostMapping("/collectStore")
+    public R collectStore(@RequestParam Long storeId) {
+        return R.ok(liveDataService.collectStore(Long.parseLong(getUserId()), storeId));
+    }
+
+    /**
+     * 收藏/取消收藏商品
+     * */
+    @Login
+    @PostMapping("/collectGoods")
+    public R collectProduct(@RequestParam Long goodId) {
+        return R.ok(liveDataService.collectProduct(Long.parseLong(getUserId()), goodId));
     }
 
     /**

+ 8 - 0
fs-service/src/main/java/com/fs/his/mapper/FsStoreMapper.java

@@ -1,7 +1,10 @@
 package com.fs.his.mapper;
 
 import java.util.List;
+import java.util.Map;
+
 import com.fs.his.domain.FsStore;
+import com.fs.live.vo.FsStoreLiveVO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
@@ -69,4 +72,9 @@ public interface FsStoreMapper
 
     @Select("SELECT * from fs_store WHERE   FIND_IN_SET(store_id, (SELECT store_ids FROM fs_doctor where doctor_id=#{doctorId}))")
     List<FsStore> selectFsStoreListByDoctorId(Long doctorId);
+
+    /**
+     * 直播间-根据店铺ID查询店铺信息
+     */
+    FsStoreLiveVO selectFsStoreLiveByMap(@Param("params") Map<String, Object> params);
 }

+ 8 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreService.java

@@ -1,8 +1,11 @@
 package com.fs.his.service;
 
 import java.util.List;
+import java.util.Map;
+
 import com.fs.his.domain.FsStore;
 import com.fs.his.param.FsStoreAuditParam;
+import com.fs.live.vo.FsStoreLiveVO;
 
 
 /**
@@ -69,4 +72,9 @@ public interface IFsStoreService
 
 
     List<FsStore> selectFsStoreListByDoctorId(Long doctorId);
+
+    /**
+     * 直播间-根据店铺ID查询店铺信息
+     */
+    FsStoreLiveVO selectFsStoreLiveByMap(Map<String, Object> params);
 }

+ 11 - 1
fs-service/src/main/java/com/fs/his/service/impl/FsStoreServiceImpl.java

@@ -1,7 +1,8 @@
 package com.fs.his.service.impl;
 
-import java.util.Collections;
 import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 
 import com.fs.common.exception.CustomException;
 import com.fs.common.utils.DateUtils;
@@ -9,6 +10,7 @@ import com.fs.common.utils.DateUtils;
 
 import com.fs.his.param.FsStoreAuditParam;
 import com.fs.his.utils.StoreMD5PasswordEncoder;
+import com.fs.live.vo.FsStoreLiveVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.his.mapper.FsStoreMapper;
@@ -135,5 +137,13 @@ public class FsStoreServiceImpl implements IFsStoreService
         return fsStoreMapper.selectFsStoreListByDoctorId(doctorId);
     }
 
+    /**
+     * 直播间-根据店铺ID查询店铺信息
+     */
+    @Override
+    public FsStoreLiveVO selectFsStoreLiveByMap(Map<String, Object> params) {
+        return fsStoreMapper.selectFsStoreLiveByMap(params);
+    }
+
 
 }

+ 2 - 2
fs-service/src/main/java/com/fs/live/domain/LiveUserFavorite.java

@@ -1,10 +1,9 @@
 package com.fs.live.domain;
 
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
 import lombok.Data;
-import com.fs.common.core.domain.BaseEntity;
-import lombok.EqualsAndHashCode;
 
 import java.util.Date;
 
@@ -18,6 +17,7 @@ import java.util.Date;
 public class LiveUserFavorite{
 
     /** 收藏id */
+    @TableId(type = IdType.AUTO)
     private Long favoriteId;
 
     /** 用户id */

+ 7 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveGoodsMapper.java

@@ -1,6 +1,8 @@
 package com.fs.live.mapper;
 
 import java.util.List;
+import java.util.Map;
+
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.his.domain.FsStoreProduct;
 import com.fs.live.domain.LiveGoods;
@@ -112,4 +114,9 @@ public interface LiveGoodsMapper extends BaseMapper<LiveGoods>{
 
     @Select("select * from live_goods where live_id = #{liveId} and product_id = #{productId}")
     LiveGoods selectLiveGoodsByProductId(@Param("liveId") Long liveId,@Param("productId") Long productId);
+
+    /**
+     * 根据店铺ID查询商品列表
+     */
+    List<LiveGoodsVo> selectLiveGoodsListByStoreId(@Param("params") Map<String, Object> params);
 }

+ 0 - 11
fs-service/src/main/java/com/fs/live/mapper/LiveUserFavoriteMapper.java

@@ -44,14 +44,6 @@ public interface LiveUserFavoriteMapper extends BaseMapper<LiveUserFavorite>{
      */
     int updateLiveUserFavorite(LiveUserFavorite liveUserFavorite);
 
-    /**
-     * 删除用户直播收藏
-     *
-     * @param favoriteId 用户直播收藏主键
-     * @return 结果
-     */
-    int deleteLiveUserFavoriteByFavoriteId(Long favoriteId);
-
     /**
      * 批量删除用户直播收藏
      *
@@ -64,7 +56,4 @@ public interface LiveUserFavoriteMapper extends BaseMapper<LiveUserFavorite>{
 
     void deleteLiveUserFavoriteByLiveIdAndUserId(@Param("liveId")Long liveId, @Param("userId")Long userId);
 
-    List<LiveUserFavorite> selectByIds(@Param("productId") Long productId, @Param("storeId")Long storeId, @Param("liveId")Long liveId, @Param("userId")Long userId);
-
-    void deleteLiveUserFavoriteByIds(@Param("productId") Long productId, @Param("storeId")Long storeId, @Param("liveId")Long liveId, @Param("userId")Long userId);
 }

+ 9 - 1
fs-service/src/main/java/com/fs/live/service/ILiveDataService.java

@@ -106,7 +106,15 @@ public interface ILiveDataService extends IService<LiveData>{
 
     String follow(Long liveId, Long userId);
 
-    String collectStore(Long storeId, Long productId, Long liveId, Long userId);
+    /**
+     * 收藏/取消收藏店铺
+     */
+    String collectStore(Long userId, Long storeId);
+
+    /**
+     * 收藏/取消收藏商品
+     */
+    String collectProduct(Long userId, Long productId);
 
     Map<String, Object> getLiveViewData(Long liveId);
 

+ 5 - 2
fs-service/src/main/java/com/fs/live/service/ILiveGoodsService.java

@@ -7,8 +7,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.entity.SysUser;
 import com.fs.company.domain.CompanyUser;
-import com.fs.his.domain.FsStore;
-import com.fs.his.domain.FsStoreProduct;
 import com.fs.live.domain.LiveGoods;
 import com.fs.live.vo.LiveGoodsListVo;
 import com.fs.live.vo.LiveGoodsVo;
@@ -104,4 +102,9 @@ public interface ILiveGoodsService extends IService<LiveGoods>{
      * @return 直播商品集合
      */
     R handleDeleteSelected(LiveGoodsListVo listVo);
+
+    /**
+     * 根据店铺ID查询商品列表
+     */
+    List<LiveGoodsVo> selectLiveGoodsListByMap(Map<String, Object> params);
 }

+ 0 - 12
fs-service/src/main/java/com/fs/live/service/ILiveUserFavoriteService.java

@@ -51,19 +51,7 @@ public interface ILiveUserFavoriteService extends IService<LiveUserFavorite>{
      */
     int deleteLiveUserFavoriteByFavoriteIds(Long[] favoriteIds);
 
-    /**
-     * 删除用户直播收藏信息
-     *
-     * @param favoriteId 用户直播收藏主键
-     * @return 结果
-     */
-    int deleteLiveUserFavoriteByFavoriteId(Long favoriteId);
-
     LiveUserFavorite selectLiveUserFavoriteByLiveIdAndUserId(Long liveId, Long userId);
 
     void deleteLiveUserFavoriteByLiveIdAndUserId(Long liveId, Long userId);
-
-    List<LiveUserFavorite> selectByIds(Long productId, Long storeId, Long liveId, Long userId);
-
-    void deleteLiveUserFavoriteByIds(Long productId, Long storeId, Long liveId, Long userId);
 }

+ 42 - 32
fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java

@@ -1,5 +1,8 @@
 package com.fs.live.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
@@ -426,47 +429,54 @@ public class LiveDataServiceImpl extends ServiceImpl<LiveDataMapper, LiveData> i
     }
 
     /**
-     * 收藏商品默认收藏直播间和店铺
-     * 收藏店铺默认收藏直播间
-     * 取消收藏店铺默认取消收藏商品
-     * */
+     * 收藏/取消收藏店铺
+     */
     @Override
-    public String collectStore(Long storeId, Long productId, Long liveId, Long userId) {
-        if(liveId==null&&storeId==null){
-            return "未知的产品或店铺";
+    public String collectStore(Long userId, Long storeId) {
+        return toggleFavorite(userId, storeId, null);
+    }
+
+    /**
+     * 通用收藏切换方法
+     */
+    private String toggleFavorite(Long userId, Long storeId, Long productId) {
+        LambdaQueryWrapper<LiveUserFavorite> wrapper = Wrappers.<LiveUserFavorite>lambdaQuery()
+                .eq(LiveUserFavorite::getUserId, userId);
+
+        if (storeId != null) {
+            wrapper.eq(LiveUserFavorite::getStoreId, storeId);
         }
-        //判断是收藏店铺还是收藏产品
         if (productId != null) {
-            //查询用户是否收藏过该产品
-            List<LiveUserFavorite> liveUserFavorites = liveUserFavoriteService.selectByIds(productId, storeId, liveId, userId);
-            if (liveUserFavorites != null && !liveUserFavorites.isEmpty()) {
-                liveUserFavoriteService.deleteLiveUserFavoriteByIds(productId,storeId,liveId,userId);
-                return "取消收藏成功";
-            }
-            LiveUserFavorite liveUserFavorite = new LiveUserFavorite();
-            liveUserFavorite.setProductId(productId);
-            liveUserFavorite.setStoreId(storeId);
-            liveUserFavorite.setLiveId(liveId);
-            liveUserFavorite.setCreateTime(new Date());
-            liveUserFavorite.setUserId(userId);
-            liveUserFavoriteService.insertLiveUserFavorite(liveUserFavorite);
-            return "收藏成功";
+            wrapper.eq(LiveUserFavorite::getProductId, productId);
         }
-        //查询用户是否收藏过该店铺
-        List<LiveUserFavorite> liveUserFavorites = liveUserFavoriteService.selectByIds(null, storeId, liveId, userId);
-        if (liveUserFavorites != null && !liveUserFavorites.isEmpty()) {
-            liveUserFavoriteService.deleteLiveUserFavoriteByIds(null,storeId,liveId,userId);
+
+        long count = liveUserFavoriteService.count(wrapper);
+        if (count > 0) {
+            liveUserFavoriteService.remove(wrapper);
             return "取消收藏成功";
         }
-        LiveUserFavorite liveUserFavorite = new LiveUserFavorite();
-        liveUserFavorite.setStoreId(storeId);
-        liveUserFavorite.setLiveId(liveId);
-        liveUserFavorite.setCreateTime(new Date());
-        liveUserFavorite.setUserId(userId);
-        liveUserFavoriteService.insertLiveUserFavorite(liveUserFavorite);
+
+        LiveUserFavorite favorite = new LiveUserFavorite();
+        favorite.setUserId(userId);
+        if (storeId != null) {
+            favorite.setStoreId(storeId);
+        }
+        if (productId != null) {
+            favorite.setProductId(productId);
+        }
+
+        liveUserFavoriteService.insertLiveUserFavorite(favorite);
         return "收藏成功";
     }
 
+    /**
+     * 收藏/取消收藏商品
+     */
+    @Override
+    public String collectProduct(Long userId, Long productId) {
+        return toggleFavorite(userId, null, productId);
+    }
+
     @Override
     public Map<String, Object> getLiveViewData(Long liveId) {
         Map<String, Object> liveViewData = new HashMap<>();

+ 8 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveGoodsServiceImpl.java

@@ -222,4 +222,12 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
         }
         return R.error();
     }
+
+    /**
+     * 根据店铺ID查询商品列表
+     */
+    @Override
+    public List<LiveGoodsVo> selectLiveGoodsListByMap(Map<String, Object> params) {
+        return baseMapper.selectLiveGoodsListByStoreId(params);
+    }
 }

+ 0 - 21
fs-service/src/main/java/com/fs/live/service/impl/LiveUserFavoriteServiceImpl.java

@@ -79,18 +79,6 @@ public class LiveUserFavoriteServiceImpl extends ServiceImpl<LiveUserFavoriteMap
         return baseMapper.deleteLiveUserFavoriteByFavoriteIds(favoriteIds);
     }
 
-    /**
-     * 删除用户直播收藏信息
-     *
-     * @param favoriteId 用户直播收藏主键
-     * @return 结果
-     */
-    @Override
-    public int deleteLiveUserFavoriteByFavoriteId(Long favoriteId)
-    {
-        return baseMapper.deleteLiveUserFavoriteByFavoriteId(favoriteId);
-    }
-
     @Override
     public LiveUserFavorite selectLiveUserFavoriteByLiveIdAndUserId(Long liveId, Long userId) {
         return baseMapper.selectLiveUserFavoriteByLiveIdAndUserId(liveId, userId);
@@ -101,13 +89,4 @@ public class LiveUserFavoriteServiceImpl extends ServiceImpl<LiveUserFavoriteMap
         baseMapper.deleteLiveUserFavoriteByLiveIdAndUserId(liveId, userId);
     }
 
-    @Override
-    public List<LiveUserFavorite> selectByIds(Long productId, Long storeId, Long liveId, Long userId) {
-        return baseMapper.selectByIds(productId,storeId,liveId,userId);
-    }
-
-    @Override
-    public void deleteLiveUserFavoriteByIds(Long productId, Long storeId, Long liveId, Long userId) {
-        baseMapper.deleteLiveUserFavoriteByIds(productId,storeId,liveId,userId);
-    }
 }

+ 83 - 0
fs-service/src/main/java/com/fs/live/vo/FsStoreLiveVO.java

@@ -0,0 +1,83 @@
+package com.fs.live.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+public class FsStoreLiveVO {
+
+    private Long storeId;
+
+    /** 所属城市ids */
+    private String cityIds;
+
+    /** 店铺名称 */
+    private String storeName;
+
+    /** 店铺介绍 */
+    private String descs;
+
+    /** 店铺LOGO */
+    private String logoUrl;
+
+    /** 地址 */
+    private String address;
+
+    /** 经度 */
+    private String lng;
+
+    /** 维度 */
+    private String lat;
+
+    /** 店铺电话 */
+    private String phone;
+
+    /** 资质证书 */
+    private String licenseImages;
+
+    /** 商品总数 */
+    private Long productCount;
+
+    /** 状态 */
+    private Integer status;
+
+    /** 销量 */
+    private Long salesCount;
+
+    /** 余额 */
+    private BigDecimal balance;
+
+    /** 累计金额 */
+    private BigDecimal totalMoney;
+
+    /** 审核状态 */
+    private Integer isAudit;
+
+    /** 登录帐号 */
+    private String account;
+
+    /** 配送方式 1=配送 ,2=到店自提 */
+    private String shippingType;
+
+    private Integer brokerageType;
+
+    private Integer brokerageRate;
+
+    private String fullName;
+
+    private String refundPhone;
+    private String refundAddress;
+    private String refundConsignee;
+
+    private Integer deliveryType;
+
+    private String sendPhone;
+
+    // 是否收藏
+    private Boolean isFavorite;
+
+    // 商品列表
+    List<LiveGoodsVo> goodsList;
+}

+ 3 - 0
fs-service/src/main/java/com/fs/live/vo/LiveGoodsVo.java

@@ -19,4 +19,7 @@ public class LiveGoodsVo {
     private Long productId;
     private BigDecimal otPrice;
     private Long storeId;
+
+    // 是否收藏
+    private Boolean isFavorite;
 }

+ 8 - 0
fs-service/src/main/resources/mapper/his/FsStoreMapper.xml

@@ -58,6 +58,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where store_id = #{storeId}
     </select>
 
+    <select id="selectFsStoreLiveByMap" resultType="com.fs.live.vo.FsStoreLiveVO">
+        select s.*,
+               if(uf.favorite_id is not null, true, false) as isFavorite
+        from fs_store s
+        left join live_user_favorite uf on s.store_id = uf.store_id and uf.user_id = #{params.userId}
+        where s.store_id = #{params.storeId}
+    </select>
+
     <insert id="insertFsStore" parameterType="FsStore" useGeneratedKeys="true" keyProperty="storeId">
         insert into fs_store
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 9 - 0
fs-service/src/main/resources/mapper/live/LiveGoodsMapper.xml

@@ -206,4 +206,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
+    <select id="selectLiveGoodsListByStoreId" resultType="com.fs.live.vo.LiveGoodsVo">
+        select
+            g.*,
+            if(uf.favorite_id is not null, true, false) isFavorite
+        from live_goods g
+        left join live_user_favorite uf on uf.product_id = g.goods_id and uf.user_id = #{params.userId}
+        where g.store_id = #{params.storeId} and g.status = 1
+    </select>
+
 </mapper>

+ 0 - 20
fs-service/src/main/resources/mapper/live/LiveUserFavoriteMapper.xml

@@ -60,10 +60,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where favorite_id = #{favoriteId}
     </update>
 
-    <delete id="deleteLiveUserFavoriteByFavoriteId" parameterType="Long">
-        delete from live_user_favorite where favorite_id = #{favoriteId}
-    </delete>
-
     <delete id="deleteLiveUserFavoriteByFavoriteIds" parameterType="String">
         delete from live_user_favorite where favorite_id in
         <foreach item="favoriteId" collection="array" open="(" separator="," close=")">
@@ -80,20 +76,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         delete from live_user_favorite where live_id = #{liveId} and user_id = #{userId}
     </delete>
 
-    <select id="selectByIds" parameterType="Long" resultMap="LiveUserFavoriteResult">
-        <include refid="selectLiveUserFavoriteVo"/>
-        where
-        live_id = #{liveId} and user_id = #{userId}
-        <if test="productId != null">and product_id = #{productId}</if>
-        <if test="storeId != null">and store_id = #{storeId}</if>
-    </select>
-
-    <delete id="deleteLiveUserFavoriteByIds" parameterType="Long">
-        delete from live_user_favorite
-               where live_id = #{liveId}
-                and user_id = #{userId}
-        <if test="productId != null">and product_id = #{productId}</if>
-        <if test="storeId != null">and store_id = #{storeId}</if>
-    </delete>
-
 </mapper>