<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="jnpf.cultivate.mapper.CultivatePositionCourseLogMapper">

    <!-- 通用结果映射 -->
    <resultMap id="baseResultMap" type="jnpf.entity.cultivate.CultivatePositionCourseLogEntity">
        <result column="F_Id" property="id"/>
        <result column="F_EnabledMark" property="enabledMark"/>
        <result column="F_CreatorUserId" property="creatorUserId"/>
        <result column="F_CreatorTime" property="creatorTime"/>
        <result column="F_LastModifyUserId" property="lastModifyUserId"/>
        <result column="F_LastModifyTime" property="lastModifyTime"/>
        <result column="F_TenantId" property="tenantId"/>
        <result column="F_PostLearnId" property="postLearnId"/>
        <result column="F_PostId" property="postId"/>
        <result column="F_GradeId" property="gradeId"/>
        <result column="F_CourseId" property="courseId"/>
        <result column="F_UserId" property="userId"/>
        <result column="F_State" property="state"/>
        <result column="F_ExamId" property="examId"/>
        <result column="F_UserExamId" property="userExamId"/>
        <result column="F_UserExamStatus" property="userExamStatus"/>
        <result column="F_IdentifyId" property="identifyId"/>
        <result column="F_UserIdentifyId" property="userIdentifyId"/>
        <result column="F_UserUserIdentifyStatus" property="userIdentifyStatus"/>
        <result column="F_HasExam" property="hasExam"/>
        <result column="F_HasIdentity" property="hasIdentity"/>
    </resultMap>

    <!-- 根据用户ID和学习地图ID查询岗位学习课程记录 -->
    <select id="queryByUserIdAndPostLearnId" resultMap="baseResultMap">
        SELECT *
        FROM ftb_cultivate_position_course_log
        WHERE F_UserId = #{userId}
          AND F_PostLearnId = #{postLearnId}
          AND F_EnabledMark = 0
        ORDER BY F_CreatorTime DESC
    </select>

    <select id="queryMyAllCompletePositionCourse"  resultMap="baseResultMap">
        SELECT *
        FROM ftb_cultivate_position_course_log
        WHERE F_UserId = #{userId}
          AND F_EnabledMark = 0
          AND F_State = 2
        ORDER BY F_CreatorTime DESC
    </select>
</mapper>
