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

import com.schisandra.oss.infra.basic.entity.SchisandraOssJd;
import com.schisandra.oss.infra.basic.dao.SchisandraOssJdDao;
import com.schisandra.oss.infra.basic.service.SchisandraOssJdService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 京东云对象存储配置表 表服务实现类
 *
 * @author landaiqing
 * @since 2024-06-02 22:07:10
 */
@Service("SchisandraOssJdService")
public class SchisandraOssJdServiceImpl implements SchisandraOssJdService {

    @Resource
    private SchisandraOssJdDao schisandraOssJdDao;

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

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

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

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


}
