Blame view

ProjectJudgeDAO.xml 2.42 KB
涂亚平 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
<?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.zhongzhi.dao.ProjectJudgeDAO">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectJudgeDO">
        <id column="id" property="id"/>
        <result column="username" property="username"/>
        <result column="telephone" property="telephone"/>
        <result column="position" property="position"/>
        <result column="unit" property="unit"/>
        <result column="id_card" property="idCard"/>
        <result column="bank_name" property="bankName"/>
        <result column="bank_card" property="bankCard"/>
        <result column="status" property="status"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="delete_time" property="deleteTime"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, username, telephone, position, unit, status, create_time, update_time, delete_time
    </sql>

    <select id="getProjectJudgePage" resultType="com.zhongzhi.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_time is null
        </where>
    </select>

    <select id="projectJudgesAssigned" resultType="com.zhongzhi.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_time is null
            and pj.delete_time is null
            and pr.delete_time is null
        </where>
        group by pj.id
    </select>

</mapper>