<?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="com.testor.module.train.myManagement.dao.TTrainTestQuestionsExerciseDao">
    <!-- 开启二级缓存 -->
    <!-- <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> -->
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.testor.module.train.myManagement.model.domain.TTrainTestQuestionsExercise">
        <id column="id" property="id"/>
        <id column="parent_id" property="parentId"/>
        <id column="test_questions_id" property="testQuestionsId"/>
        <id column="options_id" property="optionsId"/>
        <id column="is_select" property="isSelect"/>
        <id column="person_id" property="personId"/>
        <id column="tenant_id" property="tenantId"/>
        <id column="process_id" property="processId"/>
        <id column="process_status" property="processStatus"/>
    </resultMap>

    <select id="errorRecord"
            parameterType="com.testor.module.train.myManagement.model.domain.TTrainTestQuestionsExercise"
            resultType="com.testor.module.train.myManagement.model.domain.TTrainTestQuestionsExercise">
        select  DISTINCT e.test_questions_id , e.is_correct
        from t_train_test_questions_exercise e
                 join t_train_test_questions t
                      on e.test_questions_id = t.id
        where e.is_correct = '0' and e.person_id=#{userId}
    </select>
</mapper>