package com.ygtx.gxt.service.impl;

import java.util.List;
import com.ygtx.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ygtx.gxt.mapper.GxtRepairOrderMapper;
import com.ygtx.gxt.domain.GxtRepairOrder;
import com.ygtx.gxt.service.IGxtRepairOrderService;

/**
 * 维修工单Service业务层处理
 * 
 * @author ouyj
 * @date 2025-10-30
 */
@Service
public class GxtRepairOrderServiceImpl implements IGxtRepairOrderService 
{
    @Autowired
    private GxtRepairOrderMapper gxtRepairOrderMapper;

    /**
     * 查询维修工单
     * 
     * @param id 维修工单主键
     * @return 维修工单
     */
    @Override
    public GxtRepairOrder selectGxtRepairOrderById(Long id)
    {
        return gxtRepairOrderMapper.selectGxtRepairOrderById(id);
    }

    /**
     * 查询维修工单列表
     * 
     * @param gxtRepairOrder 维修工单
     * @return 维修工单
     */
    @Override
    public List<GxtRepairOrder> selectGxtRepairOrderList(GxtRepairOrder gxtRepairOrder)
    {
        return gxtRepairOrderMapper.selectGxtRepairOrderList(gxtRepairOrder);
    }

    /**
     * 新增维修工单
     * 
     * @param gxtRepairOrder 维修工单
     * @return 结果
     */
    @Override
    public int insertGxtRepairOrder(GxtRepairOrder gxtRepairOrder)
    {
        gxtRepairOrder.setCreateTime(DateUtils.getNowDate());
        return gxtRepairOrderMapper.insertGxtRepairOrder(gxtRepairOrder);
    }

    /**
     * 修改维修工单
     * 
     * @param gxtRepairOrder 维修工单
     * @return 结果
     */
    @Override
    public int updateGxtRepairOrder(GxtRepairOrder gxtRepairOrder)
    {
        gxtRepairOrder.setUpdateTime(DateUtils.getNowDate());
        return gxtRepairOrderMapper.updateGxtRepairOrder(gxtRepairOrder);
    }

    /**
     * 批量删除维修工单
     * 
     * @param ids 需要删除的维修工单主键
     * @return 结果
     */
    @Override
    public int deleteGxtRepairOrderByIds(Long[] ids)
    {
        return gxtRepairOrderMapper.deleteGxtRepairOrderByIds(ids);
    }

    /**
     * 删除维修工单信息
     * 
     * @param id 维修工单主键
     * @return 结果
     */
    @Override
    public int deleteGxtRepairOrderById(Long id)
    {
        return gxtRepairOrderMapper.deleteGxtRepairOrderById(id);
    }
}
