智慧保安后台管理-外网
Administrator
2022-06-16 8b375fe00a241b3a769b82fe3dac8d1c9dce8a02
src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml
@@ -69,9 +69,9 @@
        SELECT
            es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId,
            es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified,es.candidate_no candidateNo,
            ke.exam_name examName,
            ke.exam_name examName,date_format(ke.start_time,'%Y-%m-%d') startTime,date_format(ke.end_time,'%Y-%m-%d %H:%i:%s') endTime,
            str.is_exam isExam,
            bu.real_name securityName,company,bu.account,bu.sex,bu.paper_time paperTime,bu.securitynumber securityNumber,bu.avatar,
            bu.real_name securityName,company,bu.cardid cardNo,bu.sex,bu.paper_time paperTime,bu.securitynumber securityNumber,bu.avatar,
            bd.dept_name companyName,bu.user_type isPaper
        from
            exam_score es
@@ -87,13 +87,15 @@
        blade_dept bd
        on
        bd.id = bu.dept_id
        left join sys_information si on si.departmentid = bd.id
        left join sys_jurisdiction sj on sj.id = si.jurisdiction
        left join
        sys_training_registration str
        on
        str.id = es.apply_id
        where
        1=1
        and (str.is_exam = 2 or str.is_exam = 3 or str.is_exam = 4)
        and (str.is_exam = 2 or str.is_exam = 3 or str.is_exam = 4 or str.is_exam = 5)
        <if test="examScore.examName!=null and  examScore.examName!=''">
            and ke.exam_name like concat('%', #{examScore.examName},'%')
        </if>
@@ -112,6 +114,9 @@
        <if test="examScore.userId!=null and  examScore.userId!=''">
            and es.user_id = #{examScore.userId}
        </if>
        <if test="examScore.jurisdiction!=null and examScore.jurisdiction!='' and examScore.jurisdiction!='1372091709474910209'">
            and (sj.id=#{examScore.jurisdiction} or sj.parent_id = #{examScore.jurisdiction})
        </if>
        <if test="examScore.deptId!=null and  examScore.deptId!=''">
            and bd.id = #{examScore.deptId}
        </if>
@@ -121,8 +126,8 @@
        <if test="examScore.examType!=null and  examScore.examType!=''">
            and ke.exam_type = #{examScore.examType}
        </if>
        <if test="examScore.examType!=null and  examScore.examType!=''">
            and ke.exam_type = #{examScore.examType}
        <if test="examScore.examId!=null">
            and es.exam_id = #{examScore.examId}
        </if>
        <if test="examScore.isPaper==6">
            and bu.user_type = #{examScore.isPaper}
@@ -145,8 +150,11 @@
        <if test="examScore.examDate!=null  and examScore.examDate!=''">
            and date_format(ke.start_time,'%Y-%m-%d') = #{examScore.examDate}
        </if>
        <if test="examScore.sortName!=null and examScore.sortName!=''">
        <if test="examScore.sortName!=null and examScore.sortName!='' and examScore.sortName!='companyName'">
            ORDER BY es.${examScore.sortName} ${examScore.sort},es.id desc
        </if>
        <if test="examScore.sortName=='companyName'">
            ORDER BY bd.dept_name ${examScore.sort},es.id desc
        </if>
        <if test="examScore.sortName==null or examScore.sortName==''">
            order by es.id desc
@@ -290,7 +298,7 @@
        exam.*,
        user.jurisdiction,
        user.real_name securityName,
        ke.exam_name examName,sis.enterpriseName trainingUnitName
        ke.exam_name examName,sis.enterpriseName trainingUnitName,ke.start_time examStartTime
        FROM
        exam_score exam
        left join blade_user user on exam.user_id = user.id
@@ -302,20 +310,23 @@
        WHERE
        1 = 1
        and ke.exam_type = 2
        <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1372091709474910209'">
            and (sj.id = #{information.jurisdiction} or sj.parent_id = #{information.jurisdiction})
        <if test="examScore.jurisdiction!=null and examScore.jurisdiction!='' and examScore.jurisdiction!='1372091709474910209'">
            and (sj.id = #{examScore.jurisdiction} or sj.parent_id = #{examScore.jurisdiction})
        </if>
        <if test="information.securityName!=null and information.securityName!=''">
            AND user.real_name like concat('%',#{information.securityName},'%')
        <if test="examScore.securityName!=null and examScore.securityName!=''">
            AND user.real_name like concat('%',#{examScore.securityName},'%')
        </if>
        <if test="information.trainingUnitName!=null and information.trainingUnitName!=''">
            AND sis.enterpriseName like concat('%',#{information.trainingUnitName},'%')
        <if test="examScore.trainingUnitName!=null and examScore.trainingUnitName!=''">
            AND sis.enterpriseName like concat('%',#{examScore.trainingUnitName},'%')
        </if>
        <if test="information.deptid!=null and information.deptid!=''">
            AND user.dept_id = #{information.deptid}
        <if test="examScore.deptId!=null and examScore.deptId!=''">
            AND user.dept_id = #{examScore.deptId}
        </if>
        <if test="information.qualified!=null">
            AND exam.qualified = #{information.qualified}
        <if test="examScore.month!=null and examScore.month!=''">
            AND date_format(ke.start_time,'%Y-%m') = #{examScore.month}
        </if>
        <if test="examScore.qualified!=null">
            AND exam.qualified = #{examScore.qualified}
        </if>
    </select>
@@ -373,10 +384,12 @@
        sys_training_registration str
        on
        str.id = es.apply_id
        left join sys_information si on si.departmentid = bd.id
        left join sys_jurisdiction sj on sj.id = si.jurisdiction
        where
        1=1
        and (str.is_exam = 2 or str.is_exam = 3 or str.is_exam = 4)
        <if test="examScore.examName!=null and  examScore.examName!=''">
        and (str.is_exam = 2 or str.is_exam = 3 or str.is_exam = 4 or str.is_exam = 5)
        <if test="examScore.examName!=null and  examScore.examName!='' and examScore.examName!='undefined'">
            and ke.exam_name like concat('%', #{examScore.examName},'%')
        </if>
        <if test="examScore.companyName!=null and  examScore.companyName!=''">
@@ -400,6 +413,9 @@
        <if test="examScore.userId!=null and  examScore.userId!=''">
            and es.user_id = #{examScore.userId}
        </if>
        <if test="examScore.examId!=null and examScore.examId!='undefined'">
            and es.exam_id = #{examScore.examId}
        </if>
        <if test="examScore.deptId!=null and  examScore.deptId!=''">
            and bd.id = #{examScore.deptId}
        </if>
@@ -421,10 +437,21 @@
        <if test="examScore.qualified!=null">
            and es.qualified = #{examScore.qualified}
        </if>
        <if test="examScore.examDate!=null and examScore.examDate!=''">
        <if test="examScore.examDate!=null  and examScore.examDate!=''">
            and date_format(ke.start_time,'%Y-%m-%d') = #{examScore.examDate}
        </if>
        order by es.id desc
        <if test="examScore.jurisdiction!=null and examScore.jurisdiction!='' and examScore.jurisdiction!='1372091709474910209'">
            and (sj.id=#{examScore.jurisdiction} or sj.parent_id = #{examScore.jurisdiction})
        </if>
        <if test="examScore.sortName!=null and examScore.sortName!='' and examScore.sortName!='companyName'">
            ORDER BY es.${examScore.sortName} ${examScore.sort},es.id desc
        </if>
        <if test="examScore.sortName=='companyName'">
            ORDER BY bd.dept_name ${examScore.sort},es.id desc
        </if>
        <if test="examScore.sortName==null or examScore.sortName==''">
            order by es.id desc
        </if>
    </select>
    <!--导出-按条件查询成绩数据-模拟考试-->
@@ -460,6 +487,7 @@
            WHERE
                qualified = 0
                and training_unit_id = #{information.departmentid}
                and YEAR ( ke.start_time ) = YEAR ( now() )
                <if test="information.deptid!=null and information.deptid!=''">
                    and bu.dept_id = #{information.deptid}
                </if>
@@ -485,6 +513,7 @@
            WHERE
                qualified = 1
                and training_unit_id = #{information.departmentid}
                and YEAR ( ke.start_time ) = YEAR ( now() )
                <if test="information.deptid!=null and information.deptid!=''">
                    and bu.dept_id = #{information.deptid}
                </if>
@@ -498,5 +527,15 @@
            id
    </select>
    <!--查询考试成绩-->
    <select id="getExamScoreLists" resultType="org.springblade.modules.exam.entity.ExamScore">
        SELECT * from exam_score where date_format(exam_time,'%Y-%M-%d') = date_format(now(),'%Y-%M-%d')
    </select>
    <!--查询考试成绩按时间-->
    <select id="getExamScoreListByTime" resultType="org.springblade.modules.exam.entity.ExamScore">
        SELECT * from exam_score where date_format(exam_time,'%Y-%M-%d') = date_format(#{time},'%Y-%M-%d')
    </select>
</mapper>