package com.ruoyi.model.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.AppPlatformAgreementConfigMapper;
import com.ruoyi.model.domain.AppPlatformAgreementConfig;
import com.ruoyi.model.service.IAppPlatformAgreementConfigService;

/**
 * 平台协议配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-08
 */
@Service
public class AppPlatformAgreementConfigServiceImpl implements IAppPlatformAgreementConfigService 
{
    @Autowired
    private AppPlatformAgreementConfigMapper appPlatformAgreementConfigMapper;

    /**
     * 查询平台协议配置
     * 
     * @param id 平台协议配置主键
     * @return 平台协议配置
     */
    @Override
    public AppPlatformAgreementConfig selectAppPlatformAgreementConfigById(Long id)
    {
        return appPlatformAgreementConfigMapper.selectAppPlatformAgreementConfigById(id);
    }

    /**
     * 查询平台协议配置列表
     * 
     * @param appPlatformAgreementConfig 平台协议配置
     * @return 平台协议配置
     */
    @Override
    public List<AppPlatformAgreementConfig> selectAppPlatformAgreementConfigList(AppPlatformAgreementConfig appPlatformAgreementConfig)
    {
        return appPlatformAgreementConfigMapper.selectAppPlatformAgreementConfigList(appPlatformAgreementConfig);
    }

    /**
     * 新增平台协议配置
     * 
     * @param appPlatformAgreementConfig 平台协议配置
     * @return 结果
     */
    @Override
    public int insertAppPlatformAgreementConfig(AppPlatformAgreementConfig appPlatformAgreementConfig)
    {
        appPlatformAgreementConfig.setCreateTime(DateUtils.getNowDate());
        return appPlatformAgreementConfigMapper.insertAppPlatformAgreementConfig(appPlatformAgreementConfig);
    }

    /**
     * 修改平台协议配置
     * 
     * @param appPlatformAgreementConfig 平台协议配置
     * @return 结果
     */
    @Override
    public int updateAppPlatformAgreementConfig(AppPlatformAgreementConfig appPlatformAgreementConfig)
    {
        appPlatformAgreementConfig.setUpdateTime(DateUtils.getNowDate());
        return appPlatformAgreementConfigMapper.updateAppPlatformAgreementConfig(appPlatformAgreementConfig);
    }

    /**
     * 批量删除平台协议配置
     * 
     * @param ids 需要删除的平台协议配置主键
     * @return 结果
     */
    @Override
    public int deleteAppPlatformAgreementConfigByIds(Long[] ids)
    {
        return appPlatformAgreementConfigMapper.deleteAppPlatformAgreementConfigByIds(ids);
    }

    /**
     * 删除平台协议配置信息
     * 
     * @param id 平台协议配置主键
     * @return 结果
     */
    @Override
    public int deleteAppPlatformAgreementConfigById(Long id)
    {
        return appPlatformAgreementConfigMapper.deleteAppPlatformAgreementConfigById(id);
    }

    @Override
    public AppPlatformAgreementConfig getAppPlatformAgreementConfig() {
        return appPlatformAgreementConfigMapper.getAppPlatformAgreementConfig();
    }
}
