| @@ -160,15 +160,33 @@ | |||||
| <select id="devoteList" parameterType="com.iformall.domain.po.WxBusiness" resultType="hashmap"> | <select id="devoteList" parameterType="com.iformall.domain.po.WxBusiness" resultType="hashmap"> | ||||
| select m.name merchantName,round(sum(mtd.trade_amt)/sum(ws.operation_area) /100,2) sale, | select m.name merchantName,round(sum(mtd.trade_amt)/sum(ws.operation_area) /100,2) sale, | ||||
| 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 = 9 and m.tenant_id=789 and mtd.create_date between '2019-07-01' and '2019-07-31 23:59:59') | |||||
| / | |||||
| (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.status = 1 and m.business_id = #{id} and m.tenant_id=#{tenantId}) | |||||
| /100,2) saleRate, | |||||
| round( | round( | ||||
| round(sum(mtd.trade_amt)/sum(ws.operation_area) /100,2)/ | round(sum(mtd.trade_amt)/sum(ws.operation_area) /100,2)/ | ||||
| (select round(sum(mtd.trade_amt)/sum(ws.operation_area) /100,2) | |||||
| ( | |||||
| round( | |||||
| (select sum(mtd.trade_amt) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id | |||||
| left join wx_merchant_shop wmt on wmt.merchant_id = m.id | |||||
| left join wx_shop ws on(wmt.shop_id = ws.id) | |||||
| where m.business_id=#{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 = 9 and m.tenant_id=789 and mtd.create_date between '2019-07-01' and '2019-07-31 23:59:59') | |||||
| / | |||||
| (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.status = 1 and m.business_id = #{id} and m.tenant_id=#{tenantId}) | |||||
| /100,2) | |||||
| ) | |||||
| ,2) devoteRate | ,2) devoteRate | ||||
| from wx_merchant m | from wx_merchant m | ||||
| @@ -176,9 +194,13 @@ | |||||
| left join wx_merchant_shop wmt on wmt.merchant_id = m.id | left join wx_merchant_shop wmt on wmt.merchant_id = m.id | ||||
| left join wx_shop ws on(wmt.shop_id = ws.id) | left join wx_shop ws on(wmt.shop_id = ws.id) | ||||
| where m.business_id=#{id} and m.tenant_id=#{tenantId} | where m.business_id=#{id} and m.tenant_id=#{tenantId} | ||||
| and m.status = 1 | |||||
| and mtd.create_date between #{startdate} and #{enddate} | and mtd.create_date between #{startdate} and #{enddate} | ||||
| group by m.id | group by m.id | ||||
| order by devoteRate desc | order by devoteRate desc | ||||
| </select> | </select> | ||||
| </mapper> | </mapper> | ||||