<?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.unis.examine.modular.assessmentManage.mapper.AssessmentManageMapper">

    <select id="selectMyMapsPage" resultType="java.util.Map">
        SELECT DISTINCT
            nam.id,
            nam.assessment_year assessmentYear,
            nam.assessment_name assessmentName,
            nam.start_time startTime,
            nam.end_time endTime,
            bas.status sCstatus
        FROM
            biz_ne_assessment_manage nam
        left join biz_ne_assessment_score bas on nam.id = bas.assessment_manage_id
        LEFT  JOIN biz_ne_assessment_target nat ON nam.id = nat.assessment_manage_id
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where ${ew.sqlSegment}
        </if>
    </select>


    <select id="selectMyPage" resultType="java.util.Map">
        SELECT DISTINCT
            nam.id,
            nam.assessment_year assessmentYear,
            nam.assessment_name assessmentName,
            nam.start_time startTime,
            nam.end_time endTime,
            bas.status sCstatus,
            bas.pc_type pcType
        FROM
            biz_ne_assessment_manage nam
                LEFT  JOIN biz_ne_assessment_target nat ON nam.id = nat.assessment_manage_id
                left join biz_ne_assessment_score bas on nam.id = bas.assessment_manage_id
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where ${ew.sqlSegment}
        </if>
    </select>
    <select id="getAssessmentName" parameterType="string" resultType="map">
        SELECT
            id,
            assessment_name assessmentName
        FROM
            biz_ne_assessment_manage
        WHERE
            end_time &gt;= #{now}
    </select>
    <select id="getOnlyOrgInfo" parameterType="string" resultType="map">
        SELECT
            ID id,
            `NAME` orgName
        FROM
            sys_org
        WHERE
            PARENT_ID = #{parentId}
    </select>
</mapper>