diff --git a/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml b/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml index e50cf0103..b2137e784 100644 --- a/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml +++ b/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.report_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 STR_TO_DATE(mtd.report_date,'%Y-%m-%d') 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.report_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 STR_TO_DATE(mtd.report_date,'%Y-%m-%d') 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 @@ -105,15 +105,15 @@ 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=456 and m.status = 1 and m.is_del = 0 )area, + where m.business_id = b.id and m.tenant_id=#{tenantId} and m.status = 1 and m.is_del = 0 )area, 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.report_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 STR_TO_DATE(mtd.report_date,'%Y-%m-%d') 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 ) + 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 STR_TO_DATE(mtd.report_date,'%Y-%m-%d') between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 ) /100,2) comPrice from wx_business b