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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.jljc.entity.EliminateDevInfo">
        <id column="id" property="id"/>
        <result column="num" property="num"/>
        <result column="dev_class" property="devClass"/>
        <result column="dev_class_code" property="devClassCode"/>
        <result column="dev_type" property="devType"/>
        <result column="dev_name" property="devName"/>
        <result column="types" property="types"/>
        <result column="energy_class" property="energyClass"/>
        <result column="ref_file" property="refFile"/>
        <result column="eliminate_limit" property="eliminateLimit"/>
        <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, num, dev_class, dev_class_code, dev_type, dev_name, types, energy_class, ref_file, eliminate_limit, userid, update_time, del_flag, dept_id
    </sql>

    <select id="getPageScope" resultType="com.nantian.cloud.jljc.entity.EliminateDevInfo">
        select
        <include refid="Base_Column_List"></include>
        from eliminate_dev_info
        <trim prefix="where" prefixOverrides="and">
            <if test="query.devClass != null  and query.devClass != ''">
                and dev_class like concat("%",#{query.devClass},"%")
            </if>
            <if test="query.devType != null  and query.devType != ''">
                and dev_type like concat("%",#{query.devType},"%")
            </if>
            <if test="query.devName != null  and query.devName != ''">
                and dev_name like concat("%",#{query.devName},"%")
            </if>
            <if test="query.types != null  and query.types != ''">
                and types like concat("%",#{query.types},"%")
            </if>
            <if test="query.delFlag != null  and query.delFlag != ''">
                and del_flag = #{query.delFlag}
            </if>
        </trim>
    </select>

</mapper>
