|
@@ -745,6 +745,7 @@
|
|
|
<select id="getMainStatistics" resultMap="chartBean">
|
|
|
select 'day' as categorie, count(1) as saleNum,ifnull(sum(a.price),0) as salePrice from t_order a
|
|
|
where date_format(a.create_date,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
|
|
|
+ and a.status='1'
|
|
|
<if test="adminId != null and adminId !=''">
|
|
|
and a.admin_id= #{adminId} -- 所属商家id
|
|
|
</if>
|
|
@@ -754,6 +755,7 @@ where date_format(a.create_date,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
|
|
|
UNION all
|
|
|
select 'week' as categorie, count(1) as saleNum,ifnull(sum(a.price),0) as salePrice from t_order a
|
|
|
where YEARWEEK(date_format(a.create_date,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
|
|
|
+ and a.status='1'
|
|
|
<if test="adminId != null and adminId !=''">
|
|
|
and a.admin_id= #{adminId} -- 所属商家id
|
|
|
</if>
|
|
@@ -763,6 +765,7 @@ where YEARWEEK(date_format(a.create_date,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
|
|
|
UNION all
|
|
|
select 'month' as categorie, count(1) as saleNum,ifnull(sum(a.price),0) as salePrice from t_order a
|
|
|
where date_format(a.create_date,'%Y-%m') = date_format(now(),'%Y-%m')
|
|
|
+ and a.status='1'
|
|
|
<if test="adminId != null and adminId !=''">
|
|
|
and a.admin_id= #{adminId} -- 所属商家id
|
|
|
</if>
|
|
@@ -772,6 +775,7 @@ where date_format(a.create_date,'%Y-%m') = date_format(now(),'%Y-%m')
|
|
|
UNION all
|
|
|
select 'year' as categorie, count(1) as saleNum,ifnull(sum(a.price),0) as salePrice from t_order a
|
|
|
where date_format(a.create_date,'%Y') = date_format(now(),'%Y')
|
|
|
+ and a.status='1'
|
|
|
<if test="adminId != null and adminId !=''">
|
|
|
and a.admin_id= #{adminId} -- 所属商家id
|
|
|
</if>
|