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.PatrolPointMapper;
import com.pm.patrol.service.IPatrolPointService;
import com.pm.common.config.PageData;

/**
 * 巡更点信息Service业务层处理
 *
 * @author pm
 * @date 2025-06-03
 */
@Service
public class PatrolPointServiceImpl implements IPatrolPointService {
    
    @Autowired
    private PatrolPointMapper patrolPointMapper;

    @Override
    public PageData selectPatrolPointById(Long id) {
        return patrolPointMapper.selectPatrolPointById(id);
    }

    @Override
    public List<PageData> selectPatrolPointList(PageData pd) {
        return patrolPointMapper.selectPatrolPointList(pd);
    }

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

    @Override
    public int updatePatrolPoint(PageData pd) {
        pd.put("updateTime", DateUtils.getTime());
        return patrolPointMapper.updatePatrolPoint(pd);
    }

    @Override
    public int deletePatrolPointByIds(Long[] ids) {
        return patrolPointMapper.deletePatrolPointByIds(ids);
    }

    @Override
    public int deletePatrolPointById(Long id) {
        return patrolPointMapper.deletePatrolPointById(id);
    }

    @Override
    public int updatePatrolPointStatus(PageData pd) {
        pd.put("updateTime", DateUtils.getTime());
        return patrolPointMapper.updatePatrolPointStatus(pd);
    }
}