<?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.jly.mapper.InspectionDataMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.jly.entity.InspectionData">
        <id column="id" property="id"/>
        <result column="check_plan_id" property="checkPlanId"/>
        <result column="enterprise_code" property="enterpriseCode"/>
        <result column="basic_information" property="basicInformation"/>
        <result column="basic_information_state" property="basicInformationState"/>
        <result column="energy_metering_report" property="energyMeteringReport"/>
        <result column="energy_metering_report_state" property="energyMeteringReportState"/>
        <result column="measurement_management_system" property="measurementManagementSystem"/>
        <result column="measurement_management_system_state" property="measurementManagementSystemState"/>
        <result column="energy_statistics_statement" property="energyStatisticsStatement"/>
        <result column="energy_statistics_statement_state" property="energyStatisticsStatementState"/>
        <result column="energy_metering_personnel" property="energyMeteringPersonnel"/>
        <result column="energy_metering_personnel_state" property="energyMeteringPersonnelState"/>
        <result column="energyusing_equipment" property="energyusingEquipment"/>
        <result column="energyusing_equipment_state" property="energyusingEquipmentState"/>
        <result column="energy_measuring_instruments" property="energyMeasuringInstruments"/>
        <result column="energy_measuring_instruments_state" property="energyMeasuringInstrumentsState"/>
        <result column="measuring_instruments" property="measuringInstruments"/>
        <result column="measuring_instruments_state" property="measuringInstrumentsState"/>
        <result column="secondary_measuring_instrument" property="secondaryMeasuringInstrument"/>
        <result column="secondary_measuring_instrument_state" property="secondaryMeasuringInstrumentState"/>
        <result column="main_measuring_instrument" property="mainMeasuringInstrument"/>
        <result column="main_measuring_instrument_state" property="mainMeasuringInstrumentState"/>
        <result column="other_measuring_instruments" property="otherMeasuringInstruments"/>
        <result column="other_measuring_instruments_state" property="otherMeasuringInstrumentsState"/>
        <result column="equipped_situation" property="equippedSituation"/>
        <result column="equipped_situation_state" property="equippedSituationState"/>
        <result column="accuracy_grade" property="accuracyGrade"/>
        <result column="accuracy_grade_state" property="accuracyGradeState"/>
        <result column="inventory_status" property="inventoryStatus"/>
        <result column="inventory_status_state" property="inventoryStatusState"/>
        <result column="energy_flow" property="energyFlow"/>
        <result column="energy_flow_state" property="energyFlowState"/>
        <result column="collection_point_network" property="collectionPointNetwork"/>
        <result column="collection_point_network_state" property="collectionPointNetworkState"/>
        <result column="values_transfer" property="valuesTransfer"/>
        <result column="values_transfer_state" property="valuesTransferState"/>
        <result column="roots_diagram" property="rootsDiagram"/>
        <result column="roots_diagram_state" property="rootsDiagramState"/>
        <result column="userid" property="userid" />
        <result column="update_time" property="updateTime" />
        <result column="del_flag" property="delFlag" />
        <result column="dept_id" property="deptId" />
    </resultMap>

    <select id="getByPlanIdAndEpc" resultType="com.nantian.cloud.jly.entity.InspectionData">
        select * from inspection_data
        where check_plan_id = #{checkPlanId} and enterprise_code = #{enterpriseCode} and del_flag = "1"
    </select>

</mapper>
