<?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">
<!--mybatis-3-mapper.dtd:约束文件的名称，限制和检查在当前文件中出现的标签和属性符合mybatis的要求-->
<!--namespace：命名空间，要有唯一的值，要求使用dao接口的权限定名称（一个dao接口对应一个mapper，namespace指明对应哪个dao接口）-->
<mapper namespace="com.cool.store.mapper.WarehouseInfoMapper">
        <resultMap id="BaseResultMap" type="com.cool.store.entity.WarehouseInfoDO">
            <id column="id" jdbcType="BIGINT" property="id" />
            <result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode" />
            <result column="warehouse_name" jdbcType="VARCHAR" property="warehouseName" />
            <result column="warehouse_remark" jdbcType="VARCHAR" property="warehouseRemark" />
            <result column="warehouse_branches" jdbcType="VARCHAR" property="warehouseBranches" />
            <result column="deleted" jdbcType="BIT" property="deleted" />
        </resultMap>
    <select id="getAllAndActive" resultType="com.cool.store.entity.WarehouseInfoDO">
        select * from xfsg_warehouse_info where deleted = 0
        <if test="keyword != null and keyword != ''">
            and ( warehouse_name like concat('%',#{keyword},'%'))
        </if>
    </select>
    <select id="getByCode" resultType="com.cool.store.entity.WarehouseInfoDO">
        select * from xfsg_warehouse_info where warehouse_code = #{code}
    </select>
    <select id="getAll" resultType="com.cool.store.entity.WarehouseInfoDO">
        select * from xfsg_warehouse_info
    </select>
</mapper>