java-mall/mall-shop/target/classes/mapper/invoicing/InvoicingWarehouseItemMapper.xml
2024-10-26 20:16:13 +08:00

43 lines
1.5 KiB
XML

<?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.suisung.mall.shop.invoicing.mapper.InvoicingWarehouseItemMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
warehouse_item_id, product_id, unit_id, item_id, category_id, warehouse_id, warehouse_item_cost,
warehouse_item_quantity, warehouse_item_lock_quantity, warehouse_item_quantity_min, warehouse_item_quantity_max,
store_id
</sql>
<select id="getList" resultType="java.util.Map">
select a.warehouse_item_cost,
a.warehouse_item_id,
a.item_id,
b.warehouse_id,
a.warehouse_item_lock_quantity,
a.warehouse_item_quantity,
a.warehouse_item_quantity_max,
a.warehouse_item_quantity_min,
b.warehouse_name,
c.item_name,
d.product_name,
e.unit_name
from invoicing_warehouse_item a
left join
invoicing_warehouse_base b on
a.warehouse_id = b.warehouse_id
left join shop_product_item c on a.item_id = c.item_id
left join shop_product_base d on a.product_id = d.product_id
left join shop_base_product_unit e on a.unit_id=e.unit_id
<where>
<if test="warehouse_name != null">
b.warehouse_name like concat('%', #{warehouse_name}, '%')
</if>
</where>
</select>
</mapper>