ProjectJudgeMapper.xml 1.91 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.ProjectJudgeMapper">

    <select id="getProjectJudgePage" resultType="com.subsidy.vo.judge.ProjectJudgePageVO">
        select
        *
        from project_judge
        <where>
            <if test="username != null and username != ''">
                and username like concat('%', #{username}, '%')
            </if>
            <if test="status != null and status != ''">
                and status = #{status}
            </if>
            and delete_date is null
        </where>
    </select>

    <select id="projectJudgesAssigned" resultType="com.subsidy.vo.judge.ProjectJudgePageVO">
        select
        pj.*
        from project_judge pj
        left join project_review pr on pr.judge_id = pj.id
        left join project p on p.id = pr.project_id
        <where>
            <if test="projectGroup != null and projectGroup != ''">
                and p.project_group = #{projectGroup}
            </if>
            <if test="projectSchedule != null and projectSchedule != ''">
                and p.project_schedule = #{projectSchedule}
            </if>
            and p.match_id = #{matchId}
            and pj.status = 1
            and p.delete_date is null
            and pj.delete_date is null
            and pr.delete_date is null
        </where>
        group by pj.id
    </select>

    <select id="projectCount" resultType="java.lang.Integer">
        SELECT
            count(0)
        from project_review t1
        LEFT JOIN project t2 on t1.project_id = t2.id
        LEFT JOIN match_dict t3 on t2.match_id = t3.id
        where t1.delete_date is NULL
            and t2.delete_date is NULL
            and t3.delete_date is NULL
            and t3.`status` = 1
            and t1.judge_id = #{judgeId}
    </select>

</mapper>