Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王衍超
cloud-fb
Commits
ae0de2d7
Commit
ae0de2d7
authored
May 31, 2021
by
shiwenbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改经营报表查询sql
parent
71ad0d0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
OperationsReportsDaoImpl.java
...nas/statistics/internal/dao/OperationsReportsDaoImpl.java
+12
-5
No files found.
backend/xyst.dinas.statistics/src/main/java/com/xyst/dinas/statistics/internal/dao/OperationsReportsDaoImpl.java
View file @
ae0de2d7
...
...
@@ -2,6 +2,7 @@ package com.xyst.dinas.statistics.internal.dao;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.UUID
;
import
javax.persistence.Tuple
;
...
...
@@ -52,7 +53,7 @@ public class OperationsReportsDaoImpl implements OperationsReportsDao {
if
(
endDate
!=
null
&&
!(
endDate
.
isEmpty
()))
hql
.
append
(
" and salesSummary.deal_Time <= :endDate "
);
if
(
stationList
!=
null
&&
!(
stationList
.
isEmpty
()))
hql
.
append
(
" AND
hex(salesSummary.station_id)
IN ( :stationList ) "
);
hql
.
append
(
" AND
salesSummary.station_id
IN ( :stationList ) "
);
hql
.
append
(
" GROUP BY salesSummary.station_id,\r\n"
+
" salesSummary.dinas_type_id "
);
hql
.
append
(
" UNION ALL "
);
hql
.
append
(
...
...
@@ -79,7 +80,7 @@ public class OperationsReportsDaoImpl implements OperationsReportsDao {
if
(
endDate
!=
null
&&
!(
endDate
.
isEmpty
()))
hql
.
append
(
" and salesSummary.deal_Time <= :endDate "
);
if
(
stationList
!=
null
&&
!(
stationList
.
isEmpty
()))
hql
.
append
(
" AND
hex(salesSummary.station_id)
IN ( :stationList ) "
);
hql
.
append
(
" AND
salesSummary.station_id
IN ( :stationList ) "
);
hql
.
append
(
" GROUP BY salesSummary.station_id "
);
hql
.
append
(
" UNION ALL "
);
hql
.
append
(
" SELECT '总计' AS stationName, \r\n"
+
" '———' AS dinasTypeName, "
);
...
...
@@ -105,7 +106,7 @@ public class OperationsReportsDaoImpl implements OperationsReportsDao {
if
(
endDate
!=
null
&&
!(
endDate
.
isEmpty
()))
hql
.
append
(
" and salesSummary.deal_Time <= :endDate "
);
if
(
stationList
!=
null
&&
!(
stationList
.
isEmpty
()))
hql
.
append
(
" AND
hex(salesSummary.station_id)
IN ( :stationList ) "
);
hql
.
append
(
" AND
salesSummary.station_id
IN ( :stationList ) "
);
hql
.
append
(
" ) AS result "
);
hql
.
append
(
" ORDER BY (result.stationName = '总计') DESC,result.stationName, (result.dinasTypeName = '小计') ASC "
);
...
...
@@ -118,8 +119,14 @@ public class OperationsReportsDaoImpl implements OperationsReportsDao {
query
.
setParameter
(
"startDate"
,
startDate
);
if
(
endDate
!=
null
&&
!(
endDate
.
isEmpty
()))
query
.
setParameter
(
"endDate"
,
endDate
);
if
(
stationList
!=
null
&&
!(
stationList
.
isEmpty
()))
query
.
setParameter
(
"stationList"
,
stationList
);
if
(
stationList
!=
null
&&
!(
stationList
.
isEmpty
()))
{
String
[]
strList
=
stationList
.
split
(
","
);
List
<
UUID
>
uuidList
=
new
ArrayList
<
UUID
>();
for
(
String
str
:
strList
)
{
uuidList
.
add
(
UUID
.
fromString
(
str
));
}
query
.
setParameter
(
"stationList"
,
uuidList
);
}
List
<
Tuple
>
resultList
=
query
.
getResultList
();
if
(
resultList
.
isEmpty
())
return
null
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment