<?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.yida.data.school.health.mapper.EduHealthStudentPhysicalExaminationGroupMapper">

    <select id="findStudentId" resultType="java.lang.Long">
    SELECT
    distinct
	    student_id
    FROM
	    edu_health_student_physical_examination_grade_results
    WHERE
	    group_id = #{groupId}
	    and del_flag = 0
    </select>
    <select id="findHealthGroup"
            resultType="com.yida.data.common.core.entity.health.EduHealthStudentPhysicalExaminationGroup">
    SELECT
	    *
    FROM
	    `edu_health_student_physical_examination_group`
    WHERE
	    school_id = #{schoolId}
	    AND del_flag = 0
	    <if test="status != null">
            AND `status` = 0
        </if>
	    <if test="groupName !=null and groupName !=''">
            AND group_name LIKE CONCAT('%',#{groupName},'%')
        </if>

    </select>
</mapper>
