Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

count语句错误的截取了from关键字 #76

Open
dorea opened this issue Feb 2, 2023 · 0 comments
Open

count语句错误的截取了from关键字 #76

dorea opened this issue Feb 2, 2023 · 0 comments

Comments

@dorea
Copy link

dorea commented Feb 2, 2023

方法和hibernate输出如下, 当查询语句的字段中有from的时候, count语句就生成错了
第二行的count语句将TU.TW_WEEK_FROM当做了from关键字

@QueryFenix(resultType = TimeWindowDfVo.class, resultTransformer = UnderscoreTransformer.class, nativeQuery = true)
Page<TimeWindowDfVo> findUnPointData(@Param("qv") TimeWindowQueryVo qv, Pageable page);
Hibernate: SELECT TU.TW_GROUP, TU.ACTIVE, TU.TW_WEEK_FROM, TU.UNPOINT_ID, TU.HOUR_START, TU.MIN_START, TU.HOUR_END, TU.MIN_END, UD.TYPE, UD.NAME AS UNLOAD_DOOR_NAME, UD.PLANT_NO, TU.CREATE_TIME FROM TM_TIMEWINDOW_UNPOINT TU LEFT JOIN TM_UNPOINT_DOOR UD ON UD.ID = TU.UNPOINT_ID WHERE TU.DELETE_MARK = 'N' limit ?
Hibernate: select count(*) as count from , TU.UNPOINT_ID, TU.HOUR_START, TU.MIN_START, TU.HOUR_END, TU.MIN_END, UD.TYPE, UD.NAME AS UNLOAD_DOOR_NAME, UD.PLANT_NO, TU.CREATE_TIME FROM TM_TIMEWINDOW_UNPOINT TU LEFT JOIN TM_UNPOINT_DOOR UD ON UD.ID = TU.UNPOINT_ID WHERE TU.DELETE_MARK = 'N'
2023-02-02 15:47:14  WARN [http-nio-8873-exec-3] Caller+0	 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.logExceptions(SqlExceptionHelper.java:137)
 - SQL Error: 1064, SQLState: 42000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant