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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.jly.entity.CheckDev">
        <id column="id" property="id"/>
        <result column="check_plan_id" property="checkPlanId"/>
        <result column="epc" property="epc"/>
        <result column="num" property="num"/>
        <result column="dept" property="dept"/>
        <result column="dev_name" property="devName"/>
        <result column="dev_num" property="devNum"/>
        <result column="dev_type" property="devType"/>
        <result column="location" property="location"/>
        <result column="energy_class" property="energyClass"/>
        <result column="energy_use" property="energyUse"/>
        <result column="comments" property="comments"/>
        <result column="userid" property="userid"/>
        <result column="update_time" property="updateTime"/>
        <result column="del_flag" property="delFlag"/>
        <result column="dept_id" property="deptId"/>
    </resultMap>

    <sql id="Base_Column_List">
        id, check_plan_id, epc, num, dept, dev_name, dev_num, dev_type, location, energy_class,
        energy_use, comments, userid, update_time, del_flag, dept_id
    </sql>

    <select id="getPageScope" resultType="com.nantian.cloud.jly.entity.CheckDev">
        select
        <include refid="Base_Column_List"></include>
        from check_dev
        <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.num != null">
                and num = #{query.num}
            </if>
            <if test="query.dept != null">
                and dept = #{query.dept}
            </if>
            <if test="query.devName != null">
                and dev_name = #{query.devName}
            </if>
            <if test="query.devNum != null">
                and dev_num = #{query.devNum}
            </if>
            <if test="query.devType != null">
                and dev_type = #{query.devType}
            </if>
            <if test="query.location != null">
                and location = #{query.location}
            </if>
            <if test="query.energyClass != null">
                and energy_class = #{query.energyClass}
            </if>
            <if test="query.energyUse != null">
                and energy_use = #{query.energyUse}
            </if>
            <if test="query.comments != null">
                and comments = #{query.comments}
            </if>
            <if test="query.userid != null">
                and userid = #{query.userid}
            </if>
            <if test="query.delFlag != null">
                and del_flag = #{query.delFlag}
            </if>
            <if test="query.deptId != null">
                and dept_id = #{query.deptId}
            </if>
        </trim>
    </select>


</mapper>
