package com.xinelu.manage.service.scriptinfoedge.impl;

import com.xinelu.manage.domain.scriptinfoedge.ScriptInfoEdge;
import com.xinelu.manage.mapper.scriptinfoedge.ScriptInfoEdgeMapper;
import com.xinelu.manage.service.scriptinfoedge.IScriptInfoEdgeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 话术信息分支Service业务层处理
 *
 * @author xinelu
 * @date 2024-06-12
 */
@Service
public class ScriptInfoEdgeServiceImpl implements IScriptInfoEdgeService {
    @Resource
    private ScriptInfoEdgeMapper scriptInfoEdgeMapper;

    /**
     * 查询话术信息分支
     *
     * @param id 话术信息分支主键
     * @return 话术信息分支
     */
    @Override
    public ScriptInfoEdge selectScriptInfoEdgeById(Long id) {
        return scriptInfoEdgeMapper.selectScriptInfoEdgeById(id);
    }

    /**
     * 查询话术信息分支列表
     *
     * @param scriptInfoEdge 话术信息分支
     * @return 话术信息分支
     */
    @Override
    public List<ScriptInfoEdge> selectScriptInfoEdgeList(ScriptInfoEdge scriptInfoEdge) {
        return scriptInfoEdgeMapper.selectScriptInfoEdgeList(scriptInfoEdge);
    }

    /**
     * 新增话术信息分支
     *
     * @param scriptInfoEdge 话术信息分支
     * @return 结果
     */
    @Override
    public int insertScriptInfoEdge(ScriptInfoEdge scriptInfoEdge) {
        scriptInfoEdge.setCreateTime(LocalDateTime.now());
        return scriptInfoEdgeMapper.insertScriptInfoEdge(scriptInfoEdge);
    }

    /**
     * 修改话术信息分支
     *
     * @param scriptInfoEdge 话术信息分支
     * @return 结果
     */
    @Override
    public int updateScriptInfoEdge(ScriptInfoEdge scriptInfoEdge) {
        scriptInfoEdge.setUpdateTime(LocalDateTime.now());
        return scriptInfoEdgeMapper.updateScriptInfoEdge(scriptInfoEdge);
    }

    /**
     * 批量删除话术信息分支
     *
     * @param ids 需要删除的话术信息分支主键
     * @return 结果
     */
    @Override
    public int deleteScriptInfoEdgeByIds(Long[] ids) {
        return scriptInfoEdgeMapper.deleteScriptInfoEdgeByIds(ids);
    }

    /**
     * 删除话术信息分支信息
     *
     * @param id 话术信息分支主键
     * @return 结果
     */
    @Override
    public int deleteScriptInfoEdgeById(Long id) {
        return scriptInfoEdgeMapper.deleteScriptInfoEdgeById(id);
    }
}
