<?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.EpcEnergyAccuracyAnalysisMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.jljc.entity.EpcEnergyAccuracyAnalysis">
        <id column="id" property="id" />
        <result column="epc" property="epc" />
        <result column="year" property="year" />
        <result column="epc_type" property="epcType" />
        <result column="area" property="area" />
        <result column="area2" property="area2" />
        <result column="trade_num" property="tradeNum" />
        <result column="trade_num2" property="tradeNum2" />
        <result column="epc_name" property="epcName" />
        <result column="check_result" property="checkResult" />
        <result column="energy_region" property="energyRegion" />
        <result column="total_energy" property="totalEnergy" />
        <result column="report1_id" property="report1Id" />
        <result column="userid" property="userid"/>
        <result column="update_time" property="updateTime"/>
        <result column="del_flag" property="delFlag"/>
        <result column="dept_id" property="deptId"/>
        <result column="difference" property="difference"/>
    </resultMap>

    <sql id="Base_Column_List">
        id, epc, year, epc_type, area, area2, trade_num2, epc_name, check_result, energy_region, total_energy, report1_id
        , userid, update_time, del_flag, dept_id, difference
    </sql>

    <select id="getPageScope" resultType="com.nantian.cloud.jljc.entity.EpcEnergyAccuracyAnalysis">
        select <include refid="Base_Column_List"></include>
        from epc_energy_accuracy_analysis
        where del_flag = "1"
        <if test="query.epcName!=null and query.epcName!=''">
            and epc_name like concat("%",#{query.epcName},"%")
        </if>
        <if test="query.year!=null and query.year!=''">
            and year = #{query.year}
        </if>
        <if test="query.checkResult!=null and query.checkResult!=''">
            and check_result = #{query.checkResult}
        </if>
    </select>


</mapper>
