<?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="org.jeecg.modules.stm.project.chart.mapper.StProjectChartMapper">

    <select id="staticByckIds" resultType="org.jeecg.modules.stm.project.chart.vo.QueryDomainLevelVo" parameterType="java.util.List">
        select
        count(spe.id) as count,
        spe.damage_level as damageLevel
        from
        ST_PROJECT_EXEC spe
        where
            spe.project_check_id in
        <foreach collection="ids" item="id" open="(" close=")" separator=",">
            #{id}
        </foreach>
        group by
        spe.damage_level
    </select>
    <select id="sumScoreByIds" resultType="java.lang.Long">
        select
        sum(spe.damage_score)
        from
        ST_PROJECT_EXEC spe
        where
        spe.project_check_id in
        <foreach collection="ids" item="id" open="(" close=")" separator=",">
            #{id}
        </foreach>
    </select>
    <select id="staticSeverityByckIds" resultType="org.jeecg.modules.stm.project.chart.vo.QueryDomainLevelVo">
        select
        count(spe.id) as count,
        spe.SEVERITY as damageLevel
        from
        ST_PROJECT_EXEC spe
        where
        spe.project_check_id in
        <foreach collection="ids" item="id" open="(" close=")" separator=",">
            #{id}
        </foreach>
        group by
        spe.SEVERITY
    </select>
</mapper>