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

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.nantian.cloud.jly.entity.CheckGaugesReport" id="checkGaugesReportMap">
        <result property="id" column="id"/>
        <result property="checkPlanId" column="check_plan_id"/>
        <result property="epc" column="epc"/>
        <result property="num" column="num"/>
        <result property="userid" column="userid"/>
        <result property="updateTime" column="update_time"/>
        <result property="delFlag" column="del_flag"/>
        <result property="deptId" column="dept_id"/>
        <result property="item" column="item"/>
        <result property="name" column="name"/>
        <result property="weighingApparatusShouldMatch" column="weighing_apparatus_should_match"/>
        <result property="weighingApparatusRealMatch" column="weighing_apparatus_real_match"/>
        <result property="electricShouldMatch" column="electric_should_match"/>
        <result property="electricRealMatch" column="electric_real_match"/>
        <result property="oilShouldMatch" column="oil_should_match"/>
        <result property="oilRealMatch" column="oil_real_match"/>
        <result property="gasShouldMatch" column="gas_should_match"/>
        <result property="gasRealMatch" column="gas_real_match"/>
        <result property="waterShouldMatch" column="water_should_match"/>
        <result property="waterRealMatch" column="water_real_match"/>
        <result property="temperatureShouldMatch" column="temperature_should_match"/>
        <result property="temperatureRealMatch" column="temperature_real_match"/>
        <result property="pressureShouldMatch" column="pressure_should_match"/>
        <result property="pressureRealMatch" column="pressure_real_match"/>
    </resultMap>


    <select id="getListPage" resultMap="checkGaugesReportMap">
        SELECT
        *
        FROM
        check_gauges_report
        <trim prefix="where" prefixOverrides="and">
            <if test="query.checkPlanId != null">
                and check_plan_id = #{query.checkPlanId}
            </if>
            <if test="query.epc != null">
                and epc = #{query.epc}
            </if>
            <if test="query.name != null">
                and name = #{query.name}
            </if>
            <if test="query.item != null">
                and item = #{query.item}
            </if>
            <if test="query.delFlag != null">
                and del_flag = #{query.delFlag}
            </if>
            <if test="query.deptId != null">
                and dept_id = #{query.deptId}
            </if>
            <if test="query.userid != null">
                and userid = #{query.userid}
            </if>
        </trim>
    </select>

</mapper>
