DrawLotsScoresMapper.xml 3.71 KB
<?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.subsidy.mapper.DrawLotsScoresMapper">

    <select id="groupScores" resultType="com.subsidy.vo.group.GroupScoresVO">
        SELECT
        t2.id,
        t2.course_name project_name,
        t4.name college,
        t3.id as groupId,
        t.group_num,
        t3.group_name,
        t2.project_track
        FROM
        draw_lots_group_items t
        LEFT JOIN project t2 ON t.project_id = t2.id
        left join draw_lot_group_dict t3 on t.group_id = t3.id
        left join colleges_dict t4 on t2.college_id = t4.id
        WHERE
        t.delete_date IS NULL
        <if test="projectName != null and projectName != ''">
            AND t2.course_name  like concat('%', #{projectName}, '%')
        </if>
        and t3.scene_id = #{sceneId}
        <if test="groupId != null and groupId != ''">
            and t.group_id = #{groupId}
        </if>
        order by t3.id,t.order_no
    </select>

    <select id="groupJudgeScores" resultType="com.subsidy.vo.group.GroupJudgeScoresVO">
        SELECT
            t2.id,
            t2.username,
            t3.expector_type,
            t3.role_type,
            t.score
        FROM
        	draw_lots_scores t
            LEFT JOIN project_judge t2 ON t.judge_id = t2.id
            LEFT JOIN draw_lots_group_judges t3 ON t.scene_id = t3.scene_id
            AND t.judge_id = t3.judge_id and t.group_id = t3.group_id
        WHERE
            t.delete_date IS NULL
            and  t2.delete_date is null
            and t3.delete_date is null
            and t.submit_status  in ('已提交','弃权')
            and t.group_id = #{groupId}
            and t.project_id = #{projectId}
    </select>

    <select id="queryItems" resultType="com.subsidy.vo.group.QueryItemsVO">
        SELECT
            t4.id,
            t2.group_name,
            t3.group_num,
            t4.course_name project_name,
            t5.submit_status,
            t5.score,
            t6.name college,
            t7.user_name,
            t4.vod_url,
            t4.support_file,
            t4.project_track,
            t4.attachment
        FROM
            draw_lots_group_judges t
            LEFT JOIN draw_lot_group_dict t2 ON t.group_id = t2.id
            LEFT JOIN draw_lots_group_items t3 ON t.group_id = t3.group_id
            LEFT JOIN project t4 ON t3.project_id = t4.id
            LEFT JOIN draw_lots_scores t5 ON t.judge_id = t5.judge_id
            AND t.group_id = t5.group_id and t3.project_id = t5.project_id
            left join colleges_dict t6 on t4.college_id = t6.id
            left join teacher t7 on t4.teacher_id = t7.id
        WHERE
            t.delete_date IS NULL
            and t2.delete_date is null
            and t3.delete_date is null
            and t4.delete_date is null
            and t.group_id = #{groupId}
            and t.judge_id = #{judgeId}
        order by t3.order_no
    </select>

    <select id="groupRank" resultType="com.subsidy.vo.group.GroupRankVO">
        SELECT
            t.id,
            t2.course_name project_name,
            t4.name college,
            t3.group_name,
            t.group_num,
            t.total_score,
            t5.user_name
        FROM
            draw_lots_group_items t
            LEFT JOIN project t2 ON t.project_id = t2.id
            LEFT JOIN draw_lot_group_dict t3 ON t.group_id = t3.id
            left join colleges_dict t4 on t2.college_id = t4.id
            left join teacher t5 on t2.teacher_id = t5.id
        WHERE
            t.delete_date IS NULL
            AND t.group_id = #{groupId}
        ORDER BY
            t.total_score desc
        </select>

</mapper>