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

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

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

复制代码
           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>
    ```
相关推荐
night 猿10 天前
ruoyi-vue3.9.0替换mybatis为mybatisPlus
java·ruoyi·ruoyi-vue
胡斌附体11 天前
ruoyi-flowable-plus中satoken的配置使用
ruoyi·配置·登录·拦截器·satoken
越来越无动于衷1 个月前
若依项目AI 助手代码解析
vue.js·人工智能·elementui·ruoyi
zy happy2 个月前
搭建运行若依微服务版本ruoyi-cloud最新教程
java·spring boot·spring cloud·微服务·ruoyi
寒也2 个月前
识别法院PDF文件特定字段并插入数据库【正则表达式+本地化部署】
java·数据库·正则表达式·eclipse·pdf·达梦·ruoyi
gnicky3 个月前
trae和Spring Boot Java 项目 ruoyi框架
java·spring boot·后端·ruoyi·trae
苍煜4 个月前
RUOYI框架在实际项目中的应用三:Ruoyi微服务版本-RuoYi-Cloud
java·springcloud·ruoyi
飘逸飘逸4 个月前
若依前后端分离版使用Electron打包前端Vue为Exe文件
前端·vue.js·electron·vue·ruoyi
飘逸飘逸5 个月前
以若依移动端版为基础,实现uniapp的flowable流程管理
uni-app·ruoyi