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

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

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

复制代码
           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>
    ```
相关推荐
伍一519 天前
RuoYi + H2 数据库:轻量部署实战踩坑全记录
h2·ruoyi·若依
清寒一缕震丝魂11 天前
个人原创自定义计算公式组件可继续扩展
javascript·vue.js·elementui·ruoyi
RuoyiOffice14 天前
企业请假销假系统设计实战:一张表、一套流程、两段生命周期——BPM节点驱动的表单变形术
java·spring·uni-app·vue·产品运营·ruoyi·anti-design-vue
RuoyiOffice14 天前
SpringBoot+Vue3+Uniapp实现PC+APP双端考勤打卡设计:GPS围栏/内网双模打卡、节假日方案、定时预生成——附数据结构和核心源码讲解
java·spring·小程序·uni-app·vue·产品运营·ruoyi
陈晓明start22 天前
【ruoyi】部署笔记
ruoyi
狂龙骄子1 个月前
如何修改ElementUI表单与表格标签label样式
elementui·vue·ruoyi·el-form-item·el-table-column·表单项label·列表头label
狂龙骄子2 个月前
RuoYi-Vue字典标签CSS样式自定义指南
css·前端框架·ruoyi·数据字典·若依·字典标签·样式属性
说给风听.2 个月前
若依框架验证码关闭 + Redis 适配避坑指南
ruoyi
Tao____3 个月前
JAVA开源物联网平台
java·物联网·mqtt·开源·ruoyi
码农研究僧3 个月前
ruoyi+vue2的前端Demo(不分页、前端分页、后端分页)
前端·vue2·ruoyi