package org.dromara.zhishu.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.annotation.DataColumn;
import org.dromara.common.mybatis.annotation.DataPermission;
import org.dromara.zhishu.domain.ShopGoodsPublished;
import org.dromara.zhishu.domain.bo.ShopGoodsPublishedBo;
import org.dromara.zhishu.domain.vo.PlatformIdUpdateVO;
import org.dromara.zhishu.domain.vo.ShopGoodsPublishedVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;

import java.util.List;
import java.util.Map;

/**
 * 记录已发布书籍Mapper接口
 *
 * @author yxy
 * @date 2025-04-11
 */
@Mapper
public interface ShopGoodsPublishedMapper extends BaseMapperPlus<ShopGoodsPublished, ShopGoodsPublishedVo> {


    /**
     * 根据shop_goods_id批量查询
     * @param shopGoodsIds 商品ID列表
     * @return 查询结果列表
     */
    List<ShopGoodsPublishedVo> selectByShopGoodsIds(@Param("shopGoodsIds") List<Long> shopGoodsIds,@Param("shopId") Long shopId);


    List<String> selectListByShopsId(Long shopId);

    List<ShopGoodsPublishedVo> selectShopGoodsPublishedByShopIdAndArtNo(@Param("shopId") Long shopId,@Param("artNo") String artNo);

    ShopGoodsPublishedVo selectDataById(Long id);


    Page<ShopGoodsPublishedVo> selectDataList(@Param("page") Page<ShopGoodsPublished> page,@Param("bo") ShopGoodsPublishedBo bo);

    Boolean delShopGoodsPublished(@Param("shopId") String shopId,@Param("platformId") String platformId);

    Boolean delByIds(Long id);

    Boolean delByShopId(Long shopId);

    /**
     * 批量查询商品发布状态
     *
     * @param goodsIds 商品ID列表
     * @param shopIds 店铺ID列表
     * @return 商品ID和发布状态的映射
     */
    List<Map<String, Object>> selectPublishedStatus(@Param("goodsIds") List<String> goodsIds, @Param("shopIds") List<Long> shopIds);

    List<String> getPlatFormIdsByShopId( @Param("shopId") Long shopId);

    void batchUpdateKfzPlatformId(@Param("platformIdUpdateVOList") List<PlatformIdUpdateVO> platformIdUpdateVOList);

    ShopGoodsPublishedVo selectDataByPlatformId(@Param("platformId")Long platformId ,@Param("shopId")Long shopId);

    void batchDeleteByIds(List<Long> ids);
}
