package com.hw.dms.service.impl;

import java.util.List;
import com.hw.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.dms.mapper.DmsBillsInspectInstanceMapper;
import com.hw.dms.domain.DmsBillsInspectInstance;
import com.hw.dms.service.IDmsBillsInspectInstanceService;

/**
 * 巡检工单Service业务层处理
 * 
 * @author Open Platform
 * @date 2024-01-23
 */
@Service
public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInstanceService 
{
    @Autowired
    private DmsBillsInspectInstanceMapper dmsBillsInspectInstanceMapper;

    /**
     * 查询巡检工单
     * 
     * @param inspectInstanceId 巡检工单主键
     * @return 巡检工单
     */
    @Override
    public DmsBillsInspectInstance selectDmsBillsInspectInstanceByInspectInstanceId(Long inspectInstanceId)
    {
        return dmsBillsInspectInstanceMapper.selectDmsBillsInspectInstanceByInspectInstanceId(inspectInstanceId);
    }

    /**
     * 查询巡检工单列表
     * 
     * @param dmsBillsInspectInstance 巡检工单
     * @return 巡检工单
     */
    @Override
    public List<DmsBillsInspectInstance> selectDmsBillsInspectInstanceList(DmsBillsInspectInstance dmsBillsInspectInstance)
    {
        return dmsBillsInspectInstanceMapper.selectDmsBillsInspectInstanceList(dmsBillsInspectInstance);
    }

    /**
     * 新增巡检工单
     * 
     * @param dmsBillsInspectInstance 巡检工单
     * @return 结果
     */
    @Override
    public int insertDmsBillsInspectInstance(DmsBillsInspectInstance dmsBillsInspectInstance)
    {
        dmsBillsInspectInstance.setCreateTime(DateUtils.getNowDate());
        return dmsBillsInspectInstanceMapper.insertDmsBillsInspectInstance(dmsBillsInspectInstance);
    }

    /**
     * 修改巡检工单
     * 
     * @param dmsBillsInspectInstance 巡检工单
     * @return 结果
     */
    @Override
    public int updateDmsBillsInspectInstance(DmsBillsInspectInstance dmsBillsInspectInstance)
    {
        dmsBillsInspectInstance.setUpdateTime(DateUtils.getNowDate());
        return dmsBillsInspectInstanceMapper.updateDmsBillsInspectInstance(dmsBillsInspectInstance);
    }

    /**
     * 批量删除巡检工单
     * 
     * @param inspectInstanceIds 需要删除的巡检工单主键
     * @return 结果
     */
    @Override
    public int deleteDmsBillsInspectInstanceByInspectInstanceIds(Long[] inspectInstanceIds)
    {
        return dmsBillsInspectInstanceMapper.deleteDmsBillsInspectInstanceByInspectInstanceIds(inspectInstanceIds);
    }

    /**
     * 删除巡检工单信息
     * 
     * @param inspectInstanceId 巡检工单主键
     * @return 结果
     */
    @Override
    public int deleteDmsBillsInspectInstanceByInspectInstanceId(Long inspectInstanceId)
    {
        return dmsBillsInspectInstanceMapper.deleteDmsBillsInspectInstanceByInspectInstanceId(inspectInstanceId);
    }
}
