package com.tao.service.impl;

import com.tao.mapper.AppPageMapper;
import com.tao.pojo.AppPage;
import com.tao.service.AppPageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName AppPageServiceImpl
 * @Description TODO
 * @Author zhangyuantao
 * @Date 2022/12/10 9:39
 * @Version 1.0
 */
@Service
public class AppPageServiceImpl implements AppPageService {

    @Autowired
    AppPageMapper appPageMapper;

    /**
     * @param id ID
     * @return com.tao.pojo.AppPage
     * @Description 根据ID查找元素
     */
    @Override
    public AppPage selectAppPageById(Long id) {
        return appPageMapper.selectAppPageById(id);
    }

    /**
     * @param pageName
     * @return com.tao.pojo.AppPage
     * @Description 根据页面名称查找元素
     */
    @Override
    public AppPage selectAppPageByName(String pageName) {
        return appPageMapper.selectAppPageByName(pageName);
    }

    /**
     * @param appPage 当appPage属性为空时，则返回所有元素
     * @return java.util.List<com.tao.pojo.AppPage>
     * @Description 根据appPage查找元素列表
     */
    @Override
    public List<AppPage> selectAppPageList(AppPage appPage) {
        return appPageMapper.selectAppPageList(appPage);
    }

    /**
     * @param appPage
     * @return int
     * @Description 插入元素
     */
    @Override
    public int insertAppPage(AppPage appPage) {
        return appPageMapper.insertAppPage(appPage);
    }

    /**
     * @param appPage
     * @return int
     * @Description 更新元素
     */
    @Override
    public int updateAppPage(AppPage appPage) {
        return appPageMapper.updateAppPage(appPage);
    }

    /**
     * @param id
     * @return int
     * @Description 根据ID删除元素
     */
    @Override
    public int deleteAppPageById(Long id) {
        return appPageMapper.deleteAppPageById(id);
    }

    /**
     * @return int
     * @Description 删除全部数据
     */
    @Override
    public int deleteAll() {
        return appPageMapper.deleteAll();
    }
}
