Selaa lähdekoodia

考试新老 分开

yuanjunhao 3 viikkoa sitten
vanhempi
commit
88bcb0695c

+ 1 - 1
web/src/main/java/com/ynfy/buss/exam/exam/controller/ExamController.java

@@ -294,7 +294,7 @@ public class ExamController extends JeecgController<Exam, IExamService> {
         Result<IPage<Exam>> result = new Result<>();
         Page<Exam> page = new Page<>(pageNo, pageSize);
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        IPage<Exam> pageList = examService.selectExamList(page, exam, user);
+        IPage<Exam> pageList = examService.selectExamList2(page, exam, user);
         result.setSuccess(true);
         result.setResult(pageList);
         return result;

+ 73 - 1
web/src/main/java/com/ynfy/buss/exam/exam/mapper/xml/ExamMapper.xml

@@ -144,6 +144,7 @@
             <if test="exam.state!=null">
                 AND tmp1.state = #{exam.state}
             </if>
+                AND tmp1.paper_id is not null
         </where>
             order by tmp1.state,tmp2.try_count desc
     </select>
@@ -213,10 +214,81 @@
             <if test="exam.state!=null">
                 AND tmp1.state = #{exam.state}
             </if>
-            AND (tmp1.state='0' or tmp1.state='2')
+            AND tmp1.paper_id is not null
         </where>
         order by tmp1.state
     </select>
+<!--        <select id="selectExamList2" resultType="com.ynfy.buss.exam.exam.entity.Exam">-->
+<!--        SELECT-->
+<!--        tmp1.*-->
+<!--        <choose>-->
+<!--            <when test="user!=null and user.id!=null and user.id!=''">-->
+<!--                ,-->
+<!--                tmp2.try_count,-->
+<!--                u.passed-->
+<!--            </when>-->
+<!--        </choose>-->
+<!--        FROM-->
+<!--        (-->
+<!--        SELECT-->
+<!--            *,-->
+<!--            <include refid="stateCondition"/>-->
+<!--        FROM exam-->
+<!--        WHERE-->
+<!--            open_type = 1-->
+<!--            <if test="user!=null and user.orgCode!=null and user.orgCode!=''">-->
+<!--                UNION-->
+<!--                SELECT-->
+<!--                *,-->
+<!--                <include refid="stateCondition"/>-->
+<!--                FROM exam-->
+<!--                WHERE-->
+<!--                open_type = 2-->
+<!--                AND examiner like concat('%', #{user.orgCode}, '%')-->
+<!--            </if>-->
+<!--            <if test="user!=null and user.username!=null and user.username!=''">-->
+<!--                UNION-->
+<!--                SELECT-->
+<!--                *,-->
+<!--                <include refid="stateCondition"/>-->
+<!--                FROM exam-->
+<!--                WHERE-->
+<!--                open_type = 3-->
+<!--                AND examiner like concat('%', #{user.username}, '%')-->
+<!--            </if>-->
+<!--        ) tmp1-->
+<!--        <choose>-->
+<!--            <when test="user!=null and user.id!=null and user.id!=''">-->
+<!--        LEFT JOIN (-->
+<!--            SELECT-->
+<!--                exam_id,-->
+<!--                COUNT(*) AS try_count-->
+<!--            FROM-->
+<!--                user_exam uer-->
+<!--            WHERE-->
+<!--                uer.user_id = #{user.id}-->
+<!--            GROUP BY-->
+<!--                exam_id-->
+<!--            ) tmp2-->
+<!--            ON tmp1.ID = tmp2.exam_id-->
+<!--            LEFT JOIN user_exam_result u on u.exam_id = tmp2.exam_id and u.user_id = #{user.id}-->
+<!--            </when>-->
+<!--        </choose>-->
+<!--        <where>-->
+<!--            <if test="exam.title!=null and exam.title!=''">-->
+<!--                AND tmp1.title like concat('%', #{exam.title}, '%')-->
+<!--            </if>-->
+<!--            <if test="exam.openType!=null">-->
+<!--                AND tmp1.open_type = #{exam.openType}-->
+<!--            </if>-->
+<!--            <if test="exam.state!=null">-->
+<!--                AND tmp1.state = #{exam.state}-->
+<!--            </if>-->
+<!--            AND (tmp1.state='0' or tmp1.state='2')-->
+<!--            AND tmp1.paper_id is not null-->
+<!--        </where>-->
+<!--        order by tmp1.state-->
+<!--    </select>-->
 
     <select id="listExamIng" resultType="String">
         SELECT id