Просмотр исходного кода

[统计][修改][修改业态分析]

release_toaliyun_real
luozukai 6 лет назад
Родитель
Сommit
7b0f1be3f2
2 измененных файлов: 31 добавлений и 9 удалений
  1. +23
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/sys/WxBusinessController.java
  2. +8
    -8
      mallinkService/src/main/resources/mapper/WxBusinessMapper.xml

+ 23
- 1
mallinkAdmin/src/main/java/com/iformall/controller/sys/WxBusinessController.java Просмотреть файл

@@ -121,11 +121,33 @@ public class WxBusinessController extends BaseController {
if(m.get("volume") != null) {
//单位转万
BigDecimal b = (BigDecimal)m.get("volume");
String dstr = b.divide(new BigDecimal(10000)).setScale(2, BigDecimal.ROUND_HALF_UP).toString();
String dstr = b.divide(new BigDecimal(10000)).setScale(4, BigDecimal.ROUND_HALF_UP).toString();
businessDataVo.setSale(dstr);
}
if(m.get("sale") != null)
businessDataVo.setSaleRate(m.get("sale").toString());

if(m.get("rent") == null){
m.put("rent",0);
}
if(m.get("sale") == null){
m.put("sale",0);
m.put("rentSaleRate",0);
businessDataVo.setRentSaleRate("0");
exeList.add(businessDataVo);
continue;
}
BigDecimal sale = new BigDecimal(m.get("sale").toString());
BigDecimal rent = new BigDecimal(m.get("rent").toString());
if(sale.doubleValue() <= 0){
businessDataVo.setRentSaleRate("0");
exeList.add(businessDataVo);
continue;
}else {
BigDecimal divide = rent.divide(sale, 2, BigDecimal.ROUND_HALF_UP);
m.put("rentSaleRate", divide);
businessDataVo.setRentSaleRate(divide.toString());
}
exeList.add(businessDataVo);
}
excelService.exportExcel(exeList, null, "业态统计", WxBusinessDataVo.class, "业态统计列表.xlsx", response, false);


+ 8
- 8
mallinkService/src/main/resources/mapper/WxBusinessMapper.xml Просмотреть файл

@@ -86,13 +86,13 @@
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 = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 )
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.report_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 )
/100,2) volume,
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 = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 )
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.report_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 )
/
(select if(sum(ws.operation_area) is null,0,sum(ws.operation_area))
from wx_merchant m
@@ -119,7 +119,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 = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 ) /
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.report_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 ) /
(select sum(mtd.trade_count)
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.report_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 )
@@ -134,7 +134,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 = #{id} and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 and m.id = mm.id)
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = #{id} and m.tenant_id=#{tenantId} and mtd.report_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 and m.id = mm.id)
/
(select if(sum(ws.operation_area) is null,0,sum(ws.operation_area))
from wx_merchant m
@@ -148,7 +148,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 = #{id} and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 and m.id = mm.id)/
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = #{id} and m.tenant_id=#{tenantId} and mtd.report_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 and m.id = mm.id)/
(select if(sum(ws.operation_area) is null,0,sum(ws.operation_area))
from wx_merchant m
left join wx_merchant_shop mtd on mtd.merchant_id = m.id
@@ -158,7 +158,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 = #{id} and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 )
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = #{id} and m.tenant_id=#{tenantId} and mtd.report_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 )
/
(select if(sum(ws.operation_area) is null,0,sum(ws.operation_area))
from wx_merchant m
@@ -167,7 +167,7 @@
where m.business_id = #{id} and m.tenant_id=#{tenantId} and m.status = 1 and m.is_del = 0 )
/100,2)

,2) devoteRate
*100,2) devoteRate

from wx_merchant mm
left join wx_merchant_trade_daily mtd on mtd.merchant_id = mm.id
@@ -175,7 +175,7 @@
left join wx_shop ws on(wmt.shop_id = ws.id)
where mm.business_id=#{id} and mm.tenant_id=#{tenantId}
and mm.status = 1 and mm.is_del = 0
and mtd.create_date between #{startdate} and #{enddate}
and mtd.report_date between #{startdate} and #{enddate}
group by mm.id
order by devoteRate desc



Загрузка…
Отмена
Сохранить