package com.xzzn.ems.service.impl;

import java.util.List;
import com.xzzn.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xzzn.ems.mapper.EmsPcsBranchDataMapper;
import com.xzzn.ems.domain.EmsPcsBranchData;
import com.xzzn.ems.service.IEmsPcsBranchDataService;

/**
 * pcs支路数据Service业务层处理
 *
 * @author xzzn
 * @date 2025-06-29
 */
@Service
public class EmsPcsBranchDataServiceImpl implements IEmsPcsBranchDataService
{
    @Autowired
    private EmsPcsBranchDataMapper emsPcsBranchDataMapper;

    /**
     * 查询pcs支路数据
     *
     * @param id pcs支路数据主键
     * @return pcs支路数据
     */
    @Override
    public EmsPcsBranchData selectEmsPcsBranchDataById(Long id)
    {
        return emsPcsBranchDataMapper.selectEmsPcsBranchDataById(id);
    }

    /**
     * 查询pcs支路数据列表
     *
     * @param emsPcsBranchData pcs支路数据
     * @return pcs支路数据
     */
    @Override
    public List<EmsPcsBranchData> selectEmsPcsBranchDataList(EmsPcsBranchData emsPcsBranchData)
    {
        return emsPcsBranchDataMapper.selectEmsPcsBranchDataList(emsPcsBranchData);
    }

    /**
     * 新增pcs支路数据
     *
     * @param emsPcsBranchData pcs支路数据
     * @return 结果
     */
    @Override
    public int insertEmsPcsBranchData(EmsPcsBranchData emsPcsBranchData)
    {
        emsPcsBranchData.setCreateTime(DateUtils.getNowDate());
        return emsPcsBranchDataMapper.insertEmsPcsBranchData(emsPcsBranchData);
    }

    /**
     * 修改pcs支路数据
     *
     * @param emsPcsBranchData pcs支路数据
     * @return 结果
     */
    @Override
    public int updateEmsPcsBranchData(EmsPcsBranchData emsPcsBranchData)
    {
        emsPcsBranchData.setUpdateTime(DateUtils.getNowDate());
        return emsPcsBranchDataMapper.updateEmsPcsBranchData(emsPcsBranchData);
    }

    /**
     * 批量删除pcs支路数据
     *
     * @param ids 需要删除的pcs支路数据主键
     * @return 结果
     */
    @Override
    public int deleteEmsPcsBranchDataByIds(Long[] ids)
    {
        return emsPcsBranchDataMapper.deleteEmsPcsBranchDataByIds(ids);
    }

    /**
     * 删除pcs支路数据信息
     *
     * @param id pcs支路数据主键
     * @return 结果
     */
    @Override
    public int deleteEmsPcsBranchDataById(Long id)
    {
        return emsPcsBranchDataMapper.deleteEmsPcsBranchDataById(id);
    }

    @Override
    public int insertEmsPcsBranchDataList(List<EmsPcsBranchData> list) {
        for (EmsPcsBranchData item : list) {
            item.setCreateTime(DateUtils.getNowDate());
        }
        return emsPcsBranchDataMapper.insertPcsBranchDataList(list);

    }
}
