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.ResourceTypeResource;
import com.foreverwin.mesnac.meapi.mapper.ResourceTypeResourceMapper;
import com.foreverwin.mesnac.meapi.service.ResourceTypeResourceService;
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 pavel.Liu
 * @since 2021-07-09
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ResourceTypeResourceServiceImpl extends ServiceImpl<ResourceTypeResourceMapper, ResourceTypeResource> implements ResourceTypeResourceService {


    @Autowired
    private ResourceTypeResourceMapper resourceTypeResourceMapper;

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

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


}