package com.younike.system.service.impl;

import com.younike.common.core.domain.AjaxResult;
import com.younike.system.domain.SysTreaty;
import com.younike.system.mapper.SysTreatyMapper;
import com.younike.system.service.ISysTreatyService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 隐私协议Service业务层处理
 *
 * @author elev
 * @date 2022-01-04
 */
@Service
public class SysTreatyServiceImpl implements ISysTreatyService {
    @Autowired
    private SysTreatyMapper sysTreatyMapper;

    /**
     * 查询隐私协议
     *
     * @param id 隐私协议主键
     * @return 隐私协议
     */
    @Override
    public SysTreaty selectSysTreatyById(Long id) {
        return sysTreatyMapper.selectSysTreatyById(id);
    }

    /**
     * 查询隐私协议列表
     *
     * @param sysTreaty 隐私协议
     * @return 隐私协议
     */
    @Override
    public List<SysTreaty> selectSysTreatyList(SysTreaty sysTreaty) {
        return sysTreatyMapper.selectSysTreatyList(sysTreaty);
    }

    /**
     * 新增隐私协议
     *
     * @param sysTreaty 隐私协议
     * @return 结果
     */
    @Override
    public int insertSysTreaty(SysTreaty sysTreaty) {
        return sysTreatyMapper.insertSysTreaty(sysTreaty);
    }

    /**
     * 修改隐私协议
     *
     * @param sysTreaty 隐私协议
     * @return 结果
     */
    @Override
    public int updateSysTreaty(SysTreaty sysTreaty) {

        return sysTreatyMapper.updateSysTreaty(sysTreaty);
    }

    /**
     * 批量删除隐私协议
     *
     * @param ids 需要删除的隐私协议主键
     * @return 结果
     */
    @Override
    public int deleteSysTreatyByIds(Long[] ids) {
        return sysTreatyMapper.deleteSysTreatyByIds(ids);
    }

    /**
     * 删除隐私协议信息
     *
     * @param id 隐私协议主键
     * @return 结果
     */
    @Override
    public int deleteSysTreatyById(Long id) {
        return sysTreatyMapper.deleteSysTreatyById(id);
    }

    @Override
    public SysTreaty getTreatyInfo(SysTreaty sysTreaty) {
        return sysTreatyMapper.selectSysTreatyById(sysTreaty.getId());
    }

}

