<?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="jnpf.cultivate.mapper.CultivateIdentifyApplyDetailsMapper">

    <!--查询鉴定项得分集合-->
    <select id="getIdentifyItemList" resultType="jnpf.model.cultivate.vo.identify.IdentifyApplyDetailsInfoVo">
        select
        fciad.F_Id `id`,
        fcii.F_Name `name`,
        fcii.F_TotalScore totalScore,
        fcii.F_Type type,
        fcii.F_MinScore minScore,
        fcii.F_MaxScore maxScore,
        fcii.F_SortCode sortCode,
        fciad.F_Score score,
        fciad.F_Remark remark
        from ftb_cultivate_identify_apply_details fciad
        left join ftb_cultivate_identify_apply_details_backups fcii on fcii.F_Id = fciad.F_ItemsId
        <where>
            fciad.F_DeleteMark = 0
            <if test="id != null and id != ''">
                AND fciad.F_ApplyId = #{id}
            </if>
        </where>
        order by fcii.F_SortCode asc
    </select>
    <!--查询总分数-->
    <select id="countSumScore" resultType="java.math.BigDecimal">
        select sum(F_Score) from ftb_cultivate_identify_apply_details where F_ApplyId=#{identificationId}
    </select>
</mapper>