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

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

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

复制代码
           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>
    ```
相关推荐
码银16 天前
在若依框架中,使用easyExcel完成动态列导出
java·excel·ruoyi
AI产品实战16 天前
95coder一句话生成MOM系统,AI用时6分50秒,Token只消耗25107
vue.js·spring boot·ai编程·ruoyi
gdhz-xwx20 天前
RuoYi-Vue-Plus,前端VXE TABLE V4.13.7
ruoyi
RuoyiOffice1 个月前
2026 年开源 BPM/工作流引擎大盘点:Flowable vs Camunda vs Activiti vs Turbo——谁才是企业级首选?
java·spring boot·后端·开源·流程图·ruoyi·anti-design-vue
RuoyiOffice1 个月前
SpringBoot+Vue3 实现 OA 公文外来文与归档台账:外部收文、BPM办理、三类公文统一归档
spring boot·微服务·uni-app·vue·ruoyi·anti-design-vue·ruoyioffice
Nick_zcy1 个月前
小说在线阅读网站和小说管理系统 · 功能全解析
java·后端·python·springboot·ruoyi
天籁晴空1 个月前
Docker Compose 部署完整指南 -- RuoYi-Vue
docker·ruoyi
向葭奔赴♡2 个月前
若依AES加密
ruoyi
程序员小崔日记2 个月前
技术之外,皆是人间
后端·ruoyi·计算机温情
伍一512 个月前
RuoYi + H2 数据库:轻量部署实战踩坑全记录
h2·ruoyi·若依