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

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

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

复制代码
           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>
    ```
相关推荐
AI开源软件2 天前
SpringBoot + Vue3 人力资源管理系统推荐:组织、档案与移动办公
vue3·springboot·ruoyi·oa系统·移动办公·人力资源管理系统·hrm
clz13145217 天前
RuoYi-Cloud 新建微服务并实现服务间调用(OpenFeign 实战)
java·ruoyi
深漂的华哥2 个月前
Ruoyi-Vue-Plus(V5.6.2) 开发环境搭建
java·前端·spring boot·后端·spring·ruoyi
深漂的华哥2 个月前
Ruoyi-Plus前后端分离场景下,数据加密传输
java·spring boot·后端·开源·maven·ruoyi
伍一512 个月前
03-文件管理模块-一个看似简单的模块藏着多少细节
java·ruoyi·若依
雪芽蓝域zzs3 个月前
Ruoyi 前端Vue3不使用网络本地数据示例
ruoyi
xrl20124 个月前
若依工作流主流方案对接
ruoyi·camunda·ruoyiflow
AI产品实战4 个月前
Ruoyi-Vue+WarmFlow实现三级加急审批
ruoyi
码银5 个月前
在若依框架中,使用easyExcel完成动态列导出
java·excel·ruoyi
AI产品实战5 个月前
95coder一句话生成MOM系统,AI用时6分50秒,Token只消耗25107
vue.js·spring boot·ai编程·ruoyi