package jnpf.cultivate.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jnpf.model.cultivate.dto.position.FtbCultivatePositionCourseLevelPageDTO;
import jnpf.model.cultivate.dto.position.FtbCultivatePositionCoursePageDTO;
import jnpf.model.cultivate.dto.position.FtbJobLearningPaginDTO;
import jnpf.model.cultivate.po.position.FtbCultivatePosition;
import jnpf.model.cultivate.v2.course.vo.app.AppCourseSimpleVo;
import jnpf.model.cultivate.v2.course.vo.app.AppCultivateCourseExamVo;
import jnpf.model.cultivate.v2.course.vo.app.AppCultivateCourseIdentityVo;
import jnpf.model.cultivate.v2.course.web.req.V2NextUserCultivateCourseListReq;
import jnpf.model.cultivate.v2.position.vo.AppPracticeCountVo;
import jnpf.model.cultivate.v2.position.vo.WebPositionLearningListVo;
import jnpf.model.cultivate.vo.position.FtbCultivatePositionJobLearnCourseVO;
import jnpf.model.cultivate.vo.position.FtbCultivatePositionLearnLevelVO;
import jnpf.model.cultivate.vo.position.FtbJobLearningPaginatedVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FtbCultivatePositionMapper extends BaseMapper<FtbCultivatePosition> {
    /**
     * 岗位学习已学习课程列表
     */
    List<FtbCultivatePositionJobLearnCourseVO> jobLearningCourseList(@Param("params") FtbCultivatePositionCoursePageDTO ftbCultivatePositionCoursePageDTO);

    /**
     * 岗位学习中课程列表页
     */
    Page<FtbCultivatePositionLearnLevelVO> jobLevelCourseList(@Param("page") Page<FtbCultivatePositionLearnLevelVO> page,
                                                              @Param("params") FtbCultivatePositionCourseLevelPageDTO ftbCultivatePositionCourseLevelPageDTO);

    /**
     * 岗位学习分页列表
     */
    Page<FtbJobLearningPaginatedVO> jobLearningPaginatedList(@Param("page") Page<FtbJobLearningPaginatedVO> page,
                                                             @Param("params") FtbJobLearningPaginDTO ftbJobLearningPaginDTO);

    /**
     * 实操鉴定，根据岗位id+用户id查询，解决换绑问题
     */
    String queryPracticalAppraisalByPostId(@Param("postId") String postId, @Param("userId") String userId);

    /**
     * 是否已经鉴定
     */
    Integer queryIdentificationResults(@Param("postId") String postId, @Param("userId") String userId, @Param("identifyId") String identifyId);

    Page<WebPositionLearningListVo> webPageList(@Param("page") Page<WebPositionLearningListVo> page, @Param("params") FtbJobLearningPaginDTO params);

    Page<AppCourseSimpleVo> allCompleteCourseLists(@Param("page") Page<AppCourseSimpleVo> page,
                                                   @Param("req") V2NextUserCultivateCourseListReq req,
                                                   @Param("courseIds") List<String> courseIds
    );

    Page<AppCultivateCourseExamVo> allCompleteExamLists(@Param("page") Page<AppCultivateCourseExamVo> page,
                                                        @Param("req") V2NextUserCultivateCourseListReq req,
                                                        @Param("examIds") List<String> examIds);

    Page<AppCultivateCourseIdentityVo> allCompleteIdentityLists(
            @Param("page") Page<AppCultivateCourseIdentityVo> page,
            @Param("req") V2NextUserCultivateCourseListReq req,
            @Param("identityIds") List<String> identityIds,
            @Param("positionLearnIds") List<String> positionLearnIds);

    List<AppPracticeCountVo> allCompletePracticeLists(
            @Param("req") V2NextUserCultivateCourseListReq req,
            @Param("practiceIds") List<String> practiceIds);
}
