<?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.EduNationalStandardProjectScoreMapper">

    <select id="findScoreBySexAndGradeIdAndProjectIdAndResult"
            resultType="com.yida.data.common.core.entity.health.EduNationalStandardProjectScore">
    SELECT
    *
    FROM
    edu_health_national_standard_project_score
    WHERE
    apply_sex =#{applySex,jdbcType=VARCHAR}
    AND project_id = #{projectId,jdbcType=INTEGER}
    AND record_grade_id = #{recordGradeId,jdbcType=INTEGER}
    AND data_min &lt;=#{result,jdbcType=DECIMAL} AND data_max &gt;=#{result,jdbcType=DECIMAL} ORDER BY score DESC limit 0,1
    </select>
</mapper>
