package com.foreverwin.mesnac.meapi.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.meapi.model.ShopOrder;
import com.foreverwin.mesnac.meapi.mapper.ShopOrderMapper;
import com.foreverwin.mesnac.meapi.service.ShopOrderService;
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 Leon.L
 * @since 2021-06-01
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder> implements ShopOrderService {


    @Autowired
    private ShopOrderMapper shopOrderMapper;

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

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


}