|
@@ -78,11 +78,11 @@
|
|
<!-- 日统计select concat(DATE_FORMAT( a.create_date,'%H'),'点') as categorie,count(1) as saleNum,sum(a.price) as salePrice -->
|
|
<!-- 日统计select concat(DATE_FORMAT( a.create_date,'%H'),'点') as categorie,count(1) as saleNum,sum(a.price) as salePrice -->
|
|
<select id="getDayStatistics" resultMap="chartBean" parameterType="com.szwl.model.query.StatisticsParam">
|
|
<select id="getDayStatistics" resultMap="chartBean" parameterType="com.szwl.model.query.StatisticsParam">
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
- select concat(DATE_FORMAT( a.create_date,'%H'),'点') as categorie,count(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
|
|
|
|
+ select concat(DATE_FORMAT( a.create_date,'%H'),'点') as categorie,sum(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
from t_order a where a.status='1' -- 支付成功
|
|
from t_order a where a.status='1' -- 支付成功
|
|
</if>
|
|
</if>
|
|
<if test="ifForeign != null and ifForeign ==1"> -- 国外用户
|
|
<if test="ifForeign != null and ifForeign ==1"> -- 国外用户
|
|
- select concat(DATE_FORMAT( a.pay_date,'%H'),'点') as categorie,count(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
|
|
|
|
+ select concat(DATE_FORMAT( a.pay_date,'%H'),'点') as categorie,sum(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
from t_coin_order a where 1=1
|
|
from t_coin_order a where 1=1
|
|
</if>
|
|
</if>
|
|
<if test="adminId != null and adminId !=''">
|
|
<if test="adminId != null and adminId !=''">
|
|
@@ -138,12 +138,12 @@
|
|
-- count(1) as saleNum,sum(a.price) as salePrice
|
|
-- count(1) as saleNum,sum(a.price) as salePrice
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
select case DATE_FORMAT( a.create_date,'%w') when 0 then '周日' else CONCAT('周',DATE_FORMAT( a.create_date,'%w')) end as categorie,
|
|
select case DATE_FORMAT( a.create_date,'%w') when 0 then '周日' else CONCAT('周',DATE_FORMAT( a.create_date,'%w')) end as categorie,
|
|
- count(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
|
|
|
|
+ sum(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
from t_order a where a.status='1' -- 支付成功
|
|
from t_order a where a.status='1' -- 支付成功
|
|
</if>
|
|
</if>
|
|
<if test="ifForeign != null and ifForeign ==1"> -- 国外用户
|
|
<if test="ifForeign != null and ifForeign ==1"> -- 国外用户
|
|
select case DATE_FORMAT( a.pay_date,'%w') when 0 then '周日' else CONCAT('周',DATE_FORMAT( a.pay_date,'%w')) end as categorie,
|
|
select case DATE_FORMAT( a.pay_date,'%w') when 0 then '周日' else CONCAT('周',DATE_FORMAT( a.pay_date,'%w')) end as categorie,
|
|
- count(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
|
|
|
|
+ sum(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
from t_coin_order a where 1=1
|
|
from t_coin_order a where 1=1
|
|
</if>
|
|
</if>
|
|
<if test="adminId != null and adminId !=''">
|
|
<if test="adminId != null and adminId !=''">
|
|
@@ -158,7 +158,7 @@
|
|
<if test="adminIds != null and adminIds !=''">
|
|
<if test="adminIds != null and adminIds !=''">
|
|
and a.admin_id in #{adminIds}
|
|
and a.admin_id in #{adminIds}
|
|
</if>
|
|
</if>
|
|
- <if test="ifForeign != null and ifForeign ==1 and clientIds.size()>0">
|
|
|
|
|
|
+ <if test="ifForeign != null and ifForeign ==1 and clientIds != null and clientIds.size()>0">
|
|
and a.client_id in #{clientIds}
|
|
and a.client_id in #{clientIds}
|
|
</if>
|
|
</if>
|
|
<if test="equipmentId != null and equipmentId !=''">
|
|
<if test="equipmentId != null and equipmentId !=''">
|
|
@@ -189,11 +189,11 @@
|
|
<!-- 月统计 -->
|
|
<!-- 月统计 -->
|
|
<select id="getMonthStatistics" resultMap="chartBean" parameterType="com.szwl.model.query.StatisticsParam">
|
|
<select id="getMonthStatistics" resultMap="chartBean" parameterType="com.szwl.model.query.StatisticsParam">
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
- select DATE_FORMAT( a.create_date,'%m月%d') as categorie,count(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
|
|
|
|
+ select DATE_FORMAT( a.create_date,'%m月%d') as categorie,sum(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
from t_order a where a.status='1' -- 支付成功
|
|
from t_order a where a.status='1' -- 支付成功
|
|
</if>
|
|
</if>
|
|
<if test="ifForeign != null and ifForeign ==1"> -- 国外用户
|
|
<if test="ifForeign != null and ifForeign ==1"> -- 国外用户
|
|
- select DATE_FORMAT( a.pay_date,'%m月%d') as categorie,count(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
|
|
|
|
+ select DATE_FORMAT( a.pay_date,'%m月%d') as categorie,sum(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
from t_coin_order a where 1=1
|
|
from t_coin_order a where 1=1
|
|
</if>
|
|
</if>
|
|
<if test="adminId != null and adminId !=''">
|
|
<if test="adminId != null and adminId !=''">
|
|
@@ -208,7 +208,7 @@
|
|
<if test="adminIds != null and adminIds !=''">
|
|
<if test="adminIds != null and adminIds !=''">
|
|
and a.admin_id in #{adminIds}
|
|
and a.admin_id in #{adminIds}
|
|
</if>
|
|
</if>
|
|
- <if test="ifForeign != null and ifForeign ==1 and clientIds.size()>0">
|
|
|
|
|
|
+ <if test="ifForeign != null and ifForeign ==1 and clientIds != null and clientIds.size()>0">
|
|
and a.client_id in #{clientIds}
|
|
and a.client_id in #{clientIds}
|
|
</if>
|
|
</if>
|
|
<if test="equipmentId != null and equipmentId !=''">
|
|
<if test="equipmentId != null and equipmentId !=''">
|
|
@@ -251,11 +251,11 @@
|
|
select '12月' as categorie from dual) tab1
|
|
select '12月' as categorie from dual) tab1
|
|
left join (
|
|
left join (
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
- select concat(DATE_FORMAT( a.create_date,'%m'),'月') as categorie,count(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
|
|
|
|
+ select concat(DATE_FORMAT( a.create_date,'%m'),'月') as categorie,sum(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
from t_order a where a.status='1' -- 支付成功
|
|
from t_order a where a.status='1' -- 支付成功
|
|
</if>
|
|
</if>
|
|
<if test="ifForeign != null and ifForeign ==1"> -- 国外用户
|
|
<if test="ifForeign != null and ifForeign ==1"> -- 国外用户
|
|
- select concat(DATE_FORMAT( a.pay_date,'%m'),'月') as categorie,count(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
|
|
|
|
+ select concat(DATE_FORMAT( a.pay_date,'%m'),'月') as categorie,sum(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
from t_coin_order a where 1=1
|
|
from t_coin_order a where 1=1
|
|
</if>
|
|
</if>
|
|
<if test="adminId != null and adminId !=''">
|
|
<if test="adminId != null and adminId !=''">
|
|
@@ -270,7 +270,7 @@
|
|
<if test="adminIds != null and adminIds !=''">
|
|
<if test="adminIds != null and adminIds !=''">
|
|
and a.admin_id in #{adminIds}
|
|
and a.admin_id in #{adminIds}
|
|
</if>
|
|
</if>
|
|
- <if test="ifForeign != null and ifForeign ==1 and clientIds.size()>0">
|
|
|
|
|
|
+ <if test="ifForeign != null and ifForeign ==1 and clientIds != null and clientIds.size()>0">
|
|
and a.client_id in #{clientIds}
|
|
and a.client_id in #{clientIds}
|
|
</if>
|
|
</if>
|
|
<if test="equipmentId != null and equipmentId !=''">
|
|
<if test="equipmentId != null and equipmentId !=''">
|
|
@@ -298,7 +298,7 @@
|
|
</select>
|
|
</select>
|
|
<!-- 统计 机器花型销售排行-->
|
|
<!-- 统计 机器花型销售排行-->
|
|
<select id="getProductNameStatistics" resultType="com.szwl.model.bean.ChartBean">
|
|
<select id="getProductNameStatistics" resultType="com.szwl.model.bean.ChartBean">
|
|
- select product_name as categorie,count(a.product_number) as saleNum,sum(a.price) as salePrice
|
|
|
|
|
|
+ select product_name as categorie,sum(a.product_number) as saleNum,sum(a.price) as salePrice
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
from t_order a
|
|
from t_order a
|
|
where a.status='1'
|
|
where a.status='1'
|
|
@@ -320,7 +320,7 @@
|
|
</select>
|
|
</select>
|
|
<!-- 统计 机器销售排行-->
|
|
<!-- 统计 机器销售排行-->
|
|
<select id="getEquipmentStatistics" resultType="com.szwl.model.bean.ChartBean">
|
|
<select id="getEquipmentStatistics" resultType="com.szwl.model.bean.ChartBean">
|
|
- select a.client_id as categorie,count(a.product_number) as saleNum,sum(a.price) as salePrice
|
|
|
|
|
|
+ select a.client_id as categorie,sum(a.product_number) as saleNum,sum(a.price) as salePrice
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
from t_order a
|
|
from t_order a
|
|
where a.status='1'
|
|
where a.status='1'
|