(select if(sum(mtd.trade_amt) is null,0,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 = 9 and m.tenant_id=789 and mtd.create_date between '2019-07-01' and '2019-07-31 23:59:59')
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = 9 and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate})
/
(select if(sum(ws.operation_area) is null,0,sum(ws.operation_area))
from wx_merchant m
@@ -178,7 +178,7 @@
round(
(select if(sum(mtd.trade_amt) is null,0,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 = 9 and m.tenant_id=789 and mtd.create_date between '2019-07-01' and '2019-07-31 23:59:59')
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = 9 and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate})
/
(select if(sum(ws.operation_area) is null,0,sum(ws.operation_area))
from wx_merchant m
@@ -198,9 +198,6 @@
and mtd.create_date between #{startdate} and #{enddate}