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


import com.schisandra.system.infra.basic.dao.SchisandraSysLogDao;
import com.schisandra.system.infra.basic.entity.SchisandraSysLog;
import com.schisandra.system.infra.basic.service.SchisandraSysLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Objects;

/**
 *  表服务实现类
 *
 * @author landaiqing
 * @since 2024-05-12 14:21:42
 */
@Service("SchisandraSysLogService")
public class SchisandraSysLogServiceImpl implements SchisandraSysLogService {

    @Resource
    private SchisandraSysLogDao schisandraSysLogDao;

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

    /**
     * 新增数据
     *
     * @param schisandraSysLog 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(SchisandraSysLog schisandraSysLog) {
        return this.schisandraSysLogDao.insert(schisandraSysLog);
    }

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

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


}
