count语句错误的截取了from关键字
Opened this issue · 0 comments
dorea commented
方法和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