package com.ztmap.project.zhny.electricpowergeneration.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.electricpowergeneration.mapper.TElectricPowerGenerationMapper;
import com.ztmap.project.zhny.electricpowergeneration.domain.TElectricPowerGeneration;
import com.ztmap.project.zhny.electricpowergeneration.service.ITElectricPowerGenerationService;
import com.ztmap.common.utils.text.Convert;

/**
 * 发电量Service业务层处理
 * 
 * @author ztmap
 * @date 2023-10-09
 */
@Service
public class TElectricPowerGenerationServiceImpl implements ITElectricPowerGenerationService 
{
    @Autowired
    private TElectricPowerGenerationMapper tElectricPowerGenerationMapper;

    /**
     * 查询发电量
     * 
     * @param id 发电量ID
     * @return 发电量
     */
    @Override
    public TElectricPowerGeneration selectTElectricPowerGenerationById(Long id)
    {
        return tElectricPowerGenerationMapper.selectTElectricPowerGenerationById(id);
    }

    /**
     * 查询发电量列表
     * 
     * @param tElectricPowerGeneration 发电量
     * @return 发电量
     */
    @Override
    public List<TElectricPowerGeneration> selectTElectricPowerGenerationList(TElectricPowerGeneration tElectricPowerGeneration)
    {
        return tElectricPowerGenerationMapper.selectTElectricPowerGenerationList(tElectricPowerGeneration);
    }

    /**
     * 新增发电量
     * 
     * @param tElectricPowerGeneration 发电量
     * @return 结果
     */
    @Override
    public int insertTElectricPowerGeneration(TElectricPowerGeneration tElectricPowerGeneration)
    {
        tElectricPowerGeneration.setCreateTime(DateUtils.getNowDate());
        return tElectricPowerGenerationMapper.insertTElectricPowerGeneration(tElectricPowerGeneration);
    }

    /**
     * 修改发电量
     * 
     * @param tElectricPowerGeneration 发电量
     * @return 结果
     */
    @Override
    public int updateTElectricPowerGeneration(TElectricPowerGeneration tElectricPowerGeneration)
    {
        return tElectricPowerGenerationMapper.updateTElectricPowerGeneration(tElectricPowerGeneration);
    }

    /**
     * 删除发电量对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTElectricPowerGenerationByIds(String ids)
    {
        return tElectricPowerGenerationMapper.deleteTElectricPowerGenerationByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除发电量信息
     * 
     * @param id 发电量ID
     * @return 结果
     */
    @Override
    public int deleteTElectricPowerGenerationById(Long id)
    {
        return tElectricPowerGenerationMapper.deleteTElectricPowerGenerationById(id);
    }
}
