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

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

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

复制代码
           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>
    ```
相关推荐
RuoyiOffice2 天前
2026 年开源 BPM/工作流引擎大盘点:Flowable vs Camunda vs Activiti vs Turbo——谁才是企业级首选?
java·spring boot·后端·开源·流程图·ruoyi·anti-design-vue
RuoyiOffice2 天前
SpringBoot+Vue3 实现 OA 公文外来文与归档台账:外部收文、BPM办理、三类公文统一归档
spring boot·微服务·uni-app·vue·ruoyi·anti-design-vue·ruoyioffice
Nick_zcy7 天前
小说在线阅读网站和小说管理系统 · 功能全解析
java·后端·python·springboot·ruoyi
天籁晴空11 天前
Docker Compose 部署完整指南 -- RuoYi-Vue
docker·ruoyi
向葭奔赴♡20 天前
若依AES加密
ruoyi
程序员小崔日记24 天前
技术之外,皆是人间
后端·ruoyi·计算机温情
伍一511 个月前
RuoYi + H2 数据库:轻量部署实战踩坑全记录
h2·ruoyi·若依
清寒一缕震丝魂1 个月前
个人原创自定义计算公式组件可继续扩展
javascript·vue.js·elementui·ruoyi
RuoyiOffice1 个月前
企业请假销假系统设计实战:一张表、一套流程、两段生命周期——BPM节点驱动的表单变形术
java·spring·uni-app·vue·产品运营·ruoyi·anti-design-vue
RuoyiOffice1 个月前
SpringBoot+Vue3+Uniapp实现PC+APP双端考勤打卡设计:GPS围栏/内网双模打卡、节假日方案、定时预生成——附数据结构和核心源码讲解
java·spring·小程序·uni-app·vue·产品运营·ruoyi