package com.inspect.resultmain.service.impl;

import com.inspect.base.core.utils.DateUtils;
import com.inspect.resultmain.domain.PatrolTaskResultMain;
import com.inspect.resultmain.mapper.PatrolTaskResultMainMapper;
import com.inspect.resultmain.service.IPatrolTaskResultMainService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PatrolTaskResultMainServiceImpl implements IPatrolTaskResultMainService {
    private final PatrolTaskResultMainMapper patrolTaskResultMainMapper;

    public PatrolTaskResultMainServiceImpl(PatrolTaskResultMainMapper patrolTaskResultMainMapper) {
        this.patrolTaskResultMainMapper = patrolTaskResultMainMapper;
    }

    public PatrolTaskResultMain selectPatrolTaskResultMainByLineId(Long lineId) {
        return this.patrolTaskResultMainMapper.selectPatrolTaskResultMainByLineId(lineId);
    }

    public List<PatrolTaskResultMain> selectPatrolTaskResultMainList(PatrolTaskResultMain patrolTaskResultMain) {
        return this.patrolTaskResultMainMapper.selectPatrolTaskResultMainList(patrolTaskResultMain);
    }

    public PatrolTaskResultMain selectPatrolTaskResultMainByTaskPatrolledId(String taskPatrolledId) {
        return this.patrolTaskResultMainMapper.selectPatrolTaskResultMainByTaskPatrolledId(taskPatrolledId);
    }

    public List<PatrolTaskResultMain> selectPatrolTaskResultMainByTaskPatrolledIds(List<String> taskPatrolledIds) {
        return this.patrolTaskResultMainMapper.selectPatrolTaskResultMainByTaskPatrolledIds(taskPatrolledIds);
    }

    public List<PatrolTaskResultMain> selectPatrolTaskResultMain(PatrolTaskResultMain patrolTaskResultMain) {
        return this.patrolTaskResultMainMapper.selectPatrolTaskResultMain(patrolTaskResultMain);
    }

    public String selectUnifiedTaskPatrolledId(PatrolTaskResultMain patrolTaskResultMain) {
        return this.patrolTaskResultMainMapper.selectUnifiedTaskPatrolledId(patrolTaskResultMain);
    }

    public int insertPatrolTaskResultMain(PatrolTaskResultMain patrolTaskResultMain) {
        patrolTaskResultMain.setCreateTime(DateUtils.getNowDate());
        this.patrolTaskResultMainMapper.insertPatrolTaskResultMain(patrolTaskResultMain);
        return patrolTaskResultMain.getLineId().intValue();
    }

    public int updatePatrolTaskResultMain(PatrolTaskResultMain patrolTaskResultMain) {
        return this.patrolTaskResultMainMapper.updatePatrolTaskResultMain(patrolTaskResultMain);
    }

    public int deletePatrolTaskResultMainByLineIds(Long[] lineIds) {
        return this.patrolTaskResultMainMapper.deletePatrolTaskResultMainByLineIds(lineIds);
    }

    public int deletePatrolTaskResultMainByLineId(Long lineId) {
        return this.patrolTaskResultMainMapper.deletePatrolTaskResultMainByLineId(lineId);
    }

    public List<PatrolTaskResultMain> selectMainFileStatus(List<String> patrolIds) {
        return this.patrolTaskResultMainMapper.selectMainFileStatus(patrolIds);
    }

    @Override
    public List<Long> selectLineIds(Long lineId) {
        return this.patrolTaskResultMainMapper.selectLineIds(lineId);
    }

    @Override
    public List<Long> selectLineIdsByList(List<Long> lineIds) {
        return this.patrolTaskResultMainMapper.selectLineIdsByList(lineIds);
    }

    @Override
    public PatrolTaskResultMain selectPatrolTaskResultMainOne(String patrolTaskId) {
        return this.patrolTaskResultMainMapper.selectPatrolTaskResultMainOne(patrolTaskId);
    }
}
