<?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.unis.projectManagement.modular.pmBudget.mapper.FundPlanMapper">
    <select id="getPageList" parameterType="com.baomidou.mybatisplus.core.conditions.Wrapper" resultType="com.unis.projectManagement.modular.pmBudget.entity.FundPlan">
        SELECT
            bpb.id,
            bpb.pm_application_id pmApplicationId,
            bpb.pm_project_info_id pmProjectInfoId,
            bpa.project_name projectName,
            bpa.project_code projectCode,
            bpb.leading_department leadingDepartment,
            bpb.applicant applicant,
            bpb.reviewer reviewer,
            bpb.construction_period constructionPeriod,
            bpb.funds_scale fundsScale,
            bpb.funds_source fundsSource,
            bpb.declaration_time declarationTime
        FROM
            biz_pm_budget bpb
        LEFT JOIN biz_pm_application bpa ON bpb.pm_application_id = bpa.id
        ${ew.customSqlSegment}
    </select>
    <select id="detailList" parameterType="string" resultType="com.unis.projectManagement.modular.pmBudget.entity.FundPlanInfo">
        SELECT
            schedule_name scheduleName,
            schedule_content scheduleContent,
            schedule_start_date scheduleStartDate,
            schedule_end_date scheduleEndDate,
            plan_completion_progress actualCompletionProgress,
            actual_completion_progress planCompletionProgress,
            funds_planned_expenditure fundsPlannedExpenditure,
            funds_actual_expenditure fundsActualExpenditure,
            funds_usage_situation fundsUsageSituation
        FROM
            biz_pm_project_info_plan
        WHERE
            pm_application_id = #{pmApplicationId}
    </select>

</mapper>