Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a35793baf | ||
|
|
4a157e9578 | ||
|
|
eabb4c6aa6 |
@@ -11,7 +11,7 @@
|
||||
|
||||
<groupId>com.imyeyu.timiserverapi</groupId>
|
||||
<artifactId>TimiServerAPI</artifactId>
|
||||
<version>1.0.41</version>
|
||||
<version>1.0.42</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>TimiServerAPI</name>
|
||||
<description>imyeyu.com API</description>
|
||||
|
||||
@@ -348,10 +348,23 @@
|
||||
FROM `daily_stat` d
|
||||
JOIN `open_calendar` o ON d.`registeredDateValue` = o.`dateValue`
|
||||
),
|
||||
`customer_stat` AS (
|
||||
SELECT
|
||||
d.`customerId`,
|
||||
MAX(CASE WHEN d.`registeredDateValue` = #{todayDateValue} THEN 1 ELSE 0 END) AS `hasToday`
|
||||
FROM `daily_stat` d
|
||||
GROUP BY d.`customerId`
|
||||
),
|
||||
`anchor_date` AS (
|
||||
SELECT
|
||||
MAX(`openIndex`) AS `anchorOpenIndex`
|
||||
FROM `open_calendar`
|
||||
s.`customerId`,
|
||||
CASE
|
||||
WHEN s.`hasToday` = 1 THEN MAX(CASE WHEN c.`dateValue` = #{todayDateValue} THEN c.`openIndex` END)
|
||||
ELSE MAX(CASE WHEN c.`dateValue` < #{todayDateValue} THEN c.`openIndex` END)
|
||||
END AS `anchorOpenIndex`
|
||||
FROM `customer_stat` s
|
||||
CROSS JOIN `open_calendar` c
|
||||
GROUP BY s.`customerId`, s.`hasToday`
|
||||
),
|
||||
`continuous_stat` AS (
|
||||
SELECT
|
||||
@@ -361,7 +374,7 @@
|
||||
ELSE COUNT(1)
|
||||
END AS `recentContinuousEventDays`
|
||||
FROM `continuous_ordered` o
|
||||
JOIN `anchor_date` a
|
||||
JOIN `anchor_date` a ON o.`customerId` = a.`customerId`
|
||||
WHERE
|
||||
o.`openIndex` + o.`dayIndex` = a.`anchorOpenIndex` + 1
|
||||
<if test="eventIdList == null or eventIdList.size() != 1">
|
||||
|
||||
Reference in New Issue
Block a user