您现在的位置是:首页 >技术交流 >TDengine数据库与Mybatis-plus 多租户屏蔽网站首页技术交流
TDengine数据库与Mybatis-plus 多租户屏蔽
使用TDengine时序数据库特有的查询:
select sum(gen_power_total) gen_power_totals,last(ts) xdate
from power.device_0123456
where ts >='2023-05-16 08:53:05' and ts <= '2023-05-17 08:53:05'
interval(1h) ;
错误提示:
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "interval" "INTERV"
解决方法:
在dao或者mapper的方式上增加注解:@InterceptorIgnore(tenantLine = "true")
/**
* 根据设备编号查询
* @param stationId 电站编号
* @return
*/
@InterceptorIgnore(tenantLine = "true")
List<PowerDeviceDataApiVo> deviceRealTimesData(@Param("stationId") String stationId, @Param("yesterDate") Date yesterDate, @Param("nowDate") Date nowDate);
--------------------------------------------------------------------------------------------------------------------------------
mybatis-plus 多租户屏蔽某个特定mapper的方法@InterceptorIgnore
背景
项目中使用了mybatis plus多租户插件,再与数据交换过程中,每个sql都会加上租户的条件。
但是某些特定sql不需要加租户条件过滤
@InterceptorIgnore使用
多租户屏蔽某个特定mapper的方法,则在特定mapper方法上加注解:@InterceptorIgnore(tenantLine = "true")
@InterceptorIgnore的其他用法

各属性返回 true 表示不走插件(在配置了插件的情况下,不填则默认表示 false)





U8W/U8W-Mini使用与常见问题解决
QT多线程的5种用法,通过使用线程解决UI主界面的耗时操作代码,防止界面卡死。...
stm32使用HAL库配置串口中断收发数据(保姆级教程)
分享几个国内免费的ChatGPT镜像网址(亲测有效)
Allegro16.6差分等长设置及走线总结