Commit e8cbc8f5 by huluobin

# update

parent 20b57a99
...@@ -3743,7 +3743,7 @@ ...@@ -3743,7 +3743,7 @@
<select id="omsSkuSellerCount" resultType="java.math.BigDecimal"> <select id="omsSkuSellerCount" resultType="java.math.BigDecimal">
SELECT (SELECT coalesce(sum(ifnull(tt2.sales, tt1.bailun_sku_quantity_ordered)), 0) SELECT (SELECT coalesce(sum(ifnull(tt2.sales, tt1.bailun_sku_quantity_ordered)), 0)
from ( from (
dc_base_forecast_history tt2 dc_aims_transfer_warehouse_sales tt2
LEFT JOIN ( LEFT JOIN (
select coalesce(sum(t1.bailun_sku_quantity_ordered), 0) as bailun_sku_quantity_ordered, select coalesce(sum(t1.bailun_sku_quantity_ordered), 0) as bailun_sku_quantity_ordered,
DATE_FORMAT(paid_time, '%Y-%m-%d') as paid_date DATE_FORMAT(paid_time, '%Y-%m-%d') as paid_date
...@@ -3766,6 +3766,54 @@ ...@@ -3766,6 +3766,54 @@
and tt2.date &gt;= #{lowerTime} and tt2.date &gt;= #{lowerTime}
and tt2.date &lt;= #{upperTime}) and tt2.date &lt;= #{upperTime})
/ #{days} / #{days}
+
(SELECT coalesce(sum(ifnull(tt2.sales, tt1.bailun_sku_quantity_ordered)), 0)
from (
dc_aims_transfer_warehouse_sales tt2
right JOIN (
select coalesce(sum(t1.bailun_sku_quantity_ordered), 0) as bailun_sku_quantity_ordered,
DATE_FORMAT(paid_time, '%Y-%m-%d') as paid_date
from dc_base_oms_sku t1
where t1.paid_time &gt;= #{lowerTime}
and t1.paid_time &lt;= #{upperTime}
and t1.bailun_sku = #{bailunSku}
and t1.warehouse_code = #{warehouseCode}
and t1.has_fba_s = 0
and t1.has_delete = 0
and t1.has_scalp = 0
and t1.has_buyer_remark = 0
and t1.has_platsku_remark = 0
and t1.has_innersale = 0
and t1.bailun_order_status != 'Canceled'
and t1.platform_order_type != '手工单'
GROUP BY DATE_FORMAT(paid_time, '%y%m%d')) tt1 on tt1.paid_date = tt2.date_str))
/ #{days}
-
(SELECT coalesce(sum(ifnull(tt2.sales, tt1.bailun_sku_quantity_ordered)), 0)
from (
dc_aims_transfer_warehouse_sales tt2
inner JOIN (
select coalesce(sum(t1.bailun_sku_quantity_ordered), 0) as bailun_sku_quantity_ordered,
DATE_FORMAT(paid_time, '%Y-%m-%d') as paid_date
from dc_base_oms_sku t1
where t1.paid_time &gt;= #{lowerTime}
and t1.paid_time &lt;= #{upperTime}
and t1.bailun_sku = #{bailunSku}
and t1.warehouse_code = #{warehouseCode}
and t1.has_fba_s = 0
and t1.has_delete = 0
and t1.has_scalp = 0
and t1.has_buyer_remark = 0
and t1.has_platsku_remark = 0
and t1.has_innersale = 0
and t1.bailun_order_status != 'Canceled'
and t1.platform_order_type != '手工单'
GROUP BY DATE_FORMAT(paid_time, '%y%m%d')) tt1 on tt1.paid_date = tt2.date_str)
where tt2.bailun_sku =#{bailunSku}
and tt2.warehouse_code = #{warehouseCode}
and tt2.date &gt;= #{lowerTime}
and tt2.date &lt;= #{upperTime})
/ #{days}
</select> </select>
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<configuration> <configuration>
<!--<properties resource="db-tj.properties"/>--> <!--<properties resource="db-tj.properties"/>-->
<!-- <properties resource="db-dev.properties"/>--> <properties resource="db-dev.properties"/>
<properties resource="db-prod.properties"/> <!-- <properties resource="db-prod.properties"/>-->
<settings> <settings>
<setting name="mapUnderscoreToCamelCase" value="true"/> <setting name="mapUnderscoreToCamelCase" value="true"/>
</settings> </settings>
......
...@@ -257,7 +257,7 @@ public class AutoTurnoverTest { ...@@ -257,7 +257,7 @@ public class AutoTurnoverTest {
public void testXX2() { public void testXX2() {
DcBaseStock dcBaseStock = SessionUtil.getSession().getMapper(DcBaseStockMapper.class) DcBaseStock dcBaseStock = SessionUtil.getSession().getMapper(DcBaseStockMapper.class)
.selectOneByExample(DcBaseStockExample.newAndCreateCriteria() .selectOneByExample(DcBaseStockExample.newAndCreateCriteria()
.andBailunSkuEqualTo("951294303") .andBailunSkuEqualTo("950697201")
.andWarehouseCodeEqualTo("GZBLWH") .andWarehouseCodeEqualTo("GZBLWH")
.example()); .example());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment