package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.propertyRepair.PropertyRepair;
import com.ruoyi.system.mapper.PropertyRepairMapper;
import com.ruoyi.system.service.IPropertyRepairService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 物业报修Service业务层处理
 * 
 * @author boman
 * @date 2025-02-14
 */
@Service
public class PropertyRepairServiceImpl implements IPropertyRepairService 
{
    @Autowired
    private PropertyRepairMapper propertyRepairMapper;

    /**
     * 查询物业报修
     * 
     * @param repairId 物业报修主键
     * @return 物业报修
     */
    @Override
    public PropertyRepair selectPropertyRepairByRepairId(Long repairId)
    {
        return propertyRepairMapper.selectPropertyRepairByRepairId(repairId);
    }

    /**
     * 查询物业报修列表
     * 
     * @param propertyRepair 物业报修
     * @return 物业报修
     */
    @Override
    public List<PropertyRepair> selectPropertyRepairList(PropertyRepair propertyRepair)
    {
        return propertyRepairMapper.selectPropertyRepairList(propertyRepair);
    }

    /**
     * 新增物业报修
     * 
     * @param propertyRepair 物业报修
     * @return 结果
     */
    @Override
    public int insertPropertyRepair(PropertyRepair propertyRepair)
    {
        propertyRepair.setCreateTime(DateUtils.getNowDate());
        return propertyRepairMapper.insertPropertyRepair(propertyRepair);
    }

    /**
     * 修改物业报修
     * 
     * @param propertyRepair 物业报修
     * @return 结果
     */
    @Override
    public int updatePropertyRepair(PropertyRepair propertyRepair)
    {
        propertyRepair.setUpdateTime(DateUtils.getNowDate());
        return propertyRepairMapper.updatePropertyRepair(propertyRepair);
    }

    /**
     * 批量删除物业报修
     * 
     * @param repairIds 需要删除的物业报修主键
     * @return 结果
     */
    @Override
    public int deletePropertyRepairByRepairIds(Long[] repairIds)
    {
        return propertyRepairMapper.deletePropertyRepairByRepairIds(repairIds);
    }

    /**
     * 删除物业报修信息
     * 
     * @param repairId 物业报修主键
     * @return 结果
     */
    @Override
    public int deletePropertyRepairByRepairId(Long repairId)
    {
        return propertyRepairMapper.deletePropertyRepairByRepairId(repairId);
    }
}
