<?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.bonus.sgzb.base.mapper.MaHouseShelMapper">

    <resultMap id="BaseResultMap" type="com.bonus.sgzb.base.domain.MaHouseShel">
        <id column="shelve_id" property="shelveId" jdbcType="BIGINT"/>
        <result column="shelve_name" property="shelveName" jdbcType="VARCHAR"/>
        <result column="parent_id" property="parentId" jdbcType="BIGINT"/>
        <result column="contact" property="contact" jdbcType="VARCHAR"/>
        <result column="sort" property="sort" jdbcType="INTEGER"/>
        <result column="contact_phone" property="contactPhone" jdbcType="VARCHAR"/>
        <result column="remark" property="remark" jdbcType="VARCHAR"/>
        <result column="status" property="status" jdbcType="VARCHAR"/>
        <result column="del_flag" property="delFlag" jdbcType="VARCHAR"/>
        <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
        <result column="company_id" property="companyId" jdbcType="VARCHAR"/>
    </resultMap>


    <sql id="Base_Column_List">
        shelve_id, shelve_name, parent_id, contact, sort, contact_phone, remark, status, del_flag, create_by, create_time, update_by, update_time, company_id
    </sql>

    <select id="selectHouseShelList" resultMap="BaseResultMap">
        <include refid="Base_Column_List"/>
        from ma_house_shell
        <where>
            <if test="shelveName != null and shelveName != ''">
                and shelve_name like concat('%', #{shelveName}, '%')
            </if>
        </where>
    </select>
</mapper>
