package com.cool.store.mapper.order;

import com.cool.store.entity.order.StoreWishlistDO;
import com.cool.store.vo.order.MiniStoreWishlistListVO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface StoreWishlistMapper extends Mapper<StoreWishlistDO> {

    int insertBatch(@Param("list") List<StoreWishlistDO> list);

    int softDeleteByLineIdAndStoreTypeAndVersion(@Param("lineId") Long lineId,
                                                 @Param("storeTypeId") Long storeTypeId,
                                                 @Param("versionNo") String versionNo);

    StoreWishlistDO getById(@Param("id") Long id);

    StoreWishlistDO getByPointId(@Param("lineId") Long lineId, @Param("pointId") Long pointId);


    Integer getPointBindWishlistCount(@Param("pointId") Long pointId, @Param("wishlistStatus") Integer wishlistStatus);

    List<StoreWishlistDO> listByLineIdAndStoreTypeAndVersion(@Param("lineId") Long lineId,
                                                             @Param("storeTypeId") Long storeTypeId,
                                                             @Param("versionNo") String versionNo);

    List<MiniStoreWishlistListVO> listByLineId(@Param("lineId") Long lineId,
                                               @Param("storeTypeId") Long storeTypeId,
                                               @Param("wishlistStatus") Integer wishlistStatus);


    List<MiniStoreWishlistListVO> listByVersionList(@Param("keyword") String keyword,
                                                    @Param("storeTypeId") Long storeTypeId,
                                                    @Param("wishlistStatus") Integer wishlistStatus);

    /**
     * 更新心愿单状态 将当前加盟商所有的在待完善加盟资质的心愿单状态改为绑定铺位
     * @param lineId
     * @return
     */
    Boolean updateByLineId(Long lineId) ;

    /**
     * 心愿单解绑点位
     * @return
     */
    Boolean unbindPoint(@Param("wishlistId") Long wishlistId);


}
