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

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

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

复制代码
           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>
    ```
相关推荐
说给风听.2 天前
若依框架验证码关闭 + Redis 适配避坑指南
ruoyi
Tao____14 天前
JAVA开源物联网平台
java·物联网·mqtt·开源·ruoyi
码农研究僧14 天前
ruoyi+vue2的前端Demo(不分页、前端分页、后端分页)
前端·vue2·ruoyi
Tim_Van23 天前
彻底解决:80 端口 GET/POST 正常,PUT 却报 ERR_CONNECTION_RESET?
java·vue.js·spring boot·ruoyi·若依
kkoral1 个月前
RuoYi AI 框架部署操作指南
java·ai·ruoyi
木童6621 个月前
若依管理系统部署文档
docker·ruoyi
SomUrim1 个月前
ruoyi-vue-plus中await axios报错undefined的问题(请求正常)
前端·ruoyi
xrl20122 个月前
ruoyi-vue2集成flowable6.7.2后端篇
数据库·ruoyi·flowable·工作流集成
undsky_2 个月前
【RuoYi-SpringBoot3-Pro】:接入 AI 对话能力
人工智能·spring boot·后端·ai·ruoyi
气π2 个月前
【JavaWeb】——(若依 + AI)-基础学习笔记
java·spring boot·笔记·学习·java-ee·mybatis·ruoyi