package com.ssm.manage.mapper;

import com.ssm.core.mapper.BaseMapper;
import com.ssm.manage.entity.BlackList;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

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

/**
 * (BlackList)表数据库访问层
 *
 * @author makejava
 * @since 2023-12-20 11:41:45
 */
@Component
public interface BlackListMapper extends BaseMapper<BlackList> {
    @MapKey("id")
    Map<Long, BlackList> selectByIds(@Param("ids") Collection<Long> ids);

    List<BlackList> selectByStoreId(@Param("storeId") Long storeId,@Param("identityCard")  String identityCard);

    List<Long> selectTypeId(@Param("type") Integer type);

    List<BlackList> selectByStoreIdAndIndentityCard(@Param("storeId") Long storeId,@Param("identityCard")  List<String> identityCard);

    //根据身份证号码修改黑白名单状态
    Integer updateByIdentityCard(@Param("identityCard")String identityCard,
                                 @Param("type")Integer type,
                                 @Param("blacklistReasons") String blacklistReasons);

    //根据id批量删除黑白名单表中的临时工
    void delectByIdss(@Param("ids") List<Long> ids);
}
