<?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.css.simulation.resource.server.infra.db.mysql.mapper.SimulationMptFirstTargetScoreMapper" >

    <!--查询第一级指标得分-->
    <select id="selectFirstTargetScore" parameterType="api.common.pojo.po.project.SimulationMptFirstTargetScorePO" resultType="api.common.pojo.po.project.SimulationMptFirstTargetScorePO">
        select score
        from simulation_mpt_first_target_score
        where p_id = #{pId,jdbcType=VARCHAR} and target = #{target,jdbcType=VARCHAR} and is_deleted = '0'
    </select>

    <!--查询项目下所有一级指标-->
    <select id="selectFirstTargetByPid" parameterType="api.common.pojo.po.project.SimulationMptFirstTargetScorePO" resultType="api.common.pojo.po.project.SimulationMptFirstTargetScorePO">
        select smfts.id,
               smfts.p_id,
               smfts.target,
               smfts.score,
               smfts.weight,
               smfts.create_time,
               smfts.create_user_id,
               smfts.modify_time,
               smfts.modify_user_id,
               smfts.is_deleted,
               sps.sublist_name,
               sps.scene_num,
               sps.sublist_id
        from simulation_mpt_first_target_score smfts
                 left join scene_package_sublist sps on smfts.target = sps.sublist_id
        where smfts.p_id = #{pId,jdbcType=VARCHAR}
          and smfts.is_deleted = '0'
        order by sps.seq
    </select>

</mapper>
