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

import com.schisandra.oss.infra.basic.entity.SchisandraOssJinshan;
import com.schisandra.oss.infra.basic.dao.SchisandraOssJinshanDao;
import com.schisandra.oss.infra.basic.service.SchisandraOssJinshanService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 金山云对象存储配置表 表服务实现类
 *
 * @author landaiqing
 * @since 2024-06-02 22:13:26
 */
@Service("SchisandraOssJinshanService")
public class SchisandraOssJinshanServiceImpl implements SchisandraOssJinshanService {

    @Resource
    private SchisandraOssJinshanDao schisandraOssJinshanDao;

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

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

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

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


}
