|
|
@ -1,18 +1,16 @@ |
|
|
|
<?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.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailMapper"> |
|
|
|
<!-- <where> ${ew.sqlSegment} </where>--> |
|
|
|
<!-- ${ew.customSqlSegment} --> |
|
|
|
<!-- <where> ${ew.sqlSegment} </where>--> |
|
|
|
<!-- ${ew.customSqlSegment} --> |
|
|
|
<select id="selByMainSid" |
|
|
|
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailDetailsVo"> |
|
|
|
SELECT |
|
|
|
wicd.*, |
|
|
|
SELECT wicd.*, |
|
|
|
wicd.goodsModel as carModel, |
|
|
|
wicd.goodsSid as goodsSpuSid, |
|
|
|
wicd.goodsName as goodsSpuName, |
|
|
|
wicd.goodsCode as goodsSkuCode |
|
|
|
FROM |
|
|
|
wms_inventory_checkbill_detail wicd |
|
|
|
FROM wms_inventory_checkbill_detail wicd |
|
|
|
LEFT JOIN wms_inventory wi |
|
|
|
ON wicd.inventorySid = wi.`sid` |
|
|
|
WHERE billSid = #{billSid} |
|
|
@ -20,82 +18,100 @@ |
|
|
|
|
|
|
|
<select id="reportSumTotal" |
|
|
|
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
|
|
|
SELECT |
|
|
|
IFNULL(SUM(wicd.bookCount),0) AS ypNum, |
|
|
|
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney, |
|
|
|
IFNULL(SUM(wicd.realCount),0) AS spNum, |
|
|
|
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney, |
|
|
|
IFNULL(SUM(wicd.profitCount),0) AS pyNum, |
|
|
|
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney, |
|
|
|
IFNULL(SUM(wicd.loseCount),0) AS pkNum, |
|
|
|
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney, |
|
|
|
IFNULL(SUM(lossCount),0) AS psNum, |
|
|
|
IFNULL(SUM(lossCount * cost),0) AS psMoney |
|
|
|
FROM |
|
|
|
wms_inventory_checkbill_detail AS wicd |
|
|
|
SELECT IFNULL(SUM(wicd.bookCount), 0) AS ypNum, |
|
|
|
IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney, |
|
|
|
IFNULL(SUM(wicd.realCount), 0) AS spNum, |
|
|
|
IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney, |
|
|
|
IFNULL(SUM(wicd.profitCount), 0) AS pyNum, |
|
|
|
IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney, |
|
|
|
IFNULL(SUM(wicd.loseCount), 0) AS pkNum, |
|
|
|
IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney, |
|
|
|
IFNULL(SUM(lossCount), 0) AS psNum, |
|
|
|
IFNULL(SUM(lossCount * cost), 0) AS psMoney |
|
|
|
FROM wms_inventory_checkbill_detail AS wicd |
|
|
|
WHERE wicd.billSid = #{billSid} |
|
|
|
GROUP BY wicd.billSid |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="reportSumWare" |
|
|
|
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
|
|
|
SELECT |
|
|
|
wicd.warehouseName, |
|
|
|
IFNULL(SUM(wicd.bookCount),0) AS ypNum, |
|
|
|
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney, |
|
|
|
IFNULL(SUM(wicd.realCount),0) AS spNum, |
|
|
|
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney, |
|
|
|
IFNULL(SUM(wicd.profitCount),0) AS pyNum, |
|
|
|
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney, |
|
|
|
IFNULL(SUM(wicd.loseCount),0) AS pkNum, |
|
|
|
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney, |
|
|
|
IFNULL(SUM(lossCount),0) AS psNum, |
|
|
|
IFNULL(SUM(lossCount * cost),0) AS psMoney |
|
|
|
FROM |
|
|
|
wms_inventory_checkbill_detail AS wicd |
|
|
|
SELECT wicd.warehouseName, |
|
|
|
IFNULL(SUM(wicd.bookCount), 0) AS ypNum, |
|
|
|
IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney, |
|
|
|
IFNULL(SUM(wicd.realCount), 0) AS spNum, |
|
|
|
IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney, |
|
|
|
IFNULL(SUM(wicd.profitCount), 0) AS pyNum, |
|
|
|
IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney, |
|
|
|
IFNULL(SUM(wicd.loseCount), 0) AS pkNum, |
|
|
|
IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney, |
|
|
|
IFNULL(SUM(lossCount), 0) AS psNum, |
|
|
|
IFNULL(SUM(lossCount * cost), 0) AS psMoney |
|
|
|
FROM wms_inventory_checkbill_detail AS wicd |
|
|
|
WHERE wicd.billSid = #{billSid} |
|
|
|
GROUP BY wicd.warehouseSid |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="reportSumArea" |
|
|
|
resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo"> |
|
|
|
SELECT |
|
|
|
CONCAT( |
|
|
|
SELECT CONCAT( |
|
|
|
wicd.warehouseName, |
|
|
|
'-', |
|
|
|
wz.zoneName, |
|
|
|
'-', |
|
|
|
wicd.warehouseArea |
|
|
|
) AS warehouseAreaeName, |
|
|
|
IFNULL(SUM(wicd.bookCount),0) AS ypNum, |
|
|
|
IFNULL(SUM(wicd.bookCount * cost) ,0) AS ypMoney, |
|
|
|
IFNULL(SUM(wicd.realCount),0) AS spNum, |
|
|
|
IFNULL(SUM(wicd.realCount * cost),0) AS spMoney, |
|
|
|
IFNULL(SUM(wicd.profitCount),0) AS pyNum, |
|
|
|
IFNULL(SUM(wicd.profitCount * cost),0) AS pyMoney, |
|
|
|
IFNULL(SUM(wicd.loseCount),0) AS pkNum, |
|
|
|
IFNULL(SUM(wicd.loseCount * cost),0) AS pkMoney, |
|
|
|
IFNULL(SUM(lossCount),0) AS psNum, |
|
|
|
IFNULL(SUM(lossCount * cost),0) AS psMoney |
|
|
|
FROM |
|
|
|
wms_inventory_checkbill_detail AS wicd |
|
|
|
IFNULL(SUM(wicd.bookCount), 0) AS ypNum, |
|
|
|
IFNULL(SUM(wicd.bookCount * cost), 0) AS ypMoney, |
|
|
|
IFNULL(SUM(wicd.realCount), 0) AS spNum, |
|
|
|
IFNULL(SUM(wicd.realCount * cost), 0) AS spMoney, |
|
|
|
IFNULL(SUM(wicd.profitCount), 0) AS pyNum, |
|
|
|
IFNULL(SUM(wicd.profitCount * cost), 0) AS pyMoney, |
|
|
|
IFNULL(SUM(wicd.loseCount), 0) AS pkNum, |
|
|
|
IFNULL(SUM(wicd.loseCount * cost), 0) AS pkMoney, |
|
|
|
IFNULL(SUM(lossCount), 0) AS psNum, |
|
|
|
IFNULL(SUM(lossCount * cost), 0) AS psMoney |
|
|
|
FROM wms_inventory_checkbill_detail AS wicd |
|
|
|
LEFT JOIN wms_warehouse_zone AS wz |
|
|
|
ON wz.warehouseSid = wicd.warehouseSid |
|
|
|
WHERE wicd.billSid = #{billSid} |
|
|
|
GROUP BY wicd.warehouseAreaSid |
|
|
|
</select> |
|
|
|
|
|
|
|
<update id="saveInventoryInfoZC"> |
|
|
|
update wms_inventory_checkbill_detail set lossCount = #{dto.badNum},realCount = #{dto.num},profitCount = 0,loseCount = 0,remarks = #{dto.remarks},state = 2 where sid = #{dto.sid} |
|
|
|
update wms_inventory_checkbill_detail |
|
|
|
set lossCount = #{dto.badNum}, |
|
|
|
realCount = #{dto.num}, |
|
|
|
profitCount = 0, |
|
|
|
loseCount = 0, |
|
|
|
remarks = #{dto.remarks}, |
|
|
|
state = 2 |
|
|
|
where sid = #{dto.sid} |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="saveInventoryInfoPY"> |
|
|
|
update wms_inventory_checkbill_detail set lossCount = #{dto.badNum},realCount = #{dto.num},profitCount = #{pyCount},loseCount = 0,remarks = #{dto.remarks},state = 3 where sid = #{dto.sid} |
|
|
|
update wms_inventory_checkbill_detail |
|
|
|
set lossCount = #{dto.badNum}, |
|
|
|
realCount = #{dto.num}, |
|
|
|
profitCount = #{pyCount}, |
|
|
|
loseCount = 0, |
|
|
|
remarks = #{dto.remarks}, |
|
|
|
state = 3 |
|
|
|
where sid = #{dto.sid} |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="saveInventoryInfoPK"> |
|
|
|
update wms_inventory_checkbill_detail set lossCount = #{dto.badNum},realCount = #{dto.num},profitCount = 0,loseCount = #{pkCount},remarks = #{dto.remarks},state = 4 where sid = #{dto.sid} |
|
|
|
update wms_inventory_checkbill_detail |
|
|
|
set lossCount = #{dto.badNum}, |
|
|
|
realCount = #{dto.num}, |
|
|
|
profitCount = 0, |
|
|
|
loseCount = #{pkCount}, |
|
|
|
remarks = #{dto.remarks}, |
|
|
|
state = 4 |
|
|
|
where sid = #{dto.sid} |
|
|
|
</update> |
|
|
|
|
|
|
|
<select id="scan" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean"> |
|
|
|
SELECT |
|
|
|
lossCount AS badNum, |
|
|
|
SELECT IF(lossCount IS NULL, 0, lossCount) AS badNum, |
|
|
|
goodsID, |
|
|
|
goodsSkuTitle AS goodsName, |
|
|
|
goodsSkuCode, |
|
|
@ -104,16 +120,15 @@ |
|
|
|
remarks, |
|
|
|
sid, |
|
|
|
unit |
|
|
|
FROM |
|
|
|
wms_inventory_checkbill_detail |
|
|
|
FROM wms_inventory_checkbill_detail |
|
|
|
WHERE billSid = #{sid} |
|
|
|
AND goodsID = #{content} |
|
|
|
AND warehouseRackSid = #{houseSid} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="sourceBillBySid" resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitindetail.WmsInventoryProfitinDetailDto"> |
|
|
|
SELECT |
|
|
|
goodsSpuSid AS goodsSid, |
|
|
|
<select id="sourceBillBySid" |
|
|
|
resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitindetail.WmsInventoryProfitinDetailDto"> |
|
|
|
SELECT goodsSpuSid AS goodsSid, |
|
|
|
goodsSpuName, |
|
|
|
goodsSkuSid, |
|
|
|
goodsSkuTitle AS goodsName, |
|
|
@ -126,16 +141,14 @@ |
|
|
|
supplierSid, |
|
|
|
supplierName, |
|
|
|
profitCount AS inStorageNum |
|
|
|
FROM |
|
|
|
wms_inventory_checkbill_detail |
|
|
|
FROM wms_inventory_checkbill_detail |
|
|
|
WHERE billSid = #{sid} |
|
|
|
AND profitCount > 0 |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="sourceBillPkBySid" |
|
|
|
resultType="com.yxt.wms.biz.inventory.wmsinventoryprofitoutdetail.WmsInventoryProfitoutDetailDto"> |
|
|
|
SELECT |
|
|
|
d.goodsID, |
|
|
|
SELECT d.goodsID, |
|
|
|
d.goodsSpuSid AS goodsSid, |
|
|
|
d.goodsSpuName, |
|
|
|
d.goodsSkuSid, |
|
|
@ -152,8 +165,7 @@ |
|
|
|
d.warehouseRackName, |
|
|
|
d.loseCount AS outStorageNum, |
|
|
|
w.cost AS inStoragePrice |
|
|
|
FROM |
|
|
|
wms_inventory_checkbill_detail d |
|
|
|
FROM wms_inventory_checkbill_detail d |
|
|
|
LEFT JOIN wms_inventory w |
|
|
|
ON d.goodsID = w.goodsID |
|
|
|
WHERE billSid = #{sid} |
|
|
|