From 4e837c1e8c6f8a7252fb95776a1530ab737bb684 Mon Sep 17 00:00:00 2001
From: wang-hao-jie <1550036656@qq.com>
Date: 星期一, 06 六月 2022 15:32:42 +0800
Subject: [PATCH] 最新版本
---
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/EventLogMapper.java | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/EventLogMapper.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/EventLogMapper.java
index b4dd248..585a710 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/EventLogMapper.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/EventLogMapper.java
@@ -1,7 +1,10 @@
package cn.exrick.xboot.your.mapper;
+import cn.exrick.xboot.your.vo.Month;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.exrick.xboot.your.entity.EventLog;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
import java.util.List;
@@ -11,4 +14,20 @@
*/
public interface EventLogMapper extends BaseMapper<EventLog> {
+ @Select("select \n" +
+ "sum(case month(create_time) when '1' then 1 else 0 end) as january,\n" +
+ "sum(case month(create_time) when '2' then 1 else 0 end) as february,\n" +
+ "sum(case month(create_time) when '3' then 1 else 0 end) as march,\n" +
+ "sum(case month(create_time) when '4' then 1 else 0 end) as april,\n" +
+ "sum(case month(create_time) when '5' then 1 else 0 end) as may,\n" +
+ "sum(case month(create_time) when '6' then 1 else 0 end) as june,\n" +
+ "sum(case month(create_time) when '7' then 1 else 0 end) as july,\n" +
+ "sum(case month(create_time) when '8' then 1 else 0 end) as august,\n" +
+ "sum(case month(create_time) when '9' then 1 else 0 end) as september,\n" +
+ "sum(case month(create_time) when '10' then 1 else 0 end) as october,\n" +
+ "sum(case month(create_time) when '11' then 1 else 0 end) as november,\n" +
+ "sum(case month(create_time) when '12' then 1 else 0 end) as december\n" +
+ "from t_event_log e\n" +
+ "where year(create_time)=#{year} and type=#{type}")
+ Month getEventNum(@Param("year")int year,@Param("type")int type);
}
\ No newline at end of file
--
Gitblit v1.9.1