嗨,我的HQL查询就是这样。
@Query("select A.TheaterName as theater,A.MovieName as movie,CAST(A.ShowDateTime as showDate)" +
"(select sum(TicketPrice) from ccmsfdb2.HallApi.TicketTransaction where \n" +
"CAST(ShowDateTime as date)=CAST(A.ShowDateTime as Date) AND\n" +
" MovieName=A.MovieName and TheaterName=A.TheaterName and TicketStatusValue=1) as collection\n" +
"from CCMSFDB2.HallApi.TicketTransaction A where A.MovieName='Sanju' \n" +
"and A.TheaterName='QFX Jai Nepal' \n" +
"group by CAST(A.ShowDateTime as date),A.TheaterName,A.MovieName,CAST(A.ShowDateTime as Date) order by showDate DESC")
List<MovieCollectionAccordingToTheaaterDto> getMovieCollectionAccordingToTheater();\
In the above query ,I have tried to cast showdatetime as date and sum the gross collection according to date.BUt cast is not supporting
在hql中,我不想使用本机查询。