package com.pdaaphm.biz.service.impl;

import java.util.List;
import java.util.Map;

import com.pdaaphm.biz.dto.SubAlgorithmDTO;
import com.pdaaphm.biz.mapper.AlgorithmMapper;
import com.pdaaphm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pdaaphm.biz.mapper.AlgorithmIoFieldMapper;
import com.pdaaphm.biz.domain.AlgorithmIoField;
import com.pdaaphm.biz.service.IAlgorithmIoFieldService;

/**
 * 算法输入输出字段Service业务层处理
 *
 * @author xlk
 * @date 2023-07-26
 */
@Service
public class AlgorithmIoFieldServiceImpl implements IAlgorithmIoFieldService {
    @Autowired
    private AlgorithmIoFieldMapper algorithmIoFieldMapper;

    /**
     * 查询算法输入输出字段
     *
     * @param id 算法输入输出字段主键
     * @return 算法输入输出字段
     */
    @Override
    public AlgorithmIoField selectAlgorithmIoFieldById(Long id) {
        return algorithmIoFieldMapper.selectAlgorithmIoFieldById(id);
    }

    /**
     * 查询算法输入输出字段列表
     *
     * @param algorithmIoField 算法输入输出字段
     * @return 算法输入输出字段
     */
    @Override
    public List<AlgorithmIoField> selectAlgorithmIoFieldList(AlgorithmIoField algorithmIoField) {
        return algorithmIoFieldMapper.selectAlgorithmIoFieldList(algorithmIoField);
    }

    /**
     * 新增算法输入输出字段
     *
     * @param algorithmIoField 算法输入输出字段
     * @return 结果
     */
    @Override
    public int insertAlgorithmIoField(AlgorithmIoField algorithmIoField) {
        algorithmIoField.setCreateTime(DateUtils.getNowDate());
        return algorithmIoFieldMapper.insertAlgorithmIoField(algorithmIoField);
    }

    /**
     * 修改算法输入输出字段
     *
     * @param algorithmIoField 算法输入输出字段
     * @return 结果
     */
    @Override
    public int updateAlgorithmIoField(AlgorithmIoField algorithmIoField) {
        algorithmIoField.setUpdateTime(DateUtils.getNowDate());
        return algorithmIoFieldMapper.updateAlgorithmIoField(algorithmIoField);
    }

    /**
     * 批量删除算法输入输出字段
     *
     * @param ids 需要删除的算法输入输出字段主键
     * @return 结果
     */
    @Override
    public int deleteAlgorithmIoFieldByIds(Long[] ids) {
        return algorithmIoFieldMapper.deleteAlgorithmIoFieldByIds(ids);
    }

    /**
     * 删除算法输入输出字段信息
     *
     * @param id 算法输入输出字段主键
     * @return 结果
     */
    @Override
    public int deleteAlgorithmIoFieldById(Long id) {
        return algorithmIoFieldMapper.deleteAlgorithmIoFieldById(id);
    }

    @Override
    public List<SubAlgorithmDTO> getIoSubList(Long subTypeId, Long algoId) {
        return algorithmIoFieldMapper.getIoSubList(subTypeId, algoId);
    }
}
