package com.chushang.inspection.project.service.impl;

import com.chushang.common.mybatis.page.CommonParam;
import com.chushang.inspection.project.service.InspectionDataService;
import com.chushang.inspection.work.dto.WrkInfoDTO;
import com.chushang.inspection.work.vo.InspectionConfigVO;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chushang.inspection.project.po.InspectionData;
import com.chushang.inspection.project.mapper.InspectionDataMapper;

import java.util.List;
import java.util.Set;

/**
  * @auther: zhao
  * @date: 2024/6/18 15:39
  */
@Service
public class InspectionDataServiceImpl extends ServiceImpl<InspectionDataMapper, InspectionData> implements InspectionDataService {
    /**
     * 根据工单id 查询对应的 巡检单信息
     * @param wrkId 工单id
     */
    @Override
    public List<InspectionConfigVO> listInspections(Long wrkId) {
        CommonParam commonParam = CommonParam.buildPageRequest();
        return baseMapper.listInspectionsByWrkId(wrkId, commonParam);
    }

    /**
     * 根据工单id, 获取对应 巡检单信息
     */
    public List<InspectionConfigVO> listInspections(Set<Long> wrkIds) {
        CommonParam commonParam = CommonParam.buildPageRequest();
        return baseMapper.listInspectionsByWrkIds(wrkIds, commonParam);
    }

    /**
     * todo 提交巡检单信息
     * @param info 巡检单信息
     */
    @Override
    public void submit(WrkInfoDTO info) {

    }
}
