Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
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
zhangkb
indicators
Commits
0b1f6dbc
Commit
0b1f6dbc
authored
May 12, 2021
by
hzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化报表三
parent
11d17979
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
6 deletions
+51
-6
DriveIndDefMapper.java
...indicators/model/mapper/indicators/DriveIndDefMapper.java
+2
-0
ReportThreeMapper.java
...ile/indicators/model/mapper/report/ReportThreeMapper.java
+5
-0
IndicatorsReportService.java
...le/indicators/service/report/IndicatorsReportService.java
+20
-5
DriveIndDefMapper.xml
src/main/resources/mybatis/mapping/DriveIndDefMapper.xml
+8
-0
ReportThreeMapper.xml
src/main/resources/mybatis/mapping/ReportThreeMapper.xml
+16
-1
No files found.
src/main/java/com/keymobile/indicators/model/mapper/indicators/DriveIndDefMapper.java
View file @
0b1f6dbc
...
...
@@ -26,4 +26,6 @@ public interface DriveIndDefMapper extends BaseMapper<DriveIndDef>{
public
List
<
DriveIndDef
>
getByIndFormatLike
(
@Param
(
"indId"
)
String
indId
);
public
void
deleteByIdIn
(
@Param
(
"ids"
)
List
<
String
>
ids
);
List
<
DriveIndDef
>
selectByIds
(
@Param
(
"indIds"
)
List
<
String
>
indIds
);
}
src/main/java/com/keymobile/indicators/model/mapper/report/ReportThreeMapper.java
View file @
0b1f6dbc
...
...
@@ -21,4 +21,9 @@ public interface ReportThreeMapper extends BaseMapper<IndicatorsReportThree>{
public
void
batchUpdate
(
@Param
(
"datas"
)
List
<
IndicatorsReportThree
>
datas
);
public
void
deleteByParam
(
Map
<
String
,
Object
>
param
);
List
<
IndicatorsReportThree
>
selectByParamInCompareObj
(
@Param
(
"date"
)
Integer
date
,
@Param
(
"type"
)
String
type
,
@Param
(
"code"
)
String
code
,
@Param
(
"compareCatalog"
)
String
compareCatalog
,
@Param
(
"compareObjs"
)
List
<
String
>
compareObjs
);
}
src/main/java/com/keymobile/indicators/service/report/IndicatorsReportService.java
View file @
0b1f6dbc
...
...
@@ -156,15 +156,19 @@ public class IndicatorsReportService {
**/
Map
<
String
,
Map
<
String
,
Integer
>>
rankMarkMap
=
new
HashMap
<>();
int
fourCount
=
0
;
for
(
String
indId
:
indIds
)
{
//一次性获取指标--21-05-12 hzc
List
<
DriveIndDef
>
driveIndDefs
=
driveIndDefMapper
.
selectByIds
(
indIds
);
for
(
DriveIndDef
driveIndDef
:
driveIndDefs
)
{
//报表四数据
String
indId
=
driveIndDef
.
getIndId
();
List
<
IndicatorsReportFour
>
indicatorsReportFours
=
new
ArrayList
<>();
List
<
IndicatorsReportThree
>
dataList
=
new
ArrayList
<>();
Map
<
String
,
String
>
improveValue
=
new
HashMap
<>();
//定义存储地区指标增幅,用于排名使用
String
indRule
=
null
;
String
growCalType
=
null
;
//根据indId获取指标信息
DriveIndDef
driveIndDef
=
driveIndDefMapper
.
selectByPrimaryKey
(
indId
);
//注释--21-05-12 hzc
// DriveIndDef driveIndDef = driveIndDefMapper.selectByPrimaryKey(indId);
if
(
driveIndDef
!=
null
)
{
//获取指标正反属性
indRule
=
driveIndDef
.
getIndRule
();
...
...
@@ -182,11 +186,22 @@ public class IndicatorsReportService {
**/
rankMarkMap
=
this
.
fillRankMarkMap
(
calResults
,
indRule
);
}
//一次性获取报表三数据===start--21-05-12 hzc
List
<
String
>
compareObjs
=
new
ArrayList
<>();
for
(
DriveIndCalResultDef
calResult
:
calResults
){
compareObjs
.
add
(
calResult
.
getCompareObj
());
}
Map
<
String
,
IndicatorsReportThree
>
tmp
=
new
HashMap
<>();
List
<
IndicatorsReportThree
>
threeList
=
reportThreeMapper
.
selectByParamInCompareObj
(
date
,
type
,
code
,
compareCatalog
,
compareObjs
);
for
(
IndicatorsReportThree
indicatorsReportThree
:
threeList
)
{
tmp
.
put
(
indicatorsReportThree
.
getCompareObj
(),
indicatorsReportThree
);
}
//一次性获取报表三数据===end--21-05-12 hzc
for
(
DriveIndCalResultDef
calResult
:
calResults
)
{
//判断是否存在
IndicatorsReportThree
indReportData
=
reportThreeMapper
.
getByParam
(
calResult
.
getCompareObj
(),
date
,
type
,
code
,
compareCatalog
);
// IndicatorsReportThree indReportData = reportThreeMapper.getByParam(
// calResult.getCompareObj(), date, type, code, compareCatalog);
IndicatorsReportThree
indReportData
=
tmp
.
get
(
calResult
.
getCompareObj
());
if
(
indReportData
==
null
)
{
indReportData
=
new
IndicatorsReportThree
();
}
...
...
src/main/resources/mybatis/mapping/DriveIndDefMapper.xml
View file @
0b1f6dbc
...
...
@@ -70,4 +70,11 @@
#{id}
</foreach>
</delete>
<select
id=
"selectByIds"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndDef"
>
select *
from drive_ind_def where ind_id in
<foreach
collection=
"indIds"
open=
"("
item=
"id"
close=
")"
separator=
","
>
#{id}
</foreach>
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ReportThreeMapper.xml
View file @
0b1f6dbc
...
...
@@ -11,7 +11,22 @@
code = #{code} and
compare_catalog = #{compareCatalog}
</select>
<select
id=
"selectByParamInCompareObj"
resultType=
"com.keymobile.indicators.model.entity.report.IndicatorsReportThree"
>
select *
from indicators_report_three
where
compare_date = #{date} and
compare_type = #{type} and
code = #{code} and
compare_catalog = #{compareCatalog} and
compare_obj in
<foreach
collection=
"compareObjs"
separator=
","
open=
"("
close=
")"
item=
"compareObj"
>
#{compareObj}
</foreach>
</select>
<delete
id=
"deleteByParam"
parameterType=
"map"
>
delete
from indicators_report_three
...
...
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