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

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

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

复制代码
           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>
    ```
相关推荐
ss2733 天前
不用向量库,我用 MySQL 跑通了蔬菜 RAG--基于 RuoYi-AI 的蔬菜种植知识库 + 智能咨询系统,普通开发机就能跑
数据库·人工智能·智慧农业·ruoyi·知识库·rag
莫晓燚4 天前
阿里云若依项目部署与日志采集---实战
运维·数据库·redis·阿里云·ruoyi
莫晓燚5 天前
双机部署若依 (RuoYi‑Vue) 传统环境部署---实战
linux·运维·数据库·redis·mysql·nginx·ruoyi
AI开源软件13 天前
SpringBoot + Vue3 人力资源管理系统推荐:组织、档案与移动办公
vue3·springboot·ruoyi·oa系统·移动办公·人力资源管理系统·hrm
clz131452118 天前
RuoYi-Cloud 新建微服务并实现服务间调用(OpenFeign 实战)
java·ruoyi
深漂的华哥2 个月前
Ruoyi-Vue-Plus(V5.6.2) 开发环境搭建
java·前端·spring boot·后端·spring·ruoyi
深漂的华哥2 个月前
Ruoyi-Plus前后端分离场景下,数据加密传输
java·spring boot·后端·开源·maven·ruoyi
伍一513 个月前
03-文件管理模块-一个看似简单的模块藏着多少细节
java·ruoyi·若依
雪芽蓝域zzs3 个月前
Ruoyi 前端Vue3不使用网络本地数据示例
ruoyi
xrl20124 个月前
若依工作流主流方案对接
ruoyi·camunda·ruoyiflow