<?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.zhongzheng.modules.exam.mapper.ExamSiteMapper">

    <resultMap type="com.zhongzheng.modules.exam.domain.ExamSite" id="ExamSiteResult">
        <result property="siteId" column="site_id"/>
        <result property="code" column="code"/>
        <result property="siteAddress" column="site_address"/>
        <result property="people" column="people"/>
        <result property="status" column="status"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>



    <select id="selectCountSite" parameterType="long" resultType="integer">
        SELECT
            COUNT( 1 )
        FROM
            exam_apply ea
                LEFT JOIN exam_apply_site eas ON ea.apply_id = eas.apply_id
        WHERE
            eas.site_id = #{siteId}
          AND ea.`status` != -1
    </select>
</mapper>
