Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
5cda20ae
Commit
5cda20ae
authored
Aug 11, 2022
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)修改统计bug
parent
9e37e9c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
InspectionServiceImpl.java
...ot/module/tzs/biz/service/impl/InspectionServiceImpl.java
+7
-2
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/InspectionServiceImpl.java
View file @
5cda20ae
...
...
@@ -19,6 +19,8 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
org.apache.commons.lang.text.StrSubstitutor
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Service
;
...
...
@@ -32,6 +34,8 @@ import java.util.*;
@Service
public
class
InspectionServiceImpl
implements
InspectionService
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
InspectionServiceImpl
.
class
);
@Autowired
JdbcTemplate
jdbcTemplate
;
...
...
@@ -116,8 +120,9 @@ public class InspectionServiceImpl implements InspectionService {
selectSql
=
selectSql
+
(
selectSql
.
contains
(
"WHERE"
)
?
" AND"
:
" WHERE"
)
+
" ${fieldKey}='${fieldValue}'"
;
}
selectSql
=
ss
.
replace
(
selectSql
);
Map
<
String
,
Object
>
queryResult
=
bizJdbcTemplate
.
queryForMap
(
selectSql
);
Map
<
String
,
Object
>
queryResult
=
bizJdbcTemplate
.
queryForMap
(
selectSql
);
log
.
info
(
"查询sql:"
+
selectSql
);
HashMap
<
String
,
Object
>
item
=
new
HashMap
<>();
item
.
put
(
"key"
,
bizRecordCount
.
getTitle
());
item
.
put
(
"value"
,
queryResult
.
get
(
"count"
));
...
...
@@ -209,7 +214,7 @@ public class InspectionServiceImpl implements InspectionService {
for
(
int
i
=
1
;
i
<=
item
.
getColumnIndex
();
i
++)
{
whereSql
.
add
(
String
.
format
(
"%s%s='%s'"
,
item
.
getColumnPrefix
(),
i
,
item
.
getColumnValue
()));
}
sql
=
ValidationUtil
.
isEmpty
(
sql
)
?
""
:
"+"
+
String
.
format
(
"(SELECT count(*) FROM %s WHERE %s)"
,
item
.
getTableName
(),
whereSql
);
sql
=
sql
+
((
ValidationUtil
.
isEmpty
(
sql
)
?
""
:
"+"
)
+
String
.
format
(
"(SELECT count(*) FROM %s WHERE %s)"
,
item
.
getTableName
(),
whereSql
)
);
}
return
sql
;
}
...
...
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