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

    <sql id="base_column">
        id,broad_head,broad_head_code,in_class,in_class_code,subclass,subclass_code,
        key_field1,key_field2,name_of_index,index_of_unit,benchmarking_level,datum_plane,
        reference_standard,del_flag,dept_id,user_id,update_time
    </sql>

    <select id="searchList" resultType="com.nantian.cloud.jljc.entity.DischargeEnergyKeyFields">
        select <include refid="base_column"></include>
        from discharge_energy_key_fields
        where del_flag = 1
        <if test="query.broadHead != null and query.broadHead != ''">
            and broad_head like concat("%",#{query.broadHead},"%")
        </if>
        <if test="query.broadHeadCode != null and query.broadHeadCode != ''">
            and broad_head_code = #{query.broadHeadCode}
        </if>
        <if test="query.subclass != null and query.subclass != ''">
            and subclass like concat("%",#{query.subclass},"%")
        </if>
        <if test="query.subclassCode != null and query.subclassCode != ''">
            and subclass_code = #{query.subclassCode}
        </if>
        <if test="query.keyField1 != null and query.keyField1 != ''">
            and key_field1 like concat("%",#{query.keyField1},"%")
        </if>
        <if test="query.keyField2 != null and query.keyField2 != ''">
            and key_field2 like concat("%",#{query.keyField2},"%")
        </if>
    </select>
    <select id="getPage" resultType="com.nantian.cloud.jljc.entity.DischargeEnergyKeyFields">
        select <include refid="base_column"></include>
        from discharge_energy_key_fields
        where del_flag = 1
        <if test="query.broadHead != null and query.broadHead != ''">
            and broad_head like concat("%",#{query.broadHead},"%")
        </if>
        <if test="query.broadHeadCode != null and query.broadHeadCode != ''">
            and broad_head_code = #{query.broadHeadCode}
        </if>
        <if test="query.subclass != null and query.subclass != ''">
            and subclass like concat("%",#{query.subclass},"%")
        </if>
        <if test="query.subclassCode != null and query.subclassCode != ''">
            and subclass_code = #{query.subclassCode}
        </if>
        <if test="query.keyField1 != null and query.keyField1 != ''">
            and key_field1 like concat("%",#{query.keyField1},"%")
        </if>
        <if test="query.keyField2 != null and query.keyField2 != ''">
            and key_field2 like concat("%",#{query.keyField2},"%")
        </if>
    </select>

</mapper>
