<?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.shkj.wms.mapper.BaseLogicAreaMapper">

    <resultMap type="BaseLogicArea" id="BaseLogicAreaResult">
        <result property="id"    column="id"    />
        <result property="logicAreaNo"    column="logic_area_no"    />
        <result property="logicAreaName"    column="logic_area_name"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="isActivity"    column="is_activity"    />
        <result property="isDel"    column="is_del"    />
        <result property="remark"    column="remark"    />
    </resultMap>

    <select id="queryBaseLogicAreaList"  resultMap="BaseLogicAreaResult">
        select * from base_logic_area bla
        where bla.is_del ='0'
        <if test="logicAreaNo != null and logicAreaNo != ''">
            AND LOWER(bla.logic_area_no) LIKE LOWER(CONCAT('%',#{logicAreaNo},'%'))
        </if>
        <if test="logicAreaName != null and logicAreaName != ''">
            AND LOWER(bla.logic_area_name) LIKE LOWER(CONCAT('%',#{logicAreaName},'%'))
        </if>
        <if test="isActivity != null">
            AND bla.is_activity = #{isActivity}
        </if>
        <if test="branchId != null">
            AND bla.branch_id = #{branchId}
        </if>
    </select>

</mapper>
