package com.ztmap.project.zhny.energystoragestatus.service.impl;

import java.util.List;
import com.ztmap.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ztmap.project.zhny.energystoragestatus.mapper.TEnergyStorageStatusMapper;
import com.ztmap.project.zhny.energystoragestatus.domain.TEnergyStorageStatus;
import com.ztmap.project.zhny.energystoragestatus.service.ITEnergyStorageStatusService;
import com.ztmap.common.utils.text.Convert;

/**
 * 储能状态Service业务层处理
 * 
 * @author ztmap
 * @date 2023-10-09
 */
@Service
public class TEnergyStorageStatusServiceImpl implements ITEnergyStorageStatusService 
{
    @Autowired
    private TEnergyStorageStatusMapper tEnergyStorageStatusMapper;

    /**
     * 查询储能状态
     * 
     * @param id 储能状态ID
     * @return 储能状态
     */
    @Override
    public TEnergyStorageStatus selectTEnergyStorageStatusById(Long id)
    {
        return tEnergyStorageStatusMapper.selectTEnergyStorageStatusById(id);
    }

    /**
     * 查询储能状态列表
     * 
     * @param tEnergyStorageStatus 储能状态
     * @return 储能状态
     */
    @Override
    public List<TEnergyStorageStatus> selectTEnergyStorageStatusList(TEnergyStorageStatus tEnergyStorageStatus)
    {
        return tEnergyStorageStatusMapper.selectTEnergyStorageStatusList(tEnergyStorageStatus);
    }

    /**
     * 新增储能状态
     * 
     * @param tEnergyStorageStatus 储能状态
     * @return 结果
     */
    @Override
    public int insertTEnergyStorageStatus(TEnergyStorageStatus tEnergyStorageStatus)
    {
        tEnergyStorageStatus.setCreateTime(DateUtils.getNowDate());
        return tEnergyStorageStatusMapper.insertTEnergyStorageStatus(tEnergyStorageStatus);
    }

    /**
     * 修改储能状态
     * 
     * @param tEnergyStorageStatus 储能状态
     * @return 结果
     */
    @Override
    public int updateTEnergyStorageStatus(TEnergyStorageStatus tEnergyStorageStatus)
    {
        return tEnergyStorageStatusMapper.updateTEnergyStorageStatus(tEnergyStorageStatus);
    }

    /**
     * 删除储能状态对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTEnergyStorageStatusByIds(String ids)
    {
        return tEnergyStorageStatusMapper.deleteTEnergyStorageStatusByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除储能状态信息
     * 
     * @param id 储能状态ID
     * @return 结果
     */
    @Override
    public int deleteTEnergyStorageStatusById(Long id)
    {
        return tEnergyStorageStatusMapper.deleteTEnergyStorageStatusById(id);
    }
}
