package com.zt.plat.module.qms.business.bus.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.util.MyBatisUtils;
import com.zt.plat.module.qms.business.bus.controller.vo.SampleProjectResultDetailReqVO;
import com.zt.plat.module.qms.business.bus.controller.vo.SampleProjectResultDetailRespVO;
import com.zt.plat.module.qms.business.bus.controller.vo.SampleProjectResultPageReqVO;
import com.zt.plat.module.qms.business.bus.controller.vo.SampleProjectResultRespVO;
import com.zt.plat.module.qms.business.bus.dal.mapper.SampleResultQueryMapper;

import jakarta.annotation.Resource;

@Service
public class SampleResultQueryServiceImpl implements SampleResultQueryService {
	
	@Resource
	private SampleResultQueryMapper sampleResultQueryMapper;

	@Override
	public PageResult<SampleProjectResultRespVO> sampleProjectResultQuery(SampleProjectResultPageReqVO reqVO) {
		IPage<SampleProjectResultRespVO> mpPage = MyBatisUtils.buildPage((PageParam)reqVO);
		Page<SampleProjectResultRespVO> pageResult = sampleResultQueryMapper.sampleProjectResultQuery(mpPage, reqVO);
		return new PageResult<SampleProjectResultRespVO>(pageResult.getRecords(), pageResult.getTotal());
	}

	@Override
	public List<SampleProjectResultDetailRespVO> sampleProjectResultDetailQuery(SampleProjectResultDetailReqVO reqVO) {
		return sampleResultQueryMapper.sampleProjectResultDetailQuery(reqVO);
	}

}
