Closed zhangle1 closed 2 months ago
日志中打印的sql是什么
start_time 字段类型是什么
@Comment("开始时间")
@Column(name = "start_time")
@Schema(description = "开始时间")
private Timestamp start_time;
@Comment("结束时间")
@Column(name = "end_time")
@Schema(description = "结束时间")
private Timestamp end_time; 类型是这个
WITH today_device_state AS (SELECT device_code, MIN(start_time) AS "today_start_timeb", MAX(start_time) AS "today_last_timeb" FROM jetlinks.g_device_state WHERE start_time = CURRENT_DATE GROUP BY device_code) SELECT count(1) as _total FROM jetlinks.dev_device_instance h LEFT JOIN today_device_state t ON h.id = t.device_code WHERE ( ( t."today_start_timeb" > '2024-06-12 13:09:24' ) )
这是报错之前控制台输出的最后一个sql io.r2dbc.postgresql.ExceptionFactory$PostgresqlBadGrammarException: 操作符不存在: timestamp without time zone > character varying ,在数据库客户端里这段sql能正常执行
today_start_timeb 呢 ? 字段类型建议改成 Long 或者 Date试试呢?
today_start_timeb 这个数据库里不存在的
with 里的表 对接给前端用的
@Comment("开始时间") @Column(name = "start_time") @Schema(description = "开始时间") private Timestamp start_time; 实际的类型就是这个
java里类型改成Long试试
前端传参
java代码方面
sql
报错
我希望能使用高级查询去对左连接的表进行关联 ,还是我哪里弄错了