value
2024-04-06 143982ce873b4e868d52cb5315f939386c0fb22c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?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.yuanchu.mom.mapper.WarehouseMapper">
 
    <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.Warehouse">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="name" column="name" jdbcType="VARCHAR"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
            <result property="createUser" column="create_user" jdbcType="INTEGER"/>
            <result property="updateUser" column="update_user" jdbcType="INTEGER"/>
    </resultMap>
 
    <resultMap id="Warehouse" type="com.yuanchu.mom.dto.WarehouseDto">
        <id property="id" column="id" jdbcType="INTEGER"/>
        <result property="name" column="name" jdbcType="VARCHAR"/>
        <collection property="warehouseShelfList" resultMap="shelf"/>
    </resultMap>
 
    <resultMap id="shelf" type="com.yuanchu.mom.pojo.WarehouseShelf">
        <id property="id" column="sId" jdbcType="INTEGER"/>
        <result property="name" column="sName" jdbcType="VARCHAR"/>
        <result property="row" column="row" jdbcType="INTEGER"/>
        <result property="col" column="col" jdbcType="INTEGER"/>
    </resultMap>
 
    <select id="selectWarehouseList" resultMap="Warehouse">
        select w.id,w.name,ws.id sId,ws.name sName,ws.row,ws.col,ws.warehouse_id from warehouse w
        left join warehouse_shelf ws on w.id = ws.warehouse_id
    </select>
</mapper>