<?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.hxhq.business.mapper.StorageLocationMapper">
    <select id="queryList" resultType="com.hxhq.business.domain.StorageLocation">
        SELECT s.*, s.compartment as wc, d.dept_name as deptName
        FROM `t_storage_location` s
        LEFT JOIN  `sys_dept` d on s.dept_id = d.dept_id
        <if test="ew.sqlSegment != '' and ew.sqlSegment != null">
            <where>
                ${ew.sqlSegment}
            </where>
        </if>
    </select>
    <select id="queryInfo" resultType="com.hxhq.business.domain.StorageLocation">
        SELECT s.*, s.compartment as wc, d.dept_name as deptName
        FROM `t_storage_location` s
        LEFT JOIN  `sys_dept` d on s.dept_id = d.dept_id WHERE s.id = #{id} AND s.del_flag = 0
    </select>
</mapper>