package com.sptg.estate.biz.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.common.core.beans.ResultEnum;
import com.sptg.estate.api.dto.AccessBlackCardDto;
import com.sptg.estate.api.entity.AccessBlackCard;
import com.sptg.estate.biz.mapper.AccessBlackCardMapper;
import com.sptg.estate.biz.service.AccessBlackCardServiceInterface;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * title: UserCardServiceImpl
 * package: com.sptg.estate.biz.security.impl
 * description: 门禁卡黑名单 服务层实现类
 *
 *
 *
 */
@Service
@AllArgsConstructor
public class AccessBlackCardServiceImpl extends ServiceImpl<AccessBlackCardMapper, AccessBlackCard> implements AccessBlackCardServiceInterface {

    @Override
    public ResultBean<Page<AccessBlackCard>> showAccessBlackCardList(AccessBlackCardDto accessBlackCardDto) {
        Wrapper<AccessBlackCard> wrapper = new EntityWrapper<>();

        //排序字段 时间排序
        wrapper.orderBy("t_create_date",false);
        return new ResultBean<>(ResultEnum.SUCCESS,this.selectPage(accessBlackCardDto.getPage(),wrapper));
    }

}
