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

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

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

           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>
    ```
相关推荐
叶 落13 天前
Ruoyi Cloud 本地启动
微服务·部署·ruoyi
·云扬·1 个月前
RuoYi-Vue源码阅读(三):用户相关模块
java·前端·vue.js·ruoyi
叶 落3 个月前
k8s 部署 ruoyi 前后端分离项目
云原生·容器·kubernetes·k8s·ruoyi
宁波阿成3 个月前
基于若依的ruoyi-nbcio流程管理系统增加所有任务功能(一)
java·ruoyi·flowable·ruoyi-nbcio
_果果然3 个月前
Springboot(若依)国际化配置接口访问后返回????????
java·spring boot·后端·ruoyi
๑҉ 晴天4 个月前
若依框架代码生成器详解:从入门到高级定制
java·ruoyi
wutonglamp4 个月前
若依实现路由跳转功能 动态路由获取参数
前端·vue.js·ruoyi·路由
爱吃鱼的cc4 个月前
工器具管理(基于若依)
spring boot·mybatis·ruoyi
码农研究僧4 个月前
Vue3的CRUD模版(附Demo)
vue3·ruoyi·crud