|
|
@@ -29,6 +29,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
select id, subjectId, paperName, year, paperType, number, fenshu, paperSource, direct_key, paper_info, tiid, osspath, filename, relate_id, locations, examineeTypes, createTime from learn_paper
|
|
|
</sql>
|
|
|
|
|
|
+ <select id="selectLearnPaperForExam" parameterType="LearnPaper" resultMap="LearnPaperResult">
|
|
|
+ SELECT id, subjectId, paperName, YEAR, paperType, number, fenshu, paperSource, direct_key, p.paper_info, tiid, osspath, filename, relate_id, locations, examineeTypes, createTime, IF(e.`state` IS NULL, 1, e.`state`) status
|
|
|
+ FROM learn_paper p LEFT JOIN `learn_examinee` e ON p.`id` = e.`paper_id` AND e.`student_id` = #{examineeId}
|
|
|
+ <where>
|
|
|
+ <if test="subjectId != null "> and p.subjectId = #{subjectId}</if>
|
|
|
+ <if test="paperName != null and paperName != ''"> and p.paperName like concat('%', #{paperName}, '%')</if>
|
|
|
+ <if test="year != null "> and p.year = #{year}</if>
|
|
|
+ <if test="paperType != null and paperType != ''"> and p.paperType = #{paperType}</if>
|
|
|
+ <if test="status != null"> and p.status = #{status}</if>
|
|
|
+ <if test="number != null and number != ''"> and p.number = #{number}</if>
|
|
|
+ <if test="fenshu != null "> and p.fenshu = #{fenshu}</if>
|
|
|
+ <if test="paperSource != null "> and p.paperSource = #{paperSource}</if>
|
|
|
+ <if test="directKey == null or directKey == ''"> and (p.direct_key is null or p.direct_key = '')</if>
|
|
|
+ <if test="directKey != null and directKey != ''"> and p.direct_key like concat(#{directKey}, '%')</if>
|
|
|
+ <if test="paperInfo != null and paperInfo != ''"> and p.paper_info = #{paperInfo}</if>
|
|
|
+ <if test="tiid != null and tiid != ''"> and p.tiid = #{tiid}</if>
|
|
|
+ <if test="osspath != null and osspath != ''"> and p.osspath = #{osspath}</if>
|
|
|
+ <if test="relateId != null "> and p.relate_id = #{relateId}</if>
|
|
|
+ <if test="locations != null and locations != ''"> and p.locations = #{locations}</if>
|
|
|
+ <if test="examineeTypes != null and examineeTypes != ''"> and p.examineeTypes = #{examineeTypes}</if>
|
|
|
+ <if test="createTime != null "> and p.createTime = #{createTime}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectLearnPaperList" parameterType="LearnPaper" resultMap="LearnPaperResult">
|
|
|
<include refid="selectLearnPaperVo"/>
|
|
|
<where>
|