guoshilong
2023-05-18 6cd2da8eb7d7aefecd96a19ebbfe9caba59ea88c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?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="cn.gistack.sm.exam.mapper.ExamScoreMapper">
 
    <!--分页列表查询-->
    <select id="selectExamScorePage" resultType="cn.gistack.sm.exam.vo.ExamScoreVO">
        select
            sm_exam_plan_score.*
        from sm_exam_plan_score
        where 1=1
        order by sm_exam_plan_score.id desc
    </select>
    <!--根据巡检次数和方案id得到具体的分数-->
    <select id="getExamScoreByPlanIdAndCount" resultType="java.lang.Integer">
        select
            IFNULL(MAX(eps.score),0) AS score
        from sm_exam_plan_score eps
        WHERE eps.range_start &lt;= #{count} AND eps.range_end &gt;= #{count} AND eps.plan_id = #{planId}
        LIMIT 0,1
    </select>
</mapper>