【若依框架】按时间查询数据的操作

【若依框架】按时间查询数据的操作

若依框架按起止时间查询数据示例:

复制代码
           Date tempDate = DateUtil.offsetDay(new Date(), -days);
           Map<String, Object> map = new HashMap<>();
           map.put("beginRecordTime", DateUtil.beginOfHour(tempDate));
           map.put("endRecordTime", new Date());
		   daMeter.setParams(map);	
		   List<DaMeter> resultList = daMeterService.selectDaMeterList(daMeter);

mybatis

复制代码
    <select id="selectDaMeterList" parameterType="DaMeter" resultMap="DaMeterResult">
        <include refid="selectDaMeterVo"/>
        <where>
            <if test="devId != null">
                and dev_id = #{devId}
            </if>
            <if test="params.beginRecordTime != null  and params.endRecordTime != null ">
                and record_time between #{params.beginRecordTime} and #{params.endRecordTime}
            </if>
        </where>
        order by record_time
    </select>
    ```
相关推荐
木童6622 天前
若依管理系统部署文档
docker·ruoyi
SomUrim3 天前
ruoyi-vue-plus中await axios报错undefined的问题(请求正常)
前端·ruoyi
xrl201212 天前
ruoyi-vue2集成flowable6.7.2后端篇
数据库·ruoyi·flowable·工作流集成
undsky_15 天前
【RuoYi-SpringBoot3-Pro】:接入 AI 对话能力
人工智能·spring boot·后端·ai·ruoyi
气π17 天前
【JavaWeb】——(若依 + AI)-基础学习笔记
java·spring boot·笔记·学习·java-ee·mybatis·ruoyi
Tao____21 天前
基于若依RuoYi框架开发的物联网平台
java·物联网·mqtt·ruoyi·设备对接
Z3r4y1 个月前
【代码审计】RuoYi-4.7.1&4.8.1 Thymeleaf模板注入分析
java·web安全·ruoyi·代码审计·thymeleaf
inferno1 个月前
若依框架(前后端分离版)开发环境搭建步骤
系统架构·ruoyi
向葭奔赴♡1 个月前
若依系统权限控制全流程解析
前端·javascript·vue.js·ruoyi·navicat
humors2212 个月前
前端开发案例(不定期更新)
前端·vue.js·elementui·ruoyi·若依