|
|
@@ -1,5 +1,6 @@
|
|
|
<?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">
|
|
|
+<!--suppress ALL -->
|
|
|
<mapper namespace="org.springblade.stock.mapper.StockGoodsMapper">
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
@@ -50,6 +51,58 @@
|
|
|
<result column="cname" property="cname"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap id="stockGoodsVoResultMap" type="org.springblade.stock.entity.StockGoods">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="storage_id" property="storageId"/>
|
|
|
+ <result column="goods_id" property="goodsId"/>
|
|
|
+ <result column="in_quantity" property="inQuantity"/>
|
|
|
+ <result column="out_quantity" property="outQuantity"/>
|
|
|
+ <result column="locking_quantity" property="lockingQuantity"/>
|
|
|
+ <result column="balance_quantity" property="balanceQuantity"/>
|
|
|
+ <result column="in_weight" property="inWeight"/>
|
|
|
+ <result column="out_weight" property="outWeight"/>
|
|
|
+ <result column="locking_weight" property="lockingWeight"/>
|
|
|
+ <result column="balance_weight" property="balanceWeight"/>
|
|
|
+ <result column="in_volumn" property="inVolumn"/>
|
|
|
+ <result column="out_volumn" property="outVolumn"/>
|
|
|
+ <result column="locking_volumn" property="lockingVolumn"/>
|
|
|
+ <result column="balance_volumn" property="balanceVolumn"/>
|
|
|
+ <result column="org_order_no" property="orgOrderNo"/>
|
|
|
+ <result column="src_order_no" property="srcOrderNo"/>
|
|
|
+ <result column="src_id" property="srcId"/>
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
+ <result column="version" property="version"/>
|
|
|
+ <result column="create_user" property="createUser"/>
|
|
|
+ <result column="create_dept" property="createDept"/>
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
+ <result column="update_user" property="updateUser"/>
|
|
|
+ <result column="update_time" property="updateTime"/>
|
|
|
+ <result column="status" property="status"/>
|
|
|
+ <result column="is_deleted" property="isDeleted"/>
|
|
|
+ <result column="lot_no" property="lotNo"/>
|
|
|
+ <result column="in_date" property="inDate"/>
|
|
|
+ <result column="corp_id" property="corpId"/>
|
|
|
+ <result column="item_type" property="itemType"/>
|
|
|
+ <result column="en_route_quantity" property="enRouteQuantity"/>
|
|
|
+ <result column="surplus_route_quantity" property="surplusRouteQuantity"/>
|
|
|
+ <result column="in_amount" property="inAmount"/>
|
|
|
+ <result column="out_amount" property="outAmount"/>
|
|
|
+ <result column="balance_amount" property="balanceAmount"/>
|
|
|
+ <result column="typeno_one" property="typenoOne"/>
|
|
|
+ <result column="corp_name" property="corpName"/>
|
|
|
+ <result column="code" property="code"/>
|
|
|
+ <result column="brand" property="brand"/>
|
|
|
+ <result column="brand_item" property="brandItem"/>
|
|
|
+ <result column="typeno" property="typeno"/>
|
|
|
+ <result column="place_production" property="placeProduction"/>
|
|
|
+ <result column="cname" property="cname"/>
|
|
|
+ <result column="goodsType" property="goodsType"/>
|
|
|
+ <result column="url" property="url"/>
|
|
|
+ <result column="corpName" property="corpName"/>
|
|
|
+ <result column="stockName" property="stockName"/>
|
|
|
+ <result column="storageName" property="storageName"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
|
|
|
<select id="selectStockGoodsPage" resultMap="stockGoodsResultMap">
|
|
|
select *
|
|
|
@@ -677,6 +730,148 @@
|
|
|
bo.busines_date,
|
|
|
item.corp_id
|
|
|
</select>
|
|
|
+ <select id="getStockList" resultMap="stockGoodsVoResultMap"
|
|
|
+ parameterType="org.springblade.stock.vo.StockGoodsVO">
|
|
|
+ SELECT
|
|
|
+ bsg.id,
|
|
|
+ bsg.storage_id,
|
|
|
+ bsg.goods_id,
|
|
|
+ bsg.in_quantity,
|
|
|
+ bsg.out_quantity,
|
|
|
+ bsg.locking_quantity,
|
|
|
+ bsg.this_locking_quantity,
|
|
|
+ bsg.balance_quantity,
|
|
|
+ bsg.in_weight,
|
|
|
+ bsg.out_weight,
|
|
|
+ bsg.locking_weight,
|
|
|
+ bsg.balance_weight,
|
|
|
+ bsg.in_volumn,
|
|
|
+ bsg.out_volumn,
|
|
|
+ bsg.locking_volumn,
|
|
|
+ bsg.balance_volumn,
|
|
|
+ bsg.org_order_no,
|
|
|
+ bsg.src_order_no,
|
|
|
+ bsg.src_id,
|
|
|
+ bsg.remarks,
|
|
|
+ bsg.version,
|
|
|
+ bsg.tenant_id,
|
|
|
+ bsg.create_user,
|
|
|
+ bsg.create_dept,
|
|
|
+ bsg.create_time,
|
|
|
+ bsg.update_user,
|
|
|
+ bsg.update_time,
|
|
|
+ bsg.STATUS,
|
|
|
+ bsg.is_deleted,
|
|
|
+ bsg.lot_no,
|
|
|
+ bsg.in_date,
|
|
|
+ bsg.corp_id,
|
|
|
+ bsg.item_type,
|
|
|
+ bsg.en_route_quantity,
|
|
|
+ bsg.surplus_route_quantity,
|
|
|
+ bsg.in_amount,
|
|
|
+ bsg.out_amount,
|
|
|
+ bsg.balance_amount,
|
|
|
+ bsg.stock_price,
|
|
|
+ bsg.typeno_one,
|
|
|
+ bsg.corp_name,
|
|
|
+ bsg.brand,
|
|
|
+ bsg.brand_item,
|
|
|
+ bsg.typeno,
|
|
|
+ bsg.place_production,
|
|
|
+ bsg.cname,
|
|
|
+ bsg.order_no,
|
|
|
+ bsg.bill_no,
|
|
|
+ bsg.contract_number,
|
|
|
+ bsg.cntr_no,
|
|
|
+ bsg.trade_type,
|
|
|
+ bsg.typeno_two,
|
|
|
+ bsg.order_type,
|
|
|
+ bsg.lower_limit,
|
|
|
+ bsg.purchase_price,
|
|
|
+ bsg.actual_quantity,
|
|
|
+ bsg.warehouse_id,
|
|
|
+ bgd.code,
|
|
|
+ bgd.brand as brand,
|
|
|
+ bgd.brand_item as brandItem,
|
|
|
+ bgd.Typeno as typeno,
|
|
|
+ bgd.cname as cname,
|
|
|
+ bgt.cname as goodsType,
|
|
|
+ bgd.url as url,
|
|
|
+ bcd.cname as corpName,
|
|
|
+ bsd.cname as stockName,
|
|
|
+ bst.cname as storageName
|
|
|
+ FROM
|
|
|
+ business_stock_goods bsg INNER JOIN basic_goods_desc bgd on bsg.goods_id = bgd.id
|
|
|
+ INNER JOIN basic_goods_type bgt on bgd.goods_type_id = bgt.id
|
|
|
+ INNER JOIN basic_corps_desc bcd on bsg.corp_id = bcd.id
|
|
|
+ INNER JOIN basic_storage_desc bsd on bsg.storage_id = bsd.id
|
|
|
+ INNER JOIN basic_storage_type bst on bsg.warehouse_id = bst.id
|
|
|
+ <where>
|
|
|
+ bsg.is_deleted = 0
|
|
|
+ AND bsg.tenant_id = #{tenantId}
|
|
|
+
|
|
|
+ <if test="orderType != null and orderType != ''">
|
|
|
+ AND bsg.order_type = #{orderType}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="billNo != null and billNo != ''">
|
|
|
+ AND bsg.bill_no LIKE CONCAT('%', #{billNo}, '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="contractNumber != null and contractNumber != ''">
|
|
|
+ AND bsg.contract_number LIKE CONCAT('%', #{contractNumber}, '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="lotNo != null and lotNo != ''">
|
|
|
+ AND bsg.lot_no LIKE CONCAT('%', #{lotNo}, '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="cname != null and cname != ''">
|
|
|
+ AND bsg.cname LIKE CONCAT('%', #{cname}, '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="code != null and code != ''">
|
|
|
+ AND bsg.code LIKE CONCAT('%', #{code}, '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="storageId != null">
|
|
|
+ AND bsg.storage_id = #{storageId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="brandItem != null and brandItem != ''">
|
|
|
+ AND bsg.brand_item LIKE CONCAT('%', #{brandItem}, '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="placeProduction != null and placeProduction != ''">
|
|
|
+ AND bsg.place_production LIKE CONCAT('%', #{placeProduction}, '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="brand != null and brand != ''">
|
|
|
+ AND bsg.brand LIKE CONCAT('%', #{brand}, '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="typeno != null and typeno != ''">
|
|
|
+ AND bsg.typeno LIKE CONCAT('%', #{typeno}, '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="typenoOne != null and typenoOne != ''">
|
|
|
+ AND bsg.typeno_one LIKE CONCAT('%', #{typenoOne}, '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="typenoTwo != null and typenoTwo != ''">
|
|
|
+ AND bsg.typeno_two LIKE CONCAT('%', #{typenoTwo}, '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="createStartTime != null and createStartTime != ''">
|
|
|
+ AND bsg.create_time >= #{createStartTime}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="createEndTime != null and createEndTime != ''">
|
|
|
+ AND bsg.create_time <= #{createEndTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+
|
|
|
+ </select>
|
|
|
<update id="updateStockGoods" parameterType="org.springblade.stock.entity.StockGoods">
|
|
|
UPDATE business_stock_goods
|
|
|
SET surplus_route_quantity = #{surplusRouteQuantity},
|