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.EmsBatteryClusterMapper;
import com.xzzn.ems.domain.EmsBatteryCluster;
import com.xzzn.ems.service.IEmsBatteryClusterService;

/**
 * 电池簇数据Service业务层处理
 *
 * @author xzzn
 * @date 2025-06-29
 */
@Service
public class EmsBatteryClusterServiceImpl implements IEmsBatteryClusterService
{
    @Autowired
    private EmsBatteryClusterMapper emsBatteryClusterMapper;

    /**
     * 查询电池簇数据
     *
     * @param id 电池簇数据主键
     * @return 电池簇数据
     */
    @Override
    public EmsBatteryCluster selectEmsBatteryClusterById(Long id)
    {
        return emsBatteryClusterMapper.selectEmsBatteryClusterById(id);
    }

    /**
     * 查询电池簇数据列表
     *
     * @param emsBatteryCluster 电池簇数据
     * @return 电池簇数据
     */
    @Override
    public List<EmsBatteryCluster> selectEmsBatteryClusterList(EmsBatteryCluster emsBatteryCluster)
    {
        return emsBatteryClusterMapper.selectEmsBatteryClusterList(emsBatteryCluster);
    }

    /**
     * 新增电池簇数据
     *
     * @param emsBatteryCluster 电池簇数据
     * @return 结果
     */
    @Override
    public int insertEmsBatteryCluster(EmsBatteryCluster emsBatteryCluster)
    {
        emsBatteryCluster.setCreateTime(DateUtils.getNowDate());
        return emsBatteryClusterMapper.insertEmsBatteryCluster(emsBatteryCluster);
    }

    /**
     * 修改电池簇数据
     *
     * @param emsBatteryCluster 电池簇数据
     * @return 结果
     */
    @Override
    public int updateEmsBatteryCluster(EmsBatteryCluster emsBatteryCluster)
    {
        emsBatteryCluster.setUpdateTime(DateUtils.getNowDate());
        return emsBatteryClusterMapper.updateEmsBatteryCluster(emsBatteryCluster);
    }

    /**
     * 批量删除电池簇数据
     *
     * @param ids 需要删除的电池簇数据主键
     * @return 结果
     */
    @Override
    public int deleteEmsBatteryClusterByIds(Long[] ids)
    {
        return emsBatteryClusterMapper.deleteEmsBatteryClusterByIds(ids);
    }

    /**
     * 删除电池簇数据信息
     *
     * @param id 电池簇数据主键
     * @return 结果
     */
    @Override
    public int deleteEmsBatteryClusterById(Long id)
    {
        return emsBatteryClusterMapper.deleteEmsBatteryClusterById(id);
    }
}
