|
@@ -613,7 +613,7 @@
|
|
|
</select>
|
|
|
<select id="selectViewsAndOrdersBetweenDays"
|
|
|
resultType="com.hywa.orderclient.forms.ViewsAndOrdersRep">
|
|
|
- select b.tempDate time,ifnull(c.cnt,0) views,ifnull(d.cnt,0) orders from (SELECT DATE_FORMAT(DATE_SUB(str_to_date(#{endTime},"%Y-%m-%d"),INTERVAL a.id-1 DAY),'%Y-%m-%d') tempDate
|
|
|
+ select b.tempDate time,ifnull(c.cnt,0) views,ifnull(d.cnt,0) orders from (SELECT DATE_FORMAT(DATE_SUB(str_to_date(#{endTime},"%Y-%m-%d"),INTERVAL CAST(a.id AS SIGNED)-1 DAY),'%Y-%m-%d') tempDate
|
|
|
FROM (SELECT help_category_id id
|
|
|
FROM mysql.help_category
|
|
|
ORDER BY help_category_id LIMIT #{recentDays}) a) b left join
|
|
@@ -636,7 +636,7 @@
|
|
|
<select id="selectViewsAndOrdersBetweenHours"
|
|
|
resultType="com.hywa.orderclient.forms.ViewsAndOrdersRep">
|
|
|
select a.id time,ifnull(b.cnt,0) orders,ifnull(c.cnt,0) views from(
|
|
|
- SELECT (help_category_id-1) id
|
|
|
+ SELECT (CAST(help_category_id AS SIGNED) -1) id
|
|
|
FROM mysql.help_category
|
|
|
ORDER BY help_category_id
|
|
|
LIMIT 24) a left join
|
|
@@ -656,7 +656,7 @@
|
|
|
</select>
|
|
|
<select id="selectViewsAndOrdersRecentDays"
|
|
|
resultType="com.hywa.orderclient.forms.ViewsAndOrdersRep">
|
|
|
- select b.tempDate time,ifnull(c.cnt,0) views,ifnull(d.cnt,0) orders from (SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL a.id-1 DAY),'%Y-%m-%d') tempDate
|
|
|
+ select b.tempDate time,ifnull(c.cnt,0) views,ifnull(d.cnt,0) orders from (SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL CAST(a.id AS SIGNED)-1 DAY),'%Y-%m-%d') tempDate
|
|
|
FROM (SELECT help_category_id id
|
|
|
FROM mysql.help_category
|
|
|
ORDER BY help_category_id LIMIT #{recentDays}) a) b left join
|
|
@@ -770,7 +770,7 @@
|
|
|
|
|
|
<select id="selectOrdersNumberRecentDays" resultType="com.hywa.orderclient.forms.OrderNumberStatisticForm">
|
|
|
select b.tempDate time, ifnull(l.cnt,0) orders
|
|
|
- from (SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL a.id-1 DAY),'%Y-%m-%d') tempDate FROM (SELECT help_category_id id FROM mysql.help_category ORDER BY help_category_id LIMIT #{recentDays}) a) b
|
|
|
+ from (SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL CAST(a.id AS SIGNED)-1 DAY),'%Y-%m-%d') tempDate FROM (SELECT help_category_id id FROM mysql.help_category ORDER BY help_category_id LIMIT #{recentDays}) a) b
|
|
|
left join (select date_format(o.pay_time,'%Y-%m-%d') payTime,count(distinct o.id) cnt
|
|
|
from t_bp_order_info o
|
|
|
where o.status != '0' and o.status != '4' and o.status is not null
|
|
@@ -793,7 +793,7 @@
|
|
|
|
|
|
<select id="selectOrdersNumberBetweenDays" resultType="com.hywa.orderclient.forms.OrderNumberStatisticForm">
|
|
|
select b.tempDate time, ifnull(l.cnt,0) orders
|
|
|
- from (SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL a.id-1 DAY),'%Y-%m-%d') tempDate FROM (SELECT help_category_id id FROM mysql.help_category ORDER BY help_category_id LIMIT 30) a) b
|
|
|
+ from (SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL CAST(a.id AS SIGNED)-1 DAY),'%Y-%m-%d') tempDate FROM (SELECT help_category_id id FROM mysql.help_category ORDER BY help_category_id LIMIT 30) a) b
|
|
|
left join (select date_format(o.pay_time,'%Y-%m-%d') payTime,count(distinct o.id) cnt
|
|
|
from t_bp_order_info o
|
|
|
where o.status != '0' and o.status != '4' and o.status is not null
|