package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.domain.EpsBusinessScript;
import com.ruoyi.system.mapper.EpsBusinessScriptMapper;
import com.ruoyi.system.service.IEpsBusinessScriptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务脚本管理Service业务层处理
 * 
 * @author gyt
 * @date 2025-10-13
 */
@Service
public class EpsBusinessScriptServiceImpl implements IEpsBusinessScriptService 
{
    @Autowired
    private EpsBusinessScriptMapper epsBusinessScriptMapper;

    /**
     * 查询业务脚本管理
     * 
     * @param id 业务脚本管理主键
     * @return 业务脚本管理
     */
    @Override
    public EpsBusinessScript selectEpsBusinessScriptById(Long id)
    {
        return epsBusinessScriptMapper.selectEpsBusinessScriptById(id);
    }

    /**
     * 查询业务脚本管理列表
     * 
     * @param epsBusinessScript 业务脚本管理
     * @return 业务脚本管理
     */
    @Override
    public List<EpsBusinessScript> selectEpsBusinessScriptList(EpsBusinessScript epsBusinessScript)
    {
        return epsBusinessScriptMapper.selectEpsBusinessScriptList(epsBusinessScript);
    }

    /**
     * 新增业务脚本管理
     * 
     * @param epsBusinessScript 业务脚本管理
     * @return 结果
     */
    @Override
    public int insertEpsBusinessScript(EpsBusinessScript epsBusinessScript)
    {
        epsBusinessScript.setCreateTime(DateUtils.getNowDate());
        epsBusinessScript.setCreateBy(SecurityUtils.getUsername());
        return epsBusinessScriptMapper.insertEpsBusinessScript(epsBusinessScript);
    }

    /**
     * 修改业务脚本管理
     * 
     * @param epsBusinessScript 业务脚本管理
     * @return 结果
     */
    @Override
    public int updateEpsBusinessScript(EpsBusinessScript epsBusinessScript)
    {
        epsBusinessScript.setUpdateTime(DateUtils.getNowDate());
        return epsBusinessScriptMapper.updateEpsBusinessScript(epsBusinessScript);
    }

    /**
     * 批量删除业务脚本管理
     * 
     * @param ids 需要删除的业务脚本管理主键
     * @return 结果
     */
    @Override
    public int deleteEpsBusinessScriptByIds(Long[] ids)
    {
        return epsBusinessScriptMapper.deleteEpsBusinessScriptByIds(ids);
    }

    /**
     * 删除业务脚本管理信息
     * 
     * @param id 业务脚本管理主键
     * @return 结果
     */
    @Override
    public int deleteEpsBusinessScriptById(Long id)
    {
        return epsBusinessScriptMapper.deleteEpsBusinessScriptById(id);
    }
}
