Commit 921475b3 by guanzhenshan

解决数据仓服务生成数据异常的问题

parent c1603eb8
......@@ -70,8 +70,9 @@ namespace Bailun.DC.SkuDataWareHouse
var sql = $@"select t2.hq_type as warehousetype,t2.warehouse_name as warehousename,t2.warehouse_code,t1.bailun_sku as sku,t1.category_id,t1.categoryname,t1.sku_title_cn as skuname,(case when t4.status=1 then 0 else 1 end) monitorstatus,t5.clearancestatus,(case when t8.id is not null then 1 else 0 end) as tortstatus,t5.str_skutag,t1.unit_price as buyprice,t1.usable_stock,(t1.usable_stock*t1.unit_price) amount_stock,t6.quantity_purchase,(t6.quantity_purchase*t1.unit_price) as purchase_amount,t6.quantity_transfer,(t6.quantity_transfer*t1.unit_price) amount_transit,t6.quantity_out_stock,t7.oneday_total_sales,(t7.oneday_total_sales*t1.unit_price) as amount_onedaysale,t7.sevenday_total_sales,(t7.sevenday_total_sales*t1.unit_price) amount_sevendaysale,t7.fourteenday_total_sales,t7.thirtyday_total_sales,t7.sevenday_average_sales,t7.fourteenday_average_sales,t7.thirtyday_average_sales,t1.create_time as skucreatetime,t2.area_id,t2.area_name,t1.brand as skubrand,(case when t9.id is not null then 1 else 0 end) as is_redundancy
from (select t01.bailun_sku,t01.warehouse_code,t01.usable_stock,t02.unit_price,t02.create_time,t02.bailun_category_id as category_id,t02.bailun_category_name as categoryname,t02.sku_title_cn,t02.brand from dc_base_stock t01
join dc_base_sku t02 on t01.bailun_sku=t02.bailun_sku and t02.company_id=1
order by t01.id
limit {strlimit}) t1
left join dc_base_warehouse t2 on t1.warehouse_code=t2.warehouse_code
join dc_base_warehouse t2 on t1.warehouse_code=t2.warehouse_code
left join dc_auto_config_sku_warehouse t4 on t4.bailun_sku=t1.bailun_sku and t4.warehouse_code=t1.warehouse_code
left join dc_sku_monitor t5 on t5.sku=t1.bailun_sku and t5.warehousecode=t1.warehouse_code
left join dc_mid_transit t6 on t1.bailun_sku=t6.bailun_sku and t1.warehouse_code=t6.warehouse_code
......
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