package com.pm.patrol.service.impl;

import java.util.List;
import com.pm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pm.patrol.mapper.PatrolRecordMapper;
import com.pm.patrol.service.IPatrolRecordService;
import com.pm.common.config.PageData;

/**
 * 巡更记录Service业务层处理
 *
 * @author pm
 * @date 2025-06-03
 */
@Service
public class PatrolRecordServiceImpl implements IPatrolRecordService {
    
    @Autowired
    private PatrolRecordMapper patrolRecordMapper;

    @Override
    public PageData selectPatrolRecordById(Long id) {
        return patrolRecordMapper.selectPatrolRecordById(id);
    }

    @Override
    public List<PageData> selectPatrolRecordList(PageData pd) {
        return patrolRecordMapper.selectPatrolRecordList(pd);
    }

    @Override
    public int insertPatrolRecord(PageData pd) {
        pd.put("createTime", DateUtils.getTime());
        return patrolRecordMapper.insertPatrolRecord(pd);
    }

    @Override
    public int updatePatrolRecord(PageData pd) {
        return patrolRecordMapper.updatePatrolRecord(pd);
    }

    @Override
    public int deletePatrolRecordById(Long id) {
        return patrolRecordMapper.deletePatrolRecordById(id);
    }
}