package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.illegalParking.IllegalParking;
import com.ruoyi.system.mapper.IllegalParkingMapper;
import com.ruoyi.system.service.IIllegalParkingService;
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 IllegalParkingServiceImpl implements IIllegalParkingService 
{
    @Autowired
    private IllegalParkingMapper illegalParkingMapper;

    /**
     * 查询违章停车登记
     * 
     * @param illegalParkingId 违章停车登记主键
     * @return 违章停车登记
     */
    @Override
    public IllegalParking selectIllegalParkingByIllegalParkingId(Long illegalParkingId)
    {
        return illegalParkingMapper.selectIllegalParkingByIllegalParkingId(illegalParkingId);
    }

    /**
     * 查询违章停车登记列表
     * 
     * @param illegalParking 违章停车登记
     * @return 违章停车登记
     */
    @Override
    public List<IllegalParking> selectIllegalParkingList(IllegalParking illegalParking)
    {
        return illegalParkingMapper.selectIllegalParkingList(illegalParking);
    }

    /**
     * 新增违章停车登记
     * 
     * @param illegalParking 违章停车登记
     * @return 结果
     */
    @Override
    public int insertIllegalParking(IllegalParking illegalParking)
    {
        illegalParking.setCreateTime(DateUtils.getNowDate());
        return illegalParkingMapper.insertIllegalParking(illegalParking);
    }

    /**
     * 修改违章停车登记
     * 
     * @param illegalParking 违章停车登记
     * @return 结果
     */
    @Override
    public int updateIllegalParking(IllegalParking illegalParking)
    {
        illegalParking.setUpdateTime(DateUtils.getNowDate());
        return illegalParkingMapper.updateIllegalParking(illegalParking);
    }

    /**
     * 批量删除违章停车登记
     * 
     * @param illegalParkingIds 需要删除的违章停车登记主键
     * @return 结果
     */
    @Override
    public int deleteIllegalParkingByIllegalParkingIds(Long[] illegalParkingIds)
    {
        return illegalParkingMapper.deleteIllegalParkingByIllegalParkingIds(illegalParkingIds);
    }

    /**
     * 删除违章停车登记信息
     * 
     * @param illegalParkingId 违章停车登记主键
     * @return 结果
     */
    @Override
    public int deleteIllegalParkingByIllegalParkingId(Long illegalParkingId)
    {
        return illegalParkingMapper.deleteIllegalParkingByIllegalParkingId(illegalParkingId);
    }
}
