package com.ruoyi.powerdistribution.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.powerdistribution.mapper.PdmWorkOrganMapper;
import com.ruoyi.powerdistribution.domain.PdmWorkOrgan;
import com.ruoyi.powerdistribution.service.IPdmWorkOrganService;

/**
 * 配网作业机构Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-02
 */
@Service
public class PdmWorkOrganServiceImpl implements IPdmWorkOrganService 
{
    @Autowired
    private PdmWorkOrganMapper pdmWorkOrganMapper;

    /**
     * 查询配网作业机构
     * 
     * @param id 配网作业机构主键
     * @return 配网作业机构
     */
    @Override
    public PdmWorkOrgan selectPdmWorkOrganById(Long id)
    {
        return pdmWorkOrganMapper.selectPdmWorkOrganById(id);
    }

    /**
     * 查询配网作业机构列表
     * 
     * @param pdmWorkOrgan 配网作业机构
     * @return 配网作业机构
     */
    @Override
    public List<PdmWorkOrgan> selectPdmWorkOrganList(PdmWorkOrgan pdmWorkOrgan)
    {
        return pdmWorkOrganMapper.selectPdmWorkOrganList(pdmWorkOrgan);
    }

    /**
     * 新增配网作业机构
     * 
     * @param pdmWorkOrgan 配网作业机构
     * @return 结果
     */
    @Override
    public int insertPdmWorkOrgan(PdmWorkOrgan pdmWorkOrgan)
    {
        pdmWorkOrgan.setCreateTime(DateUtils.getNowDate());
        return pdmWorkOrganMapper.insertPdmWorkOrgan(pdmWorkOrgan);
    }

    /**
     * 修改配网作业机构
     * 
     * @param pdmWorkOrgan 配网作业机构
     * @return 结果
     */
    @Override
    public int updatePdmWorkOrgan(PdmWorkOrgan pdmWorkOrgan)
    {
        pdmWorkOrgan.setUpdateTime(DateUtils.getNowDate());
        return pdmWorkOrganMapper.updatePdmWorkOrgan(pdmWorkOrgan);
    }

    /**
     * 批量删除配网作业机构
     * 
     * @param ids 需要删除的配网作业机构主键
     * @return 结果
     */
    @Override
    public int deletePdmWorkOrganByIds(Long[] ids)
    {
        return pdmWorkOrganMapper.deletePdmWorkOrganByIds(ids);
    }

    /**
     * 删除配网作业机构信息
     * 
     * @param id 配网作业机构主键
     * @return 结果
     */
    @Override
    public int deletePdmWorkOrganById(Long id)
    {
        return pdmWorkOrganMapper.deletePdmWorkOrganById(id);
    }
}
