package com.schisandra.oss.infra.basic.service.impl;

import com.schisandra.oss.infra.basic.entity.SchisandraOssLocal;
import com.schisandra.oss.infra.basic.dao.SchisandraOssLocalDao;
import com.schisandra.oss.infra.basic.service.SchisandraOssLocalService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 本地存储配置表 表服务实现类
 *
 * @author landaiqing
 * @since 2024-06-02 22:18:08
 */
@Service("SchisandraOssLocalService")
public class SchisandraOssLocalServiceImpl implements SchisandraOssLocalService {

    @Resource
    private SchisandraOssLocalDao schisandraOssLocalDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public SchisandraOssLocal queryById(Long id) {
        return this.schisandraOssLocalDao.selectOneById(id);
    }

    /**
     * 新增数据
     *
     * @param schisandraOssLocal 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(SchisandraOssLocal schisandraOssLocal) {
        return this.schisandraOssLocalDao.insert(schisandraOssLocal,true);
    }

    /**
     * 修改数据
     *
     * @param schisandraOssLocal 实例对象
     * @return 实例对象
     */
    @Override
    public int update(SchisandraOssLocal schisandraOssLocal) {
        return this.schisandraOssLocalDao.update(schisandraOssLocal,true);
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.schisandraOssLocalDao.deleteById(id) > 0;
    }


}
