|
@@ -42,6 +42,7 @@
|
|
|
<result column="saleNum" jdbcType="FLOAT" property="saleNum" />
|
|
|
<!--<result column="salePrice" jdbcType="DECIMAL" property="salePrice" />-->
|
|
|
<result column="salePrice" jdbcType="FLOAT" property="salePrice" />
|
|
|
+ <result column="orderNum" jdbcType="FLOAT" property="orderNum" />
|
|
|
</resultMap>
|
|
|
<resultMap id="orderDaoChuDTO" type="com.szwl.model.bean.OrderDaoChuDTO">
|
|
|
<result column="username" jdbcType="VARCHAR" property="username" />
|
|
@@ -64,11 +65,11 @@
|
|
|
<!-- 日统计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">
|
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
|
- 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(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
|
from t_order a where a.status='1' -- 支付成功
|
|
|
</if>
|
|
|
<if test="ifForeign != null and ifForeign ==1"> -- 国外用户
|
|
|
- select concat(DATE_FORMAT( a.pay_date,'%H'),'点') as categorie,count(1) as saleNum,sum(a.price) as salePrice
|
|
|
+ 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
|
|
|
from t_coin_order a where 1=1
|
|
|
</if>
|
|
|
<if test="adminId != null and adminId !=''">
|
|
@@ -111,7 +112,7 @@
|
|
|
<!--group by DATE_FORMAT( a.create_date,'%H')-->
|
|
|
<!-- 周统计 -->
|
|
|
<select id="getWeekStatistics" resultMap="chartBean" parameterType="com.szwl.model.query.StatisticsParam">
|
|
|
- SELECT tab1.categorie,ifnull(tab2.saleNum,0) as saleNum,ifnull(tab2.salePrice,0) as salePrice from (
|
|
|
+ SELECT tab1.categorie,ifnull(tab2.saleNum,0) as saleNum,ifnull(tab2.orderNum,0) as orderNum,ifnull(tab2.salePrice,0) as salePrice from (
|
|
|
select '周1' as categorie from dual UNION all
|
|
|
select '周2' as categorie from dual UNION all
|
|
|
select '周3' as categorie from dual UNION all
|
|
@@ -124,12 +125,12 @@
|
|
|
-- count(1) as saleNum,sum(a.price) as salePrice
|
|
|
<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,
|
|
|
- count(1) as saleNum,sum(a.price) as salePrice
|
|
|
+ count(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
|
from t_order a where a.status='1' -- 支付成功
|
|
|
</if>
|
|
|
<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,
|
|
|
- count(1) as saleNum,sum(a.price) as salePrice
|
|
|
+ count(a.product_number) as saleNum,count(1) as orderNum,sum(a.price) as salePrice
|
|
|
from t_coin_order a where 1=1
|
|
|
</if>
|
|
|
<if test="adminId != null and adminId !=''">
|
|
@@ -175,11 +176,11 @@
|
|
|
<!-- 月统计 -->
|
|
|
<select id="getMonthStatistics" resultMap="chartBean" parameterType="com.szwl.model.query.StatisticsParam">
|
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
|
- select DATE_FORMAT( a.create_date,'%m月%d') as categorie,count(1) as saleNum,sum(a.price) as salePrice
|
|
|
+ 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
|
|
|
from t_order a where a.status='1' -- 支付成功
|
|
|
</if>
|
|
|
<if test="ifForeign != null and ifForeign ==1"> -- 国外用户
|
|
|
- select DATE_FORMAT( a.pay_date,'%m月%d') as categorie,count(1) as saleNum,sum(a.price) as salePrice
|
|
|
+ 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
|
|
|
from t_coin_order a where 1=1
|
|
|
</if>
|
|
|
<if test="adminId != null and adminId !=''">
|
|
@@ -222,7 +223,7 @@
|
|
|
|
|
|
<!-- 年统计 -->
|
|
|
<select id="getYearStatistics" resultMap="chartBean" parameterType="com.szwl.model.query.StatisticsParam">
|
|
|
- SELECT tab1.categorie,ifnull(tab2.saleNum,0) as saleNum,ifnull(tab2.salePrice,0) as salePrice from (
|
|
|
+ SELECT tab1.categorie,ifnull(tab2.saleNum,0) as saleNum,ifnull(tab2.orderNum,0) as orderNum,ifnull(tab2.salePrice,0) as salePrice from (
|
|
|
select '01月' as categorie from dual UNION all
|
|
|
select '02月' as categorie from dual UNION all
|
|
|
select '03月' as categorie from dual UNION all
|
|
@@ -237,11 +238,11 @@
|
|
|
select '12月' as categorie from dual) tab1
|
|
|
left join (
|
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
|
- select concat(DATE_FORMAT( a.create_date,'%m'),'月') as categorie,count(1) as saleNum,sum(a.price) as salePrice
|
|
|
+ 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
|
|
|
from t_order a where a.status='1' -- 支付成功
|
|
|
</if>
|
|
|
<if test="ifForeign != null and ifForeign ==1"> -- 国外用户
|
|
|
- select concat(DATE_FORMAT( a.pay_date,'%m'),'月') as categorie,count(1) as saleNum,sum(a.price) as salePrice
|
|
|
+ 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
|
|
|
from t_coin_order a where 1=1
|
|
|
</if>
|
|
|
<if test="adminId != null and adminId !=''">
|
|
@@ -284,7 +285,7 @@
|
|
|
</select>
|
|
|
<!-- 统计 机器花型销售排行-->
|
|
|
<select id="getProductNameStatistics" resultType="com.szwl.model.bean.ChartBean">
|
|
|
- select product_name as categorie,count(1) as saleNum,sum(a.price) as salePrice
|
|
|
+ select product_name as categorie,count(a.product_number) as saleNum,sum(a.price) as salePrice
|
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
|
from t_order a
|
|
|
where a.status='1'
|
|
@@ -306,7 +307,7 @@
|
|
|
</select>
|
|
|
<!-- 统计 机器销售排行-->
|
|
|
<select id="getEquipmentStatistics" resultType="com.szwl.model.bean.ChartBean">
|
|
|
- select a.client_id as categorie,count(1) as saleNum,sum(a.price) as salePrice
|
|
|
+ select a.client_id as categorie,count(a.product_number) as saleNum,sum(a.price) as salePrice
|
|
|
<if test="ifForeign != null and ifForeign ==0"> -- 国内用户
|
|
|
from t_order a
|
|
|
where a.status='1'
|