package com.foreverwin.mesnac.anomaly.service.impl;

import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillMapper;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 * 异常单 服务实现类
 * </p>
 *
 * @author robert
 * @since 2021-06-25
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, AbnormalBill> implements AbnormalBillService {


    @Autowired
    private AbnormalBillMapper abnormalBillMapper;

    @Override
    public IPage<AbnormalBill> selectPage(FrontPage<AbnormalBill> frontPage, AbnormalBill abnormalBill) {
        QueryWrapper<AbnormalBill> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(abnormalBill);
        return super.page(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<AbnormalBill> selectList(AbnormalBill abnormalBill) {
        QueryWrapper<AbnormalBill> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(abnormalBill);
        return super.list(queryWrapper);
    }


}