123456789101112131415161718192021222324252627282930313233343536 |
- <?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.ydl.exam.modules.exam.mapper.ExamRepoMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.ydl.exam.modules.exam.entity.ExamRepo">
- <id column="id" property="id" />
- <result column="exam_id" property="examId" />
- <result column="repo_id" property="repoId" />
- <result column="radio_count" property="radioCount" />
- <result column="radio_score" property="radioScore" />
- <result column="multi_count" property="multiCount" />
- <result column="multi_score" property="multiScore" />
- <result column="judge_count" property="judgeCount" />
- <result column="judge_score" property="judgeScore" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- `id`,`exam_id`,`repo_id`,`radio_count`,`radio_score`,`multi_count`,`multi_score`,`judge_count`,`judge_score`
- </sql>
- <resultMap id="ExtResultMap" type="com.ydl.exam.modules.exam.dto.ext.ExamRepoExtDTO" extends="BaseResultMap">
- <result column="totalRadio" property="totalRadio" />
- <result column="totalMulti" property="totalMulti" />
- <result column="totalJudge" property="totalJudge" />
- </resultMap>
- <select id="listByExam" resultMap="ExtResultMap">
- SELECT ep.*,repo.radio_count AS totalRadio,repo.multi_count AS totalMulti,repo.judge_count AS totalJudge
- FROM el_exam_repo ep
- LEFT JOIN el_repo repo ON ep.repo_id=repo.id
- WHERE ep.exam_id=#{examId}
- </select>
- </mapper>
|