From fc4a9c601c0b01c6185b34a802f4b0c4a89cf7c9 Mon Sep 17 00:00:00 2001 From: VictoriaPresnyakova Date: Tue, 18 Apr 2023 11:47:29 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B0=D0=B1=D0=B0=D0=BB=D0=B4=D0=B5=D1=82?= =?UTF-8?q?=D1=8C=20=D1=81=D0=B4=D0=B0=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data.mv.db | Bin 0 -> 40960 bytes data.trace.db | 1112 +++++++++++++++++ .../repair/controller/ReportController.java | 31 + .../ru/ulstu/is/sbapp/repair/model/Favor.java | 2 +- .../ru/ulstu/is/sbapp/repair/model/Order.java | 2 +- .../is/sbapp/repair/model/Order_Favor.java | 14 +- .../repair/service/Order_FavorService.java | 23 +- 7 files changed, 1173 insertions(+), 11 deletions(-) create mode 100644 data.mv.db create mode 100644 data.trace.db create mode 100644 src/main/java/ru/ulstu/is/sbapp/repair/controller/ReportController.java diff --git a/data.mv.db b/data.mv.db new file mode 100644 index 0000000000000000000000000000000000000000..083b577513522bebac023227631f382e6ba0d4b4 GIT binary patch literal 40960 zcmeHQ%WoUU8DC12M9Z(ljvYG>cSGB;<5ZDhAcZ) z&=hXbOE0}Nr#8LxP@q8nh@hteNiPA?Ls9fkD0=I)v-8*;lDiaXQMS_#58R#E*_m&D zGdtgW`~7BSxg-~yt&aOi$->9hgU|dDkR++#-hZ+Uqy2)r<=fjOP;hsAd)N0$z%(q` z)11Hpg`l(Z(B6faJoR@TKj>_S>4PnQ*S+uWlzae`z*fPmz<(S8jsQo1Bft^h2yg^A z0vrL307rl$z!BgGyg~$)x&8kN(dR{T1ULd50geDifFr;W;0SO8I0762jsQpC9AC-&%9-fsfNCnvTpY4{^!Xx{h{}_HS*y(hj%in+`0Z9TT0CHjX z!9%}f_^RnjF%!To>~`Fe8OY+;evnBp)t-7LWUdO+P{tyV@B!e1j1LMvsQ92wg(+q9 zub_V%qoZ>JB{F<`2vD4f{w?(Hpnn(rd+6Us|H1UO{m?IN9!G}<+n)cd2rM=vgRYR$ z71FvwMpwu>hVtC%IE(hKeUt|3_M_;$=?7;}eCLtB-QKacAKUIOq+dM7x9-}`mS2=` zt~dbXu8_tiRM>#d2CS2)lwJSfqt%WBB{+e?Pqw|zYUf@NbO&W4yjr4Q5W>hE!VHlM zpZI$v(=n~U(?Q{>y;bsM!*EpKu=mN7Xwr9|Eddau->0ONXZ!k~`?U1?EYC|X&q%+| zvj)g%rQR0+t-Czb#!8#0s!P39{UHLIR5ivnuw_k_R3x)zN{XWd;4(@E8xyR({#1dg z8j@<6b2zi8p8Hd3maW^80e*l|MlGP{VJxTny4-g?k_Wb7RElpqz9bu1YQ<1p#WFPf zaO4$87e;3=NU8rWOnlq50eleVHoZqe(oDNIBd-Rz}a586~4-{7jH>GH%Ap7!!s+VFZFO z@vrRDjBrB8A$3r+EP7(o6KCe3ziSsCc++9$Uj#GwAd{m)jw(57IGKzOBt-7@ab)nv z3{gIWc~(-0^4WUu)UQL$BNf84b)S!ueorSkWX&j&O7$CLdPfR5(_$E*y2L+HE2qpz^t)e3I+} zosrKO0Y?W(s|FG)EXaUkWY~c6J|+_&6jPPrfG5QP6}U_QCa1~53``o3W!Z9RKnIp7 zM*&%rn1JWXa9njm5DI6}_$u?WQ!i(n#Y^D`a0EC490861i$I_K9r5Vhm`4v>MRqmM z8=Dy&Wi*>I1cMfH$#}uRR`dkXSSl*+z$e)L|9t%Rzl-gEY~geJ-!Ecwh1>t!{-@s) zhO__8ee8de+y7`96*WGSJ~zBX``?`~JY@erX6=8Sn*9bnF%QxH*Lyxb53pOE!S+A= z<^_N3Cuuj3ydbh$*{=bNm2JjWHnex~H*3~zjqQJ9B>Nvrn_&NI$i8Onf6p=vz2E*f zV#$ns?SFH4`yWe|ZvTfccG>@-eDwPS92qcQRg!TuQ|*8JjfU9&1PE;Z(*UynDMZNr zrvYUD;{dV$ae&zWBpJ52u|G><-zblY+q z^}yzHUk23vr+y8U_%#^&KVkTi=Dvtzk9`$=B_1pS+W#|upZT{iaY4w*zTpIhW8~z( zk+nc|bJPKrQ&id4Ey>AIcVbS}bjNiJHK%&E3uNHsG&pE5;7B`19i=(y;mm2oaR*PZ zCoX3izzP)4%~AJtc!K=V=p=M7;}hsH#wXAPj7~zIZq6ibx|}6xlBxqcXPK5^1%@(X zTdw99TFwh>1G>eX99%R(^Hp8TQRjG$I!JTWS(^)N)AFGFxxi5+!}hF;ot=Bd`*QK& z)5p7=9lz)~#m1AZtvmMC6F(#owD%tQ!=x$n=Xv17rtExZE=2Y*Dvqv*n1SlLl9sxiv&1?oF^v3 zoJY!dmw&(@u|&ZqmHO|e!L8*6Q`vQcZbTVlRd&Wo+`YFoUb zDUPLDuH;C*L0{O+D~T8|aek`Mxddz?B^X{`tNNRM`nk#gZjo zRwYjhbQQ?DVn|A0S=JS?yjZU_E{fvupAtb9$_vYtMX_C;U#*Dw_1p8SwS{~!zpz$c zUu#qv?NAG zZ0@pn`S>1$4wf_EN#N5jiVJIvR=ZgapM!l|8X1<2f!XDHNR z(W9ZR=I0>ldxKl?ut*PTs{~&t-2!aSq>azcU4zJ0hep=uL6!=J;QR=}`6L-ll5Qvn zVHu-AXygkJ!jA_-xYk^(4AWQ_VPBUQ+qHV7)h^f9XXmbu1d!PS5G@t~R7?kmq#Ft# zSjK1onfV_=fWF%2&Bh|o*8YOMC4Q@Gi<@ybOBx=^9!95K>FWt_R&n&~T=orE7xkeV z>wIEeL=T9nB>N_;lb<9v+HOFGsv212XjLlJx@O}L^V+1&^SXjxPfvA3(imFy#x>J|t*Y)~(y|Qtu0?hIX zxLv!s5to&s_~Yi-t@*l;JqwZj=U9+U6|@K0E@6_;P0c8N;zV?#jQbFN8zQ_j0O6Gl zAho5{)s>~SjRnb4>y}Zw)iy|Z`@QVAsgUlc3*2)M-0xDr9kvUou4v^H`Fen5HtMaax}q(Vt(#I@R#&U-M&oL}t4r^~^qsL_ znkruprmP%En5O0vKW8GQ_<4JKf_EXNoz!-!+-WSEYm0hS*H@O!yT(HM=Av@bT3?FG z8UoW$>vaM89t8B;12@uC;SvFbLL{M?no0bGBcS>IKs1+@?=)-Wwbo*Lbyd1sy;Z5+ z1?$yzV=XRgAe#7X>qGOxSkO!rt_RIXh$J*qGl`!t5zWN+9exxnp8Iy<_+)6?3*cte ze%jdqSx?4ia`rD71)nO}KTW{Y7tdXvJTWQ2&j5mY^y@EwEC|}sZ^DCq^snIo{;r*y z$)3y#;b#KDxCT@eOyxe3RaKrkQUIC;re?1znx?>%r_bG=It5dLBOoWwhA}Ye^Xbzt z3i<<%XtNrMI{&Mgw|b*~ojcQYu9x``;NKdgT8Hwrsn~VeEklb_l$vOP>rsn+rw3#ct zNOAr@p5?>&|2unQe~Dj7hTQ(g_W#$M|IhjVaC!tgT$c0P{^$1p;0Y|8|G&=+AI|@W zbAkr2{5k)>yVK?T|NcpA1E~9>Fe`_c=`cLAlJoz&<_(5?_kCwPB%&LCSMTLjbN+uZ zKVTlgi|~Q7oc|wU%K86jE_8JzmAc>4ui^<6od4g-r+cibE2-4|9yDJv|Npy@`2W}T z=l=^s^Zz^j{QuAT`TxJ{=l_4v&;P&1^8XVy%AlM>_YgUUX+&_A2Hv&PL+U0@hqYry z#Q%?(t>LB=@s1g(q9*v8($<@bw)H^Xr#|Mo8#|=p1*sV7dKdpc_P~v>dB$+O*hoyY zJyxHXjNdFG&N5O;AmSYM?$Sl)QY7;KUvT%XKJge7qYb@S@euzX?*&E{^(5{=yr?G) zphZ2Y;}9+CNdst6PaGhNdg1_C)RQE`i+Yj(UeuEY@S>j2IsYHImH6NH2?65&kNxkF z|KDTQ|Mzss)qSPc8-DOG_5b@lO9wOl|I|f-4Yb%YdgtjTL9ic&8<>&(-YlQ40eo;d zX%3kGzs>Uh2dQAHi#@K3L;gS4#S#A>Z&lf+?7r{1IO6}u9ZL7GD|w@`k(oYyz%j3V zO#Weq32-&>zTLlw0)NQ^1*jf4{~s>j`AQt!ucXkiuT?kp47vZG`~Ug+f3cUF`~Ug+ ze|-HvwA2n+rjD=wH-=R`)4lxZSHeYl@Vcy|CZf;gB>F(>{}KB?w!azcIp+WShUFT* LPOaea9cTXw9j{)p literal 0 HcmV?d00001 diff --git a/data.trace.db b/data.trace.db new file mode 100644 index 0000000..68b4556 --- /dev/null +++ b/data.trace.db @@ -0,0 +1,1112 @@ +2023-04-18 09:40:28 jdbc[3]: exception +org.h2.jdbc.JdbcSQLDataException: Невозможно преобразование строки "01.02.2023" в тип "TIMESTAMP" +Cannot parse "TIMESTAMP" constant "01.02.2023"; SQL statement: +select favor1_.name as col_0_0_ from orders_favors order_favo0_ inner join favors favor1_ on order_favo0_.favor_id_id=favor1_.id inner join orders order2_ on order_favo0_.order_id_id=order2_.id where order2_.date>'01.02.2023' [22007-210] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:525) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) + at org.h2.message.DbException.get(DbException.java:216) + at org.h2.value.ValueTimestamp.parse(ValueTimestamp.java:88) + at org.h2.value.Value.convertToTimestamp(Value.java:1980) + at org.h2.value.Value.convertTo(Value.java:1153) + at org.h2.value.Value.convertTo(Value.java:1035) + at org.h2.expression.condition.Comparison.optimize(Comparison.java:189) + at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:136) + at org.h2.expression.Expression.optimizeCondition(Expression.java:148) + at org.h2.command.query.Select.prepare(Select.java:1184) + at org.h2.command.Parser.prepareCommand(Parser.java:557) + at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:615) + at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:553) + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) + at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:92) + at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288) + at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337) + at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) + at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:149) + at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:176) + at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:151) + at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:2122) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2059) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2037) + at org.hibernate.loader.Loader.doQuery(Loader.java:956) + at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357) + at org.hibernate.loader.Loader.doList(Loader.java:2868) + at org.hibernate.loader.Loader.doList(Loader.java:2850) + at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682) + at org.hibernate.loader.Loader.list(Loader.java:2677) + at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540) + at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400) + at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219) + at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459) + at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649) + at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617) + at org.hibernate.query.Query.getResultList(Query.java:165) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService.makereport(Order_FavorService.java:68) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$FastClassBySpringCGLIB$$f8ff4f5e.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$EnhancerBySpringCGLIB$$7f168701.makereport() + at ru.ulstu.is.sbapp.repair.controller.ReportController.GetReport(ReportController.java:22) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:670) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) + at java.base/java.lang.Thread.run(Thread.java:833) +Caused by: java.lang.NumberFormatException: For input string: "01.02." + at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) + at java.base/java.lang.Integer.parseInt(Integer.java:668) + at java.base/java.lang.Integer.parseInt(Integer.java:786) + at org.h2.util.DateTimeUtils.parseDateValue(DateTimeUtils.java:190) + at org.h2.util.DateTimeUtils.parseTimestamp(DateTimeUtils.java:338) + at org.h2.value.ValueTimestamp.parse(ValueTimestamp.java:86) + ... 98 more +2023-04-18 09:55:31 jdbc[3]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Столбец "ORDER_FAVO0_.AMOUNT" должен быть в предложении GROUP BY +Column "ORDER_FAVO0_.AMOUNT" must be in the GROUP BY list; SQL statement: +select favor1_.price*order_favo0_.amount as col_0_0_ from orders_favors order_favo0_ inner join favors favor1_ on order_favo0_.favor_id_id=favor1_.id inner join orders order2_ on order_favo0_.order_id_id=order2_.id where order2_.date>'2023-02-01' and order2_.date<'2023-03-01' group by favor1_.name [90016-210] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:651) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) + at org.h2.message.DbException.get(DbException.java:227) + at org.h2.message.DbException.get(DbException.java:203) + at org.h2.expression.ExpressionColumn.updateAggregate(ExpressionColumn.java:270) + at org.h2.expression.Operation2.updateAggregate(Operation2.java:58) + at org.h2.expression.Alias.updateAggregate(Alias.java:74) + at org.h2.command.query.Select.updateAgg(Select.java:539) + at org.h2.command.query.Select.gatherGroup(Select.java:522) + at org.h2.command.query.Select.queryGroup(Select.java:488) + at org.h2.command.query.Select.queryWithoutCache(Select.java:828) + at org.h2.command.query.Query.queryWithoutCacheLazyCheck(Query.java:197) + at org.h2.command.query.Query.query(Query.java:494) + at org.h2.command.query.Query.query(Query.java:457) + at org.h2.command.CommandContainer.query(CommandContainer.java:256) + at org.h2.command.Command.executeQuery(Command.java:190) + at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:128) + at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) + at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) + at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57) + at org.hibernate.loader.Loader.getResultSet(Loader.java:2322) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2075) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2037) + at org.hibernate.loader.Loader.doQuery(Loader.java:956) + at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357) + at org.hibernate.loader.Loader.doList(Loader.java:2868) + at org.hibernate.loader.Loader.doList(Loader.java:2850) + at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682) + at org.hibernate.loader.Loader.list(Loader.java:2677) + at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540) + at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400) + at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219) + at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459) + at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649) + at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617) + at org.hibernate.query.Query.getResultList(Query.java:165) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService.makereport(Order_FavorService.java:73) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$FastClassBySpringCGLIB$$f8ff4f5e.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$EnhancerBySpringCGLIB$$7f168701.makereport() + at ru.ulstu.is.sbapp.repair.controller.ReportController.GetReport(ReportController.java:22) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:670) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) + at java.base/java.lang.Thread.run(Thread.java:833) +2023-04-18 09:55:54 jdbc[3]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Столбец "ORDER_FAVO0_.AMOUNT" должен быть в предложении GROUP BY +Column "ORDER_FAVO0_.AMOUNT" must be in the GROUP BY list; SQL statement: +select favor1_.price*order_favo0_.amount as col_0_0_ from orders_favors order_favo0_ inner join favors favor1_ on order_favo0_.favor_id_id=favor1_.id inner join orders order2_ on order_favo0_.order_id_id=order2_.id where order2_.date>'2023-02-01' and order2_.date<'2023-03-01' group by favor1_.name [90016-210] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:651) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) + at org.h2.message.DbException.get(DbException.java:227) + at org.h2.message.DbException.get(DbException.java:203) + at org.h2.expression.ExpressionColumn.updateAggregate(ExpressionColumn.java:270) + at org.h2.expression.Operation2.updateAggregate(Operation2.java:58) + at org.h2.expression.Alias.updateAggregate(Alias.java:74) + at org.h2.command.query.Select.updateAgg(Select.java:539) + at org.h2.command.query.Select.gatherGroup(Select.java:522) + at org.h2.command.query.Select.queryGroup(Select.java:488) + at org.h2.command.query.Select.queryWithoutCache(Select.java:828) + at org.h2.command.query.Query.queryWithoutCacheLazyCheck(Query.java:197) + at org.h2.command.query.Query.query(Query.java:494) + at org.h2.command.query.Query.query(Query.java:457) + at org.h2.command.CommandContainer.query(CommandContainer.java:256) + at org.h2.command.Command.executeQuery(Command.java:190) + at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:128) + at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) + at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) + at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57) + at org.hibernate.loader.Loader.getResultSet(Loader.java:2322) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2075) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2037) + at org.hibernate.loader.Loader.doQuery(Loader.java:956) + at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357) + at org.hibernate.loader.Loader.doList(Loader.java:2868) + at org.hibernate.loader.Loader.doList(Loader.java:2850) + at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682) + at org.hibernate.loader.Loader.list(Loader.java:2677) + at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540) + at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400) + at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219) + at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459) + at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649) + at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617) + at org.hibernate.query.Query.getResultList(Query.java:165) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService.makereport(Order_FavorService.java:73) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$FastClassBySpringCGLIB$$f8ff4f5e.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$EnhancerBySpringCGLIB$$7f168701.makereport() + at ru.ulstu.is.sbapp.repair.controller.ReportController.GetReport(ReportController.java:22) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:670) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) + at java.base/java.lang.Thread.run(Thread.java:833) +2023-04-18 09:57:49 jdbc[3]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Столбец "ORDER_FAVO0_.AMOUNT" должен быть в предложении GROUP BY +Column "ORDER_FAVO0_.AMOUNT" must be in the GROUP BY list; SQL statement: +select order_favo0_.amount as col_0_0_ from orders_favors order_favo0_ inner join favors favor1_ on order_favo0_.favor_id_id=favor1_.id inner join orders order2_ on order_favo0_.order_id_id=order2_.id where order2_.date>'2023-02-01' and order2_.date<'2023-03-01' group by favor1_.name [90016-210] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:651) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) + at org.h2.message.DbException.get(DbException.java:227) + at org.h2.message.DbException.get(DbException.java:203) + at org.h2.expression.ExpressionColumn.updateAggregate(ExpressionColumn.java:270) + at org.h2.expression.Alias.updateAggregate(Alias.java:74) + at org.h2.command.query.Select.updateAgg(Select.java:539) + at org.h2.command.query.Select.gatherGroup(Select.java:522) + at org.h2.command.query.Select.queryGroup(Select.java:488) + at org.h2.command.query.Select.queryWithoutCache(Select.java:828) + at org.h2.command.query.Query.queryWithoutCacheLazyCheck(Query.java:197) + at org.h2.command.query.Query.query(Query.java:494) + at org.h2.command.query.Query.query(Query.java:457) + at org.h2.command.CommandContainer.query(CommandContainer.java:256) + at org.h2.command.Command.executeQuery(Command.java:190) + at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:128) + at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) + at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) + at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57) + at org.hibernate.loader.Loader.getResultSet(Loader.java:2322) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2075) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2037) + at org.hibernate.loader.Loader.doQuery(Loader.java:956) + at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357) + at org.hibernate.loader.Loader.doList(Loader.java:2868) + at org.hibernate.loader.Loader.doList(Loader.java:2850) + at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682) + at org.hibernate.loader.Loader.list(Loader.java:2677) + at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540) + at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400) + at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219) + at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459) + at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649) + at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617) + at org.hibernate.query.Query.getResultList(Query.java:165) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService.makereport(Order_FavorService.java:74) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$FastClassBySpringCGLIB$$f8ff4f5e.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$EnhancerBySpringCGLIB$$122a0639.makereport() + at ru.ulstu.is.sbapp.repair.controller.ReportController.GetReport(ReportController.java:22) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:670) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) + at java.base/java.lang.Thread.run(Thread.java:833) +2023-04-18 09:59:27 jdbc[3]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Столбец "ORDER_FAVO0_.AMOUNT" должен быть в предложении GROUP BY +Column "ORDER_FAVO0_.AMOUNT" must be in the GROUP BY list; SQL statement: +select favor1_.price*order_favo0_.amount as col_0_0_ from orders_favors order_favo0_ inner join favors favor1_ on order_favo0_.favor_id_id=favor1_.id inner join orders order2_ on order_favo0_.order_id_id=order2_.id where order2_.date>'2023-02-01' and order2_.date<'2023-03-01' group by favor1_.name [90016-210] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:651) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) + at org.h2.message.DbException.get(DbException.java:227) + at org.h2.message.DbException.get(DbException.java:203) + at org.h2.expression.ExpressionColumn.updateAggregate(ExpressionColumn.java:270) + at org.h2.expression.Operation2.updateAggregate(Operation2.java:58) + at org.h2.expression.Alias.updateAggregate(Alias.java:74) + at org.h2.command.query.Select.updateAgg(Select.java:539) + at org.h2.command.query.Select.gatherGroup(Select.java:522) + at org.h2.command.query.Select.queryGroup(Select.java:488) + at org.h2.command.query.Select.queryWithoutCache(Select.java:828) + at org.h2.command.query.Query.queryWithoutCacheLazyCheck(Query.java:197) + at org.h2.command.query.Query.query(Query.java:494) + at org.h2.command.query.Query.query(Query.java:457) + at org.h2.command.CommandContainer.query(CommandContainer.java:256) + at org.h2.command.Command.executeQuery(Command.java:190) + at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:128) + at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) + at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) + at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57) + at org.hibernate.loader.Loader.getResultSet(Loader.java:2322) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2075) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2037) + at org.hibernate.loader.Loader.doQuery(Loader.java:956) + at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357) + at org.hibernate.loader.Loader.doList(Loader.java:2868) + at org.hibernate.loader.Loader.doList(Loader.java:2850) + at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682) + at org.hibernate.loader.Loader.list(Loader.java:2677) + at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540) + at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400) + at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219) + at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459) + at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649) + at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617) + at org.hibernate.query.Query.getResultList(Query.java:165) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService.makereport(Order_FavorService.java:73) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$FastClassBySpringCGLIB$$f8ff4f5e.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$EnhancerBySpringCGLIB$$7f168701.makereport() + at ru.ulstu.is.sbapp.repair.controller.ReportController.GetReport(ReportController.java:22) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:670) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) + at java.base/java.lang.Thread.run(Thread.java:833) +2023-04-18 09:59:50 jdbc[3]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Столбец "ORDER_FAVO0_.AMOUNT" должен быть в предложении GROUP BY +Column "ORDER_FAVO0_.AMOUNT" must be in the GROUP BY list; SQL statement: +select favor1_.price as col_0_0_, order_favo0_.amount as col_1_0_ from orders_favors order_favo0_ inner join favors favor1_ on order_favo0_.favor_id_id=favor1_.id inner join orders order2_ on order_favo0_.order_id_id=order2_.id where order2_.date>'2023-02-01' and order2_.date<'2023-03-01' group by favor1_.name [90016-210] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:651) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) + at org.h2.message.DbException.get(DbException.java:227) + at org.h2.message.DbException.get(DbException.java:203) + at org.h2.expression.ExpressionColumn.updateAggregate(ExpressionColumn.java:270) + at org.h2.expression.Alias.updateAggregate(Alias.java:74) + at org.h2.command.query.Select.updateAgg(Select.java:539) + at org.h2.command.query.Select.gatherGroup(Select.java:522) + at org.h2.command.query.Select.queryGroup(Select.java:488) + at org.h2.command.query.Select.queryWithoutCache(Select.java:828) + at org.h2.command.query.Query.queryWithoutCacheLazyCheck(Query.java:197) + at org.h2.command.query.Query.query(Query.java:494) + at org.h2.command.query.Query.query(Query.java:457) + at org.h2.command.CommandContainer.query(CommandContainer.java:256) + at org.h2.command.Command.executeQuery(Command.java:190) + at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:128) + at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) + at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) + at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57) + at org.hibernate.loader.Loader.getResultSet(Loader.java:2322) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2075) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2037) + at org.hibernate.loader.Loader.doQuery(Loader.java:956) + at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357) + at org.hibernate.loader.Loader.doList(Loader.java:2868) + at org.hibernate.loader.Loader.doList(Loader.java:2850) + at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682) + at org.hibernate.loader.Loader.list(Loader.java:2677) + at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540) + at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400) + at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219) + at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459) + at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649) + at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617) + at org.hibernate.query.Query.getResultList(Query.java:165) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService.makereport(Order_FavorService.java:73) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$FastClassBySpringCGLIB$$f8ff4f5e.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$EnhancerBySpringCGLIB$$122a0639.makereport() + at ru.ulstu.is.sbapp.repair.controller.ReportController.GetReport(ReportController.java:22) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:670) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) + at java.base/java.lang.Thread.run(Thread.java:833) +2023-04-18 09:59:53 jdbc[3]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Столбец "ORDER_FAVO0_.AMOUNT" должен быть в предложении GROUP BY +Column "ORDER_FAVO0_.AMOUNT" must be in the GROUP BY list; SQL statement: +select favor1_.price as col_0_0_, order_favo0_.amount as col_1_0_ from orders_favors order_favo0_ inner join favors favor1_ on order_favo0_.favor_id_id=favor1_.id inner join orders order2_ on order_favo0_.order_id_id=order2_.id where order2_.date>'2023-02-01' and order2_.date<'2023-03-01' group by favor1_.name [90016-210] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:651) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) + at org.h2.message.DbException.get(DbException.java:227) + at org.h2.message.DbException.get(DbException.java:203) + at org.h2.expression.ExpressionColumn.updateAggregate(ExpressionColumn.java:270) + at org.h2.expression.Alias.updateAggregate(Alias.java:74) + at org.h2.command.query.Select.updateAgg(Select.java:539) + at org.h2.command.query.Select.gatherGroup(Select.java:522) + at org.h2.command.query.Select.queryGroup(Select.java:488) + at org.h2.command.query.Select.queryWithoutCache(Select.java:828) + at org.h2.command.query.Query.queryWithoutCacheLazyCheck(Query.java:197) + at org.h2.command.query.Query.query(Query.java:494) + at org.h2.command.query.Query.query(Query.java:457) + at org.h2.command.CommandContainer.query(CommandContainer.java:256) + at org.h2.command.Command.executeQuery(Command.java:190) + at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:128) + at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) + at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) + at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57) + at org.hibernate.loader.Loader.getResultSet(Loader.java:2322) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2075) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2037) + at org.hibernate.loader.Loader.doQuery(Loader.java:956) + at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357) + at org.hibernate.loader.Loader.doList(Loader.java:2868) + at org.hibernate.loader.Loader.doList(Loader.java:2850) + at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682) + at org.hibernate.loader.Loader.list(Loader.java:2677) + at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540) + at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400) + at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219) + at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459) + at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649) + at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617) + at org.hibernate.query.Query.getResultList(Query.java:165) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService.makereport(Order_FavorService.java:73) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$FastClassBySpringCGLIB$$f8ff4f5e.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$EnhancerBySpringCGLIB$$122a0639.makereport() + at ru.ulstu.is.sbapp.repair.controller.ReportController.GetReport(ReportController.java:22) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:670) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) + at java.base/java.lang.Thread.run(Thread.java:833) +2023-04-18 10:02:58 jdbc[13]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Синтаксическая ошибка в выражении SQL "select distinct f.name, f.price, count(f.name) as count, sum(of.amount * f.price [*]as total), \000d\000afrom orders_favors of\000d\000ajoin orders o\000d\000aon o.id = of.order_fk\000d\000ajoin favors f\000d\000aon f.id = of.favor_fk\000d\000awhere date > '2023-02-10' and date < '2023-03-01'\000d\000agroup by f.name, of.amount"; ожидалось "(, ., [, ::, AT, FORMAT, *, /, %, +, -, ||, NOT, IS, ILIKE, REGEXP, AND, OR, )" +Syntax error in SQL statement "select distinct f.name, f.price, count(f.name) as count, sum(of.amount * f.price [*]as total), \000d\000afrom orders_favors of\000d\000ajoin orders o\000d\000aon o.id = of.order_fk\000d\000ajoin favors f\000d\000aon f.id = of.favor_fk\000d\000awhere date > '2023-02-10' and date < '2023-03-01'\000d\000agroup by f.name, of.amount"; expected "(, ., [, ::, AT, FORMAT, *, /, %, +, -, ||, NOT, IS, ILIKE, REGEXP, AND, OR, )"; SQL statement: +select distinct f.name, f.price, count(f.name) as count, sum(of.amount * f.price as total), +from orders_favors of +join orders o +on o.id = of.order_fk +join favors f +on f.id = of.favor_fk +where date > '2023-02-10' and date < '2023-03-01' +group by f.name, of.amount [42001-210] +2023-04-18 10:03:58 jdbc[13]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: SUM или AVG на недопустимом типе данных "SUM(F.NAME)" +SUM or AVG on wrong data type for "SUM(F.NAME)"; SQL statement: +select distinct f.name, f.price, count(f.name) as count, sum(f.name) * of.amount * f.price as total, +from orders_favors of +join orders o +on o.id = of.order_fk +join favors f +on f.id = of.favor_fk +where date > '2023-02-10' and date < '2023-03-01' +group by f.name, of.amount [90015-210] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:651) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) + at org.h2.message.DbException.get(DbException.java:227) + at org.h2.message.DbException.get(DbException.java:203) + at org.h2.expression.aggregate.Aggregate.optimize(Aggregate.java:979) + at org.h2.expression.BinaryOperation.optimize(BinaryOperation.java:130) + at org.h2.expression.BinaryOperation.optimize(BinaryOperation.java:130) + at org.h2.expression.Alias.optimize(Alias.java:52) + at org.h2.command.query.Select.prepare(Select.java:1177) + at org.h2.command.Parser.prepareCommand(Parser.java:557) + at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:615) + at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:553) + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) + at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:237) + at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:223) + at org.h2.server.web.WebApp.getResult(WebApp.java:1339) + at org.h2.server.web.WebApp.query(WebApp.java:1137) + at org.h2.server.web.WebApp.query(WebApp.java:1113) + at org.h2.server.web.WebApp.process(WebApp.java:244) + at org.h2.server.web.WebApp.processRequest(WebApp.java:176) + at org.h2.server.web.WebServlet.doGet(WebServlet.java:129) + at org.h2.server.web.WebServlet.doPost(WebServlet.java:166) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:696) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) + at java.base/java.lang.Thread.run(Thread.java:833) +2023-04-18 10:04:06 jdbc[13]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Столбец "TOTAL" не найден +Column "TOTAL" not found; SQL statement: +select distinct f.name, f.price, count(f.name) as count, sum(total) * of.amount * f.price as total, +from orders_favors of +join orders o +on o.id = of.order_fk +join favors f +on f.id = of.favor_fk +where date > '2023-02-10' and date < '2023-03-01' +group by f.name, of.amount [42122-210] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:521) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) + at org.h2.message.DbException.get(DbException.java:227) + at org.h2.message.DbException.get(DbException.java:203) + at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:248) + at org.h2.expression.ExpressionColumn.optimizeOther(ExpressionColumn.java:230) + at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:213) + at org.h2.expression.aggregate.AbstractAggregate.optimize(AbstractAggregate.java:92) + at org.h2.expression.aggregate.Aggregate.optimize(Aggregate.java:918) + at org.h2.expression.BinaryOperation.optimize(BinaryOperation.java:130) + at org.h2.expression.BinaryOperation.optimize(BinaryOperation.java:130) + at org.h2.expression.Alias.optimize(Alias.java:52) + at org.h2.command.query.Select.prepare(Select.java:1177) + at org.h2.command.Parser.prepareCommand(Parser.java:557) + at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:615) + at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:553) + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) + at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:237) + at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:223) + at org.h2.server.web.WebApp.getResult(WebApp.java:1339) + at org.h2.server.web.WebApp.query(WebApp.java:1137) + at org.h2.server.web.WebApp.query(WebApp.java:1113) + at org.h2.server.web.WebApp.process(WebApp.java:244) + at org.h2.server.web.WebApp.processRequest(WebApp.java:176) + at org.h2.server.web.WebServlet.doGet(WebServlet.java:129) + at org.h2.server.web.WebServlet.doPost(WebServlet.java:166) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:696) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) + at java.base/java.lang.Thread.run(Thread.java:833) +2023-04-18 10:06:19 jdbc[13]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Синтаксическая ошибка в выражении SQL "select distinct f.name, f.price, count(f.name) as count, count(f.name) * f.price as total, \000d\000afrom orders_favors of\000d\000ajoin orders o\000d\000aon o.id = of.order_fk\000d\000ajoin favors f\000d\000aon f.id = of.favor_fk\000d\000awhere date > '2023-02-10' and date < '2023-03-01'\000d\000agroup by f.name\000d\000a[*]group by off.amount" +Syntax error in SQL statement "select distinct f.name, f.price, count(f.name) as count, count(f.name) * f.price as total, \000d\000afrom orders_favors of\000d\000ajoin orders o\000d\000aon o.id = of.order_fk\000d\000ajoin favors f\000d\000aon f.id = of.favor_fk\000d\000awhere date > '2023-02-10' and date < '2023-03-01'\000d\000agroup by f.name\000d\000a[*]group by off.amount"; SQL statement: +select distinct f.name, f.price, count(f.name) as count, count(f.name) * f.price as total, +from orders_favors of +join orders o +on o.id = of.order_fk +join favors f +on f.id = of.favor_fk +where date > '2023-02-10' and date < '2023-03-01' +group by f.name +group by off.amount [42000-210] +2023-04-18 10:06:41 jdbc[13]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Синтаксическая ошибка в выражении SQL "select distinct f.name, f.price, count(f.name) as count, count(f.name) * f.price as total, off.amount \000d\000afrom orders_favors of\000d\000ajoin orders o\000d\000aon o.id = of.order_fk\000d\000ajoin favors f\000d\000aon f.id = of.favor_fk\000d\000awhere date > '2023-02-10' and date < '2023-03-01'\000d\000agroup by f.name\000d\000a[*]group by off.amount" +Syntax error in SQL statement "select distinct f.name, f.price, count(f.name) as count, count(f.name) * f.price as total, off.amount \000d\000afrom orders_favors of\000d\000ajoin orders o\000d\000aon o.id = of.order_fk\000d\000ajoin favors f\000d\000aon f.id = of.favor_fk\000d\000awhere date > '2023-02-10' and date < '2023-03-01'\000d\000agroup by f.name\000d\000a[*]group by off.amount"; SQL statement: +select distinct f.name, f.price, count(f.name) as count, count(f.name) * f.price as total, off.amount +from orders_favors of +join orders o +on o.id = of.order_fk +join favors f +on f.id = of.favor_fk +where date > '2023-02-10' and date < '2023-03-01' +group by f.name +group by off.amount [42000-210] +2023-04-18 10:06:57 jdbc[13]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Синтаксическая ошибка в выражении SQL "select distinct f.name, f.price, count(f.name) as count, count(f.name) * f.price as total, off.amount, \000d\000afrom orders_favors of\000d\000ajoin orders o\000d\000aon o.id = of.order_fk\000d\000ajoin favors f\000d\000aon f.id = of.favor_fk\000d\000awhere date > '2023-02-10' and date < '2023-03-01'\000d\000agroup by f.name\000d\000a[*]group by off.amount" +Syntax error in SQL statement "select distinct f.name, f.price, count(f.name) as count, count(f.name) * f.price as total, off.amount, \000d\000afrom orders_favors of\000d\000ajoin orders o\000d\000aon o.id = of.order_fk\000d\000ajoin favors f\000d\000aon f.id = of.favor_fk\000d\000awhere date > '2023-02-10' and date < '2023-03-01'\000d\000agroup by f.name\000d\000a[*]group by off.amount"; SQL statement: +select distinct f.name, f.price, count(f.name) as count, count(f.name) * f.price as total, off.amount, +from orders_favors of +join orders o +on o.id = of.order_fk +join favors f +on f.id = of.favor_fk +where date > '2023-02-10' and date < '2023-03-01' +group by f.name +group by off.amount [42000-210] +2023-04-18 10:08:31 jdbc[13]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Синтаксическая ошибка в выражении SQL "select distinct f.name, f.price, count(f.name) as count, count(f.name) * f.price as total\000d\000afrom orders_favors of\000d\000ajoin orders o\000d\000aon o.id = of.order_fk\000d\000a\000d\000agroup by f.name\000d\000a[*]join favors f\000d\000aon f.id = of.favor_fk\000d\000awhere date > '2023-02-10' and date < '2023-03-01'" +Syntax error in SQL statement "select distinct f.name, f.price, count(f.name) as count, count(f.name) * f.price as total\000d\000afrom orders_favors of\000d\000ajoin orders o\000d\000aon o.id = of.order_fk\000d\000a\000d\000agroup by f.name\000d\000a[*]join favors f\000d\000aon f.id = of.favor_fk\000d\000awhere date > '2023-02-10' and date < '2023-03-01'"; SQL statement: +select distinct f.name, f.price, count(f.name) as count, count(f.name) * f.price as total +from orders_favors of +join orders o +on o.id = of.order_fk + +group by f.name +join favors f +on f.id = of.favor_fk +where date > '2023-02-10' and date < '2023-03-01' [42000-210] +2023-04-18 10:12:32 jdbc[13]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Некорректное использование агрегирующей функции "SUM(OF.AMOUNT)" +Invalid use of aggregate function "SUM(OF.AMOUNT)"; SQL statement: +select distinct f.name, f.price, count(f.name) as count, sum(f.price * sum(of.amount)) as total, +from orders_favors of +join orders o +on o.id = of.order_fk +join favors f +on f.id = of.favor_fk +where date > '2023-02-10' and date < '2023-03-01' +group by f.name [90054-210] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:651) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) + at org.h2.message.DbException.get(DbException.java:227) + at org.h2.message.DbException.get(DbException.java:203) + at org.h2.expression.analysis.DataAnalysisOperation.mapColumns(DataAnalysisOperation.java:128) + at org.h2.expression.Operation2.mapColumns(Operation2.java:46) + at org.h2.expression.aggregate.AbstractAggregate.mapColumnsAnalysis(AbstractAggregate.java:81) + at org.h2.expression.aggregate.Aggregate.mapColumnsAnalysis(Aggregate.java:913) + at org.h2.expression.analysis.DataAnalysisOperation.mapColumns(DataAnalysisOperation.java:132) + at org.h2.expression.Alias.mapColumns(Alias.java:47) + at org.h2.command.query.Select.mapColumns(Select.java:1546) + at org.h2.command.query.Select.init(Select.java:1100) + at org.h2.command.Parser.parseQuery(Parser.java:2583) + at org.h2.command.Parser.parsePrepared(Parser.java:707) + at org.h2.command.Parser.parse(Parser.java:674) + at org.h2.command.Parser.parse(Parser.java:644) + at org.h2.command.Parser.prepareCommand(Parser.java:551) + at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:615) + at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:553) + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) + at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:237) + at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:223) + at org.h2.server.web.WebApp.getResult(WebApp.java:1339) + at org.h2.server.web.WebApp.query(WebApp.java:1137) + at org.h2.server.web.WebApp.query(WebApp.java:1113) + at org.h2.server.web.WebApp.process(WebApp.java:244) + at org.h2.server.web.WebApp.processRequest(WebApp.java:176) + at org.h2.server.web.WebServlet.doGet(WebServlet.java:129) + at org.h2.server.web.WebServlet.doPost(WebServlet.java:166) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:696) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) + at java.base/java.lang.Thread.run(Thread.java:833) +2023-04-18 10:15:20 jdbc[3]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Столбец "ORDER_FAVO0_.AMOUNT" должен быть в предложении GROUP BY +Column "ORDER_FAVO0_.AMOUNT" must be in the GROUP BY list; SQL statement: +select favor1_.price as col_0_0_, order_favo0_.amount as col_1_0_ from orders_favors order_favo0_ inner join favors favor1_ on order_favo0_.favor_id_id=favor1_.id inner join orders order2_ on order_favo0_.order_id_id=order2_.id where order2_.date>'2023-02-01' and order2_.date<'2023-03-01' group by favor1_.name [90016-210] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:651) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) + at org.h2.message.DbException.get(DbException.java:227) + at org.h2.message.DbException.get(DbException.java:203) + at org.h2.expression.ExpressionColumn.updateAggregate(ExpressionColumn.java:270) + at org.h2.expression.Alias.updateAggregate(Alias.java:74) + at org.h2.command.query.Select.updateAgg(Select.java:539) + at org.h2.command.query.Select.gatherGroup(Select.java:522) + at org.h2.command.query.Select.queryGroup(Select.java:488) + at org.h2.command.query.Select.queryWithoutCache(Select.java:828) + at org.h2.command.query.Query.queryWithoutCacheLazyCheck(Query.java:197) + at org.h2.command.query.Query.query(Query.java:494) + at org.h2.command.query.Query.query(Query.java:457) + at org.h2.command.CommandContainer.query(CommandContainer.java:256) + at org.h2.command.Command.executeQuery(Command.java:190) + at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:128) + at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) + at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) + at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57) + at org.hibernate.loader.Loader.getResultSet(Loader.java:2322) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2075) + at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2037) + at org.hibernate.loader.Loader.doQuery(Loader.java:956) + at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357) + at org.hibernate.loader.Loader.doList(Loader.java:2868) + at org.hibernate.loader.Loader.doList(Loader.java:2850) + at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682) + at org.hibernate.loader.Loader.list(Loader.java:2677) + at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540) + at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400) + at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219) + at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459) + at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649) + at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617) + at org.hibernate.query.Query.getResultList(Query.java:165) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService.makereport(Order_FavorService.java:73) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$FastClassBySpringCGLIB$$f8ff4f5e.invoke() + at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) + at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) + at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) + at ru.ulstu.is.sbapp.repair.service.Order_FavorService$$EnhancerBySpringCGLIB$$122a0639.makereport() + at ru.ulstu.is.sbapp.repair.controller.ReportController.GetReport(ReportController.java:22) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) + at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:670) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) + at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) + at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) + at java.base/java.lang.Thread.run(Thread.java:833) diff --git a/src/main/java/ru/ulstu/is/sbapp/repair/controller/ReportController.java b/src/main/java/ru/ulstu/is/sbapp/repair/controller/ReportController.java new file mode 100644 index 0000000..385d990 --- /dev/null +++ b/src/main/java/ru/ulstu/is/sbapp/repair/controller/ReportController.java @@ -0,0 +1,31 @@ +package ru.ulstu.is.sbapp.repair.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import ru.ulstu.is.sbapp.repair.service.Order_FavorService; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.util.Date; +import java.util.Map; + + +@RestController + +public class ReportController { + private final Order_FavorService orderFavorService; + @Autowired + public ReportController(Order_FavorService orderFavorService) { + this.orderFavorService = orderFavorService; + } + @GetMapping("/report") + public Map GetReport (@RequestParam(value = "from") Object value1, + @RequestParam(value = "to") Object value2) throws ParseException { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + + Date d1 = formatter.parse(value1.toString()); + Date d2 = formatter.parse(value2.toString()); + return orderFavorService.makereport(d1, d2); + } +} \ No newline at end of file diff --git a/src/main/java/ru/ulstu/is/sbapp/repair/model/Favor.java b/src/main/java/ru/ulstu/is/sbapp/repair/model/Favor.java index 1f74945..a2fb953 100644 --- a/src/main/java/ru/ulstu/is/sbapp/repair/model/Favor.java +++ b/src/main/java/ru/ulstu/is/sbapp/repair/model/Favor.java @@ -72,7 +72,7 @@ public class Favor { ordersList = new ArrayList<>(); if (!ordersList.contains(of)){ ordersList.add(of); - of.setFavor_id(this.id); + of.setFavor_id(this); } } diff --git a/src/main/java/ru/ulstu/is/sbapp/repair/model/Order.java b/src/main/java/ru/ulstu/is/sbapp/repair/model/Order.java index 3a0ce15..ea8e857 100644 --- a/src/main/java/ru/ulstu/is/sbapp/repair/model/Order.java +++ b/src/main/java/ru/ulstu/is/sbapp/repair/model/Order.java @@ -58,7 +58,7 @@ public class Order { favorsList = new ArrayList<>(); if (!favorsList.contains(of)) { favorsList.add(of); - of.setOrder_id(this.id); + of.setOrder_id(this); } //favor.addOrder(this); diff --git a/src/main/java/ru/ulstu/is/sbapp/repair/model/Order_Favor.java b/src/main/java/ru/ulstu/is/sbapp/repair/model/Order_Favor.java index 7bc5b59..13e4794 100644 --- a/src/main/java/ru/ulstu/is/sbapp/repair/model/Order_Favor.java +++ b/src/main/java/ru/ulstu/is/sbapp/repair/model/Order_Favor.java @@ -14,8 +14,10 @@ public class Order_Favor { @Column(name = "amount") private Integer amount; - private Long Order_id; - private Long Favor_id; + @ManyToOne + private Order Order_id; + @ManyToOne + private Favor Favor_id; public Order_Favor() { } @@ -36,19 +38,19 @@ public class Order_Favor { this.amount = amount; } - public Long getFavor_id() { + public Favor getFavor_id() { return Favor_id; } - public void setFavor_id(Long favor_id) { + public void setFavor_id(Favor favor_id) { Favor_id = favor_id; } - public Long getOrder_id() { + public Order getOrder_id() { return Order_id; } - public void setOrder_id(Long order_id) { + public void setOrder_id(Order order_id) { Order_id = order_id; } diff --git a/src/main/java/ru/ulstu/is/sbapp/repair/service/Order_FavorService.java b/src/main/java/ru/ulstu/is/sbapp/repair/service/Order_FavorService.java index e69fd49..ec4603f 100644 --- a/src/main/java/ru/ulstu/is/sbapp/repair/service/Order_FavorService.java +++ b/src/main/java/ru/ulstu/is/sbapp/repair/service/Order_FavorService.java @@ -9,7 +9,15 @@ import ru.ulstu.is.sbapp.repair.model.Order_Favor; import javax.persistence.EntityManager; import javax.persistence.EntityNotFoundException; import javax.persistence.PersistenceContext; +import javax.persistence.Tuple; + +import java.time.LocalDate; +import java.util.Calendar; +import java.util.Date; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + @Service public class Order_FavorService { @@ -63,8 +71,17 @@ public class Order_FavorService { } @Transactional - public List makereport(){ - List OF = em.createQuery("SELECT s FROM Order_Favor s group by amount", Order_Favor.class).getResultList(); - return OF; + public Map makereport(Date d1, Date d2){ + //s = em.createQuery("SELECT sum(off.amount) * f.price from Order_Favor off join off.Favor_id f join off.Order_id o where o.date > '2023-02-01' and o.date < '2023-03-01' group by f.favorName").getResultList().toString(); + //String s1 = em.createQuery("SELECT f.favorName from Order_Favor off join off.Favor_id f join off.Order_id o where o.date > '2023-02-01' and o.date < '2023-03-01' group by f.favorName").getResultList().toString(); + //String s1 = em.createQuery("SELECT off.amount from Order_Favor off join off.Favor_id f join off.Order_id o where o.date > '2023-02-01' and o.date < '2023-03-01' group by f.favorName").getResultList().toString(); + //s = em.createQuery("SELECT f.favorName from Order_Favor off join off.Favor_id f join off.Order_id o where o.date > :d1 ").setParameter("d1", new Date(2023, 2, 1)).getResultList().toString(); + //s = em.createQuery("SELECT f.favorName, f.price, count(f.favorName) as count, count(f.favorName) * f.price as total from Order_Favor of join Order o on o.id = of.Order_id join Favor f on f.id = of.Favor_id where o.date > '01.02.2023' and o.date < '01.03.2023' group by f.favorName").getResultList().toString(); + //s = em.createQuery("SELECT count(f.favorName) * f.price from Favor f group by favorName").getResultList().toString(); + Map answ = em.createQuery("SELECT f.favorName as n, sum(off.amount) * f.price as s from Order_Favor off join off.Favor_id f join off.Order_id o where o.date > :date1 and o.date < :date2 group by f.favorName", Tuple.class).setParameter("date1", d1).setParameter("date2", d2).getResultStream().collect(Collectors.toMap(tuple -> ((String)tuple.get("n")).toString(), tuple -> ((Number) tuple.get("s")).intValue())); + + //String ans = em.createQuery("SELECT f.favorName, sum(off.amount) * f.price from Order_Favor off join off.Favor_id f join off.Order_id o where o.date > '2023-02-01' and o.date < '2023-03-01' group by f.favorName").getResultList().toString(); + + return answ; } }