<?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.nantian.cloud.jljc.mapper.TReportFinancialMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.jljc.entity.TReportFinancial">
        <id column="id" property="id"/>
        <result column="report_id" property="reportId"/>
        <result column="industrial_yield" property="industrialYield" />
        <result column="sales_revenue" property="salesRevenue" />
        <result column="taxes_payment" property="taxesPayment" />
        <result column="employees_num" property="employeesNum" />
        <result column="icsem_num" property="icsemNum" />
        <result column="energy_consumption" property="energyConsumption" />
        <result column="production_cost" property="productionCost" />
        <result column="energy_consumption_cost" property="energyConsumptionCost" />
        <result column="energy_consumption_cost_ratio" property="energyConsumptionCostRatio" />
        <result column="unit_energy_consumption" property="unitEnergyConsumption" />
        <result column="industrial_yield_rate" property="industrialYieldRate" />
        <result column="sales_revenue_rate" property="salesRevenueRate" />
        <result column="taxes_payment_rate" property="taxesPaymentRate" />
        <result column="employees_num_rate" property="employeesNumRate" />
        <result column="icsem_num_rate" property="icsemNumRate" />
        <result column="energy_consumption_rate" property="energyConsumptionRate" />
        <result column="production_cost_rate" property="productionCostRate" />
        <result column="energy_consumption_cost_rate" property="energyConsumptionCostRate" />
        <result column="energy_consumption_cost_ratio_rate" property="energyConsumptionCostRatioRate" />
        <result column="unit_energy_consumption_rate" property="unitEnergyConsumptionRate" />
        <result column="explain_one" property="explainOne" />
        <result column="explain_two" property="explainTwo" />
        <result column="del_flag" property="delFlag"/>
        <result column="userid" property="userid"/>
        <result column="update_time" property="updateTime"/>
        <result column="dept_id" property="deptId"/>

        <result column="energy_consumption_ref" property="energyConsumptionRef" />
        <result column="unit_energy_consumption_ref" property="unitEnergyConsumptionRef" />
        <result column="energy_consumption_equ" property="energyConsumptionEqu" />
        <result column="unit_energy_consumption_equ" property="unitEnergyConsumptionEqu" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
         id, report_id, industrial_yield, sales_revenue, taxes_payment, employees_num, icsem_num, energy_consumption,
         production_cost, energy_consumption_cost,energy_consumption_cost_ratio, unit_energy_consumption,
         industrial_yield_rate, sales_revenue_rate, taxes_payment_rate, employees_num_rate, icsem_num_rate, energy_consumption_rate,
         production_cost_rate, energy_consumption_cost_rate,energy_consumption_cost_ratio_rate, unit_energy_consumption_rate,
         explain_one, explain_two, dept_id, energy_consumption_ref, unit_energy_consumption_ref, energy_consumption_equ, unit_energy_consumption_equ
    </sql>

    <select id="getFinancialsByReportId" resultType="com.nantian.cloud.jljc.entity.TReportFinancial">
        select <include refid="Base_Column_List"></include>
        from t_report_financial
        where report_id = #{reportId} and del_flag = "1"
    </select>

    <select id="getByCodeAndYear" resultType="com.nantian.cloud.jljc.entity.TReportFinancial">
        select <include refid="Base_Column_List"></include>
        from t_report_financial
        where report_id = #{reportId} and del_flag = "1"
    </select>


</mapper>
