mallinkService/src/main/resources/mapper/WxBusinessMapper.xmlZobrazit soubor
@@ -86,62 +86,62 @@
round(
(select sum(mtd.trade_amt)
from wx_merchant m
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate})
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1)
/100,2) volume,
round(
(select sum(mtd.trade_amt)
from wx_merchant m
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate})
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1)
/
(select sum(ws.operation_area)
from wx_merchant m
left join wx_merchant_shop mtd on mtd.merchant_id = m.id
left join wx_shop ws on(mtd.shop_id = ws.id)
where m.business_id = b.id and m.tenant_id=#{tenantId})
where m.business_id = b.id and m.tenant_id=#{tenantId} and m.status = 1)
/100,2) sale,
round(
(select
(select sum(br.receive_pay) receive_pay from wx_merchant m
left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate})
left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1)
+
(select sum(br.receive_pay) receive_pay from wx_merchant m
left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate})
left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1)
from dual) /
(select sum(ws.operation_area)
from wx_merchant m
left join wx_merchant_shop mtd on mtd.merchant_id = m.id
left join wx_shop ws on(mtd.shop_id = ws.id)
where m.business_id = b.id and m.tenant_id=#{tenantId} )
where m.business_id = b.id and m.tenant_id=#{tenantId} and m.status = 1)
/100,2) rent,
round(
round(
(select sum(mtd.trade_amt)
from wx_merchant m
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate})
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1)
/
(select sum(ws.operation_area)
from wx_merchant m
left join wx_merchant_shop mtd on mtd.merchant_id = m.id
left join wx_shop ws on(mtd.shop_id = ws.id)
where m.business_id = b.id and m.tenant_id=#{tenantId})
where m.business_id = b.id and m.tenant_id=#{tenantId} and m.status = 1)
/100,2)
/
round(
(select
(select sum(br.receive_pay) receive_pay from wx_merchant m
left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate})
left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1)
+
(select sum(br.receive_pay) receive_pay from wx_merchant m
left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate})
left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1)
from dual) /
(select sum(ws.operation_area)
from wx_merchant m
left join wx_merchant_shop mtd on mtd.merchant_id = m.id
left join wx_shop ws on(mtd.shop_id = ws.id)
where m.business_id = b.id)
where m.business_id = b.id and m.status = 1)
/100,2)
,4)
rentSaleRate,
@@ -149,10 +149,10 @@
round(
(select sum(mtd.trade_amt)
from wx_merchant m
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate}) /
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) /
(select count(mtd.id)
from wx_merchant m
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate})
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1)