| | |
| | | <result property="updateTime" column="update_time"></result> |
| | | </resultMap> |
| | | |
| | | <resultMap id="SysWarehouseDto" type="com.nanometer.smartlab.entity.dto.SysWarehouseDto"> |
| | | <id property="id" column="id"/> |
| | | <result property="type" column="type"/> |
| | | <result property="name" column="name"/> |
| | | <result property="infoCode" column="info_code"/> |
| | | <result property="barCode" column="bar_code"/> |
| | | <result property="location1" column="location1"/> |
| | | <result property="location2" column="location2"/> |
| | | <collection property="sysWarehouseContainerDto" ofType="com.nanometer.smartlab.entity.dto.SysWarehouseContainerDto" fetchType="lazy"> |
| | | <id property="id" column="wc_id"/> |
| | | <result property="type" column="wc_type"/> |
| | | <result property="name" column="wc_name"/> |
| | | <result property="containerCode" column="container_code"/> |
| | | <result property="infoCode" column="info_code"/> |
| | | <result property="structure" column="structure"/> |
| | | <result property="warehouseContainerName" column="wc_name"/> |
| | | <result property="warehouseContainerType" column="wc_type"/> |
| | | <result property="controllerCode" column="controller_code"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <sql id="queryWhereSql"> |
| | | <if test="type != null and type != ''"> |
| | | and su.type = #{type} |
| | |
| | | select * from sys_warehouse |
| | | where bar_code = #{barCode} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectWarehouse" resultMap="SysWarehouseDto"> |
| | | SELECT |
| | | sw.id, |
| | | bm1.meta_value type, |
| | | sw.`name` name , |
| | | sw.info_code, |
| | | sw.bar_code, |
| | | sw.location1, |
| | | sw.location2, |
| | | swc.id wc_id, |
| | | bm2.meta_value wc_type, |
| | | swc.`name` wc_name, |
| | | swc.info_code , |
| | | swc.controller_code, |
| | | bm3.meta_value structure, |
| | | swc.container_code |
| | | FROM |
| | | `sys_warehouse` sw |
| | | LEFT JOIN base_meta bm1 ON bm1.id = sw.type |
| | | LEFT JOIN sys_warehouse_container swc ON swc.warehouse_id = sw.id |
| | | LEFT JOIN base_meta bm2 ON bm2.id = swc.type |
| | | LEFT JOIN base_meta bm3 ON bm3.id = swc.structure |
| | | where sw.valid_flag = 1 |
| | | AND swc.valid_flag = 1 |
| | | </select> |
| | | </mapper> |