package com.ruoyi.interfaces.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.interfaces.mapper.MdDataFieldMapper;
import com.ruoyi.interfaces.domain.MdDataField;
import com.ruoyi.interfaces.service.IMdDataFieldService;

/**
 * 数据集字段Service业务层处理
 * 
 * @author 朱得糠
 * @date 2025-09-04
 */
@Service
public class MdDataFieldServiceImpl implements IMdDataFieldService 
{
    @Autowired
    private MdDataFieldMapper mdDataFieldMapper;

    /**
     * 查询数据集字段
     * 
     * @param id 数据集字段主键
     * @return 数据集字段
     */
    @Override
    public MdDataField selectMdDataFieldById(Long id)
    {
        return mdDataFieldMapper.selectMdDataFieldById(id);
    }

    /**
     * 查询数据集字段列表
     * 
     * @param mdDataField 数据集字段
     * @return 数据集字段
     */
    @Override
    public List<MdDataField> selectMdDataFieldList(MdDataField mdDataField)
    {
        return mdDataFieldMapper.selectMdDataFieldList(mdDataField);
    }

    /**
     * 新增数据集字段
     * 
     * @param mdDataField 数据集字段
     * @return 结果
     */
    @Override
    public int insertMdDataField(MdDataField mdDataField)
    {
        return mdDataFieldMapper.insertMdDataField(mdDataField);
    }

    /**
     * 修改数据集字段
     * 
     * @param mdDataField 数据集字段
     * @return 结果
     */
    @Override
    public int updateMdDataField(MdDataField mdDataField)
    {
        return mdDataFieldMapper.updateMdDataField(mdDataField);
    }

    /**
     * 批量删除数据集字段
     * 
     * @param ids 需要删除的数据集字段主键
     * @return 结果
     */
    @Override
    public int deleteMdDataFieldByIds(Long[] ids)
    {
        return mdDataFieldMapper.deleteMdDataFieldByIds(ids);
    }

    /**
     * 删除数据集字段信息
     * 
     * @param id 数据集字段主键
     * @return 结果
     */
    @Override
    public int deleteMdDataFieldById(Long id)
    {
        return mdDataFieldMapper.deleteMdDataFieldById(id);
    }

    @Override
    public int deleteMdDataFieldByDcCode(String dcCode) {
        return mdDataFieldMapper.deleteMdDataFieldByDcCode(dcCode);
    }

    @Override
    public List<MdDataField> selectMdDataFieldByDsCode(String dcCode) {
        MdDataField mdDataField = new MdDataField();
        mdDataField.setDcCode(dcCode);
        return mdDataFieldMapper.selectMdDataFieldList(mdDataField);
    }
}
