Mysql,Mybatis做时间过滤报表:日周月统计
来源:互联网 发布:海康网络摄像机维修 编辑:程序博客网 时间:2024/06/02 05:24
声明:classType------0:今日,1:周,2:月,3:自定义,4:最近七天
<choose> <when test="classType == 1"> AND DATE_FORMAT(s.create_time,'%Y%u') = DATE_FORMAT(CURDATE( ),'%Y%u') </when> <when test="classType == 2"> AND DATE_FORMAT(s.create_time,'%Y%m') = DATE_FORMAT(CURDATE( ),'%Y%m') </when> <when test="classType == 3"> <choose> <when test="beginTime!=null and beginTime!='' and endTime == '' "> AND Date(s.create_time) between #{beginTime,jdbcType=VARCHAR} and CURDATE() </when> <when test="endTime!=null and endTime!='' and beginTime == '' "> AND Date(s.create_time) <= #{endTime,jdbcType=VARCHAR} </when> <when test="beginTime!=null and beginTime!='' and endTime!=null and endTime!= '' "> AND Date(s.create_time) between #{beginTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR} </when> <otherwise> AND Date(s.create_time) = CURDATE() </otherwise> </choose> </when> <when test="classType == 4"> AND date(s.create_time) between date_sub(curdate(), INTERVAL 6 DAY) and curdate() </when> <otherwise> AND Date(s.create_time) = CURDATE() </otherwise> </choose>
阅读全文
1 0
- Mysql,Mybatis做时间过滤报表:日周月统计
- 使用highChart做报表统计
- SQL语句做报表统计
- SQL SERVER 报表统计(根据时间)如当天、昨日、本周、上周、本月、上月、同期等时间过滤
- php+mysql 生成统计报表
- php+mysql 生成统计报表
- 做报表统计的几点收获
- mysql做报表必知
- sql查询做的报表实现自定义过滤和排序
- Mysql 根据时间戳按年月日分组统计(做个收藏)
- MySQL 使用GROUP_CONCAT实现统计报表
- MYSQL单表中各记录总和统计 适用于报表
- 水晶报表 分类统计之分组钻取、子报表、数据过滤三箭齐发
- mysql 时间格式 累加统计
- Mysql对时间的统计
- statpot:使用mongo+bootstrap+highcharts做统计报表
- mysql利用mybatis查时间
- Oracle时间处理和报表分时段统计
- 《Spring Boot开发:从0到1》第13章 常见问题与解决方案
- 关于百度COR文字识别JAVA服务器端设置
- 读《JavaScript 标准参考教程(alpha)阮一峰》(中)
- 《Spring Boot开发:从0到1》第11章 Spring Boot应用监控
- 《Spring Boot开发:从0到1》第12章 Spring Boot与微服务
- Mysql,Mybatis做时间过滤报表:日周月统计
- 【LintCode】2、尾部的零
- hadoop实战随笔_0718
- 《Spring Boot开发:从0到1》第10章 Spring Boot应用部署运维
- 本地代码用git同步到GitHub中
- 《Spring Boot开发:从0到1》全书目录结构
- 第1章 Spring Boot史前简述
- 第2章 Spring Boot简介
- React-Mirror