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
db434e16
Commit
db434e16
authored
Jul 17, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化程序,将逐条新增或修改的代码改成批量新增或者修改,提高sql执行效率
parent
67c791f7
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
557 additions
and
64 deletions
+557
-64
DriveIndIdCalActor.java
.../indicators/akka/actor/indicators/DriveIndIdCalActor.java
+14
-4
DriveIndCalResultCtrl.java
...obile/indicators/api/hytobacco/DriveIndCalResultCtrl.java
+6
-0
ShortboardUnitCtrl.java
...eymobile/indicators/api/hytobacco/ShortboardUnitCtrl.java
+1
-1
IndicatorsReportTwo.java
...e/indicators/model/entity/report/IndicatorsReportTwo.java
+10
-10
BaseIndDefMapper.java
.../indicators/model/mapper/indicators/BaseIndDefMapper.java
+2
-0
DriveIndDefMapper.java
...indicators/model/mapper/indicators/DriveIndDefMapper.java
+2
-0
BaseIndDefVersionDataMapper.java
...s/model/mapper/indmapper/BaseIndDefVersionDataMapper.java
+3
-0
DriveIndCalResultDefMapper.java
...rs/model/mapper/indmapper/DriveIndCalResultDefMapper.java
+5
-0
DriveIndDefVersionDataMapper.java
.../model/mapper/indmapper/DriveIndDefVersionDataMapper.java
+3
-0
IndScorecardMapper.java
...indicators/model/mapper/indmapper/IndScorecardMapper.java
+2
-0
ObjScoreCalResultMapper.java
...ators/model/mapper/indmapper/ObjScoreCalResultMapper.java
+6
-0
ScoreRuleMapper.java
...le/indicators/model/mapper/indmapper/ScoreRuleMapper.java
+2
-0
ShortboardRecordMapper.java
...cators/model/mapper/indmapper/ShortboardRecordMapper.java
+3
-0
ShortboardRuleMapper.java
...dicators/model/mapper/indmapper/ShortboardRuleMapper.java
+2
-0
ReportOneMapper.java
...obile/indicators/model/mapper/report/ReportOneMapper.java
+6
-0
ReportTwoMapper.java
...obile/indicators/model/mapper/report/ReportTwoMapper.java
+14
-0
BaseIndDefService.java
...obile/indicators/service/hytobacco/BaseIndDefService.java
+7
-2
BaseIndDefVersionService.java
...ndicators/service/hytobacco/BaseIndDefVersionService.java
+4
-0
DriveIndCalResultService.java
...ndicators/service/hytobacco/DriveIndCalResultService.java
+20
-0
DriveIndCatalogService.java
.../indicators/service/hytobacco/DriveIndCatalogService.java
+4
-1
DriveIndDefService.java
...bile/indicators/service/hytobacco/DriveIndDefService.java
+2
-4
DriveIndDefVersionService.java
...dicators/service/hytobacco/DriveIndDefVersionService.java
+4
-0
IndCatalogService.java
...obile/indicators/service/hytobacco/IndCatalogService.java
+4
-1
IndScorecardService.java
...ile/indicators/service/hytobacco/IndScorecardService.java
+5
-6
ScoreRuleCatalogService.java
...indicators/service/hytobacco/ScoreRuleCatalogService.java
+4
-1
ScoreRuleService.java
...mobile/indicators/service/hytobacco/ScoreRuleService.java
+24
-8
ScorecardCatalogService.java
...indicators/service/hytobacco/ScorecardCatalogService.java
+4
-1
ShortboardCatalogService.java
...ndicators/service/hytobacco/ShortboardCatalogService.java
+4
-1
ShortboardRuleService.java
...e/indicators/service/hytobacco/ShortboardRuleService.java
+1
-3
ShortboardUnitCatalogService.java
...ators/service/hytobacco/ShortboardUnitCatalogService.java
+4
-1
ShortboardUnitService.java
...e/indicators/service/hytobacco/ShortboardUnitService.java
+4
-3
IndicatorsReportService.java
...le/indicators/service/report/IndicatorsReportService.java
+77
-16
application-test.yml
src/main/resources/application-test.yml
+1
-1
BaseIndDefMapper.xml
src/main/resources/mybatis/mapping/BaseIndDefMapper.xml
+10
-0
BaseIndDefVersionDataMapper.xml
...resources/mybatis/mapping/BaseIndDefVersionDataMapper.xml
+10
-0
DriveIndCalResultDefMapper.xml
.../resources/mybatis/mapping/DriveIndCalResultDefMapper.xml
+76
-0
DriveIndDefMapper.xml
src/main/resources/mybatis/mapping/DriveIndDefMapper.xml
+10
-0
DriveIndDefVersionDataMapper.xml
...esources/mybatis/mapping/DriveIndDefVersionDataMapper.xml
+10
-0
IndScorecardMapper.xml
src/main/resources/mybatis/mapping/IndScorecardMapper.xml
+10
-0
ObjScoreCalResultMapper.xml
...ain/resources/mybatis/mapping/ObjScoreCalResultMapper.xml
+42
-0
ReportOneMapper.xml
src/main/resources/mybatis/mapping/ReportOneMapper.xml
+84
-0
ReportTwoMapper.xml
src/main/resources/mybatis/mapping/ReportTwoMapper.xml
+14
-0
ScoreRuleMapper.xml
src/main/resources/mybatis/mapping/ScoreRuleMapper.xml
+10
-0
ShortboardRecordMapper.xml
...main/resources/mybatis/mapping/ShortboardRecordMapper.xml
+17
-0
ShortboardRuleMapper.xml
src/main/resources/mybatis/mapping/ShortboardRuleMapper.xml
+10
-0
No files found.
src/main/java/com/keymobile/indicators/akka/actor/indicators/DriveIndIdCalActor.java
View file @
db434e16
...
...
@@ -124,6 +124,7 @@ public class DriveIndIdCalActor extends AbstractActor{
calIndAverageAndRankMsg
.
getDate
());
//算组内排名
Map
<
String
,
Integer
>
rankValue
=
CalculateUtils
.
rankValue
(
valueMap
,
indType
);
List
<
DriveIndCalResultDef
>
dataList
=
new
ArrayList
<>();
//填充平均数和排名到考核结果中
for
(
Entry
<
String
,
Integer
>
entry
:
rankValue
.
entrySet
())
{
//根据id获取指标值结果
...
...
@@ -133,9 +134,13 @@ public class DriveIndIdCalActor extends AbstractActor{
driveIndCalResult
.
setAverage
(
average
);
driveIndCalResult
.
setRank
(
entry
.
getValue
());
driveIndCalResult
.
setActualAverage
(
actualAverage
);
d
riveIndCalResultService
.
saveOrUpdate
(
driveIndCalResult
);
d
ataList
.
add
(
driveIndCalResult
);
}
}
//批量保存修改
driveIndCalResultService
.
batchSaveOrUpdate
(
dataList
);
//清空list
dataList
.
clear
();
//根据评分卡算指标分数
for
(
Entry
<
String
,
Integer
>
entry
:
rankValue
.
entrySet
())
{
//根据id获取指标值结果
...
...
@@ -149,11 +154,16 @@ public class DriveIndIdCalActor extends AbstractActor{
driveIndCalResult
.
getCompareId
(),
compareObjs
);
driveIndCalResult
.
setScore
(
scoreMap
.
get
(
"score"
));
driveIndCalResult
.
setImproveScore
(
scoreMap
.
get
(
"improveScore"
));
driveIndCalResultService
.
saveOrUpdate
(
driveIndCalResult
);
//整合本期同期报表数据
indiReportService
.
dealSingleReportOneData
(
driveIndCalResult
);
dataList
.
add
(
driveIndCalResult
);
}
}
//批量保存修改
driveIndCalResultService
.
batchSaveOrUpdate
(
dataList
);
//整合本期同期报表数据
indiReportService
.
dealReportOneDatas
(
dataList
);
//清空list
dataList
.
clear
();
//发送确认信息给父actor
FirstExeConfirmMsg
firstExeConfirmMsg
=
new
FirstExeConfirmMsg
(
1
,
""
,
compCalLogId
);
compareUnitCalActor
.
tell
(
firstExeConfirmMsg
,
ActorRef
.
noSender
());
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/DriveIndCalResultCtrl.java
View file @
db434e16
...
...
@@ -27,6 +27,12 @@ public class DriveIndCalResultCtrl {
@Autowired
private
CompareUnitCalLogService
compUnitCalLogService
;
@ApiOperation
(
value
=
"对标结果批量新增,修改"
,
notes
=
"对标结果批量新增,修改"
)
@PostMapping
(
value
=
"/batchSaveOrUpdate"
)
public
void
batchSaveOrUpdate
(
@RequestBody
List
<
DriveIndCalResultDef
>
calResults
)
{
driveIndCalResultService
.
batchSaveOrUpdate
(
calResults
);
}
@ApiOperation
(
value
=
"对标单元综合计算"
,
notes
=
"对标单元综合计算"
)
@PostMapping
(
value
=
"/compareUnitListCal"
)
public
void
compareUnitListCal
(
@RequestBody
List
<
CompareUnitDef
>
compareUnitList
)
{
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/ShortboardUnitCtrl.java
View file @
db434e16
...
...
@@ -108,7 +108,7 @@ public class ShortboardUnitCtrl {
@ApiOperation
(
value
=
"保存预览数据生成短板预警池数据"
,
notes
=
"保存预览数据生成短板预警池数据"
)
@PostMapping
(
value
=
"/getShortboardWarnning"
)
public
List
<
ShortboardRecord
>
getShortboardWarnning
(
@RequestParam
Integer
unitId
,
public
String
getShortboardWarnning
(
@RequestParam
Integer
unitId
,
@RequestParam
(
required
=
false
)
String
user
)
throws
Exception
{
return
shortboardUnitService
.
getShortboardObjFromUnit
(
unitId
,
user
);
}
...
...
src/main/java/com/keymobile/indicators/model/entity/report/IndicatorsReportTwo.java
View file @
db434e16
...
...
@@ -21,20 +21,20 @@ public class IndicatorsReportTwo {
private
String
indName
;
//指标名称
private
String
compareUnitId
;
//对标单元id
private
String
compareUnitName
;
//对标单元名称
private
String
compareDate
;
//对标时间
private
Integer
compareDate
;
//对标时间
private
String
compareType
;
//对标类型
private
String
unit
;
//单位
private
Double
current
Average
;
//本期全省平均值
private
Double
same
Average
;
//同期全省平均值
private
Double
averageRate
;
//全省平均分同比
private
String
currentActual
Average
;
//本期全省平均值
private
String
sameActual
Average
;
//同期全省平均值
private
String
averageRate
;
//全省平均分同比
private
String
trend
;
//全省平均分变化趋势 0:趋好 1:趋坏
private
Double
currentActual
Average
;
//本期实际平均值
private
String
current
Average
;
//本期实际平均值
private
String
bestUnit
;
//标杆单位
private
Double
bestUnitValue
;
//标杆值
private
String
bestUnitValue
;
//标杆值
private
Integer
bestAverageUnits
;
//优于平均单位数
private
Integer
sameImproveUnits
;
//同比提升单位数
private
Integer
rankHeadThree
;
//排名前三
private
Integer
rankAfterThree
;
//排名末三
private
Integer
sameImproveHeadThree
;
//同比提升前三
private
Integer
sameImproveAfterThree
;
//同比提升末三
private
String
rankHeadThree
;
//排名前三
private
String
rankAfterThree
;
//排名末三
private
String
sameImproveHeadThree
;
//同比提升前三
private
String
sameImproveAfterThree
;
//同比提升末三
}
src/main/java/com/keymobile/indicators/model/mapper/indicators/BaseIndDefMapper.java
View file @
db434e16
...
...
@@ -22,4 +22,6 @@ public interface BaseIndDefMapper extends BaseMapper<BaseIndDef>{
public
List
<
BaseIndDef
>
getByIndFormatLike
(
@Param
(
"indId"
)
String
indId
);
public
List
<
BaseIndDef
>
getByIdIn
(
@Param
(
"indIds"
)
List
<
String
>
indIds
);
public
void
deleteByIdIn
(
@Param
(
"indIds"
)
List
<
String
>
indIds
);
}
src/main/java/com/keymobile/indicators/model/mapper/indicators/DriveIndDefMapper.java
View file @
db434e16
...
...
@@ -24,4 +24,6 @@ public interface DriveIndDefMapper extends BaseMapper<DriveIndDef>{
public
List
<
DriveIndDef
>
getByScorecardId
(
@Param
(
"scorecardId"
)
Integer
scorecardId
);
public
List
<
DriveIndDef
>
getByIndFormatLike
(
@Param
(
"indId"
)
String
indId
);
public
void
deleteByIdIn
(
@Param
(
"ids"
)
List
<
String
>
ids
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/BaseIndDefVersionDataMapper.java
View file @
db434e16
...
...
@@ -14,4 +14,7 @@ public interface BaseIndDefVersionDataMapper extends BaseMapper<BaseIndDefVersio
public
List
<
BaseIndDefVersionData
>
getVersionDataByIndId
(
@Param
(
"indId"
)
String
indId
);
public
void
updateIsDeleteStatus
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"status"
)
String
status
);
public
void
updateIsDeleteStatusByIndIdIn
(
@Param
(
"indIds"
)
List
<
String
>
indIds
,
@Param
(
"status"
)
String
status
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/DriveIndCalResultDefMapper.java
View file @
db434e16
...
...
@@ -54,4 +54,9 @@ public interface DriveIndCalResultDefMapper extends BaseMapper<DriveIndCalResult
@Param
(
"date"
)
Integer
date
);
public
List
<
DriveIndCalResultDef
>
findReportData
(
@Param
(
"code"
)
String
code
);
//批量保存
public
void
batchSave
(
@Param
(
"datas"
)
List
<
DriveIndCalResultDef
>
datas
);
//批量修改
public
void
batchUpdate
(
@Param
(
"datas"
)
List
<
DriveIndCalResultDef
>
datas
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/DriveIndDefVersionDataMapper.java
View file @
db434e16
...
...
@@ -14,4 +14,7 @@ public interface DriveIndDefVersionDataMapper extends BaseMapper<DriveIndDefVers
public
List
<
DriveIndDefVersionData
>
getVersionDataByIndId
(
@Param
(
"indId"
)
String
indId
);
public
void
updateIsDeleteStatus
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"status"
)
String
status
);
public
void
updateIsDeleteStatusByIndIdIn
(
@Param
(
"indIds"
)
List
<
String
>
indIds
,
@Param
(
"status"
)
String
status
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/IndScorecardMapper.java
View file @
db434e16
...
...
@@ -20,4 +20,6 @@ public interface IndScorecardMapper extends BaseMapper<IndScorecard>{
public
List
<
IndScorecard
>
findByIdList
(
@Param
(
"ids"
)
List
<
Integer
>
ids
);
public
List
<
IndScorecard
>
findByCode
(
@Param
(
"code"
)
String
code
);
public
void
deleteByIdIn
(
@Param
(
"ids"
)
List
<
Integer
>
ids
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ObjScoreCalResultMapper.java
View file @
db434e16
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -11,4 +13,8 @@ import tk.mybatis.mapper.common.BaseMapper;
public
interface
ObjScoreCalResultMapper
extends
BaseMapper
<
ObjScoreCalResult
>{
public
ObjScoreCalResult
getObjScoreCalResultByParam
(
@Param
(
"compareId"
)
String
compareId
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
Integer
date
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
ObjScoreCalResult
>
datas
);
public
void
batchUpdate
(
@Param
(
"datas"
)
List
<
ObjScoreCalResult
>
datas
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ScoreRuleMapper.java
View file @
db434e16
...
...
@@ -20,4 +20,6 @@ public interface ScoreRuleMapper extends BaseMapper<ScoreRule>{
public
int
countByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
,
@Param
(
"keyword"
)
String
keyword
);
public
List
<
ScoreRule
>
findByIdList
(
@Param
(
"ids"
)
List
<
Integer
>
ids
);
public
void
deleteByIdIn
(
@Param
(
"ids"
)
List
<
Integer
>
ids
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ShortboardRecordMapper.java
View file @
db434e16
...
...
@@ -4,6 +4,7 @@ import java.util.List;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardRecord
;
...
...
@@ -14,4 +15,6 @@ public interface ShortboardRecordMapper extends BaseMapper<ShortboardRecord>{
public
List
<
ShortboardRecord
>
getPageByCodeIn
(
Map
<
String
,
Object
>
param
);
public
int
countByCodeIn
(
Map
<
String
,
Object
>
param
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
ShortboardRecord
>
datas
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ShortboardRuleMapper.java
View file @
db434e16
...
...
@@ -16,4 +16,6 @@ public interface ShortboardRuleMapper extends BaseMapper<ShortboardRule>{
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"start"
)
int
start
,
@Param
(
"end"
)
int
end
);
public
int
countByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
,
@Param
(
"keyword"
)
String
keyword
);
public
void
deleteByIdIn
(
@Param
(
"ids"
)
List
<
Integer
>
ids
);
}
src/main/java/com/keymobile/indicators/model/mapper/report/ReportOneMapper.java
View file @
db434e16
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
report
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -12,4 +14,8 @@ public interface ReportOneMapper extends BaseMapper<IndicatorsReportOne>{
public
IndicatorsReportOne
getByParam
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"type"
)
String
type
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
IndicatorsReportOne
>
datas
);
public
void
batchUpdate
(
@Param
(
"datas"
)
List
<
IndicatorsReportOne
>
datas
);
}
src/main/java/com/keymobile/indicators/model/mapper/report/ReportTwoMapper.java
0 → 100644
View file @
db434e16
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
report
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
com.keymobile.indicators.model.entity.report.IndicatorsReportTwo
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
ReportTwoMapper
extends
BaseMapper
<
IndicatorsReportTwo
>{
public
IndicatorsReportTwo
getDataByParam
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"compareUnitId"
)
String
compareUnitId
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"type"
)
String
type
);
}
src/main/java/com/keymobile/indicators/service/hytobacco/BaseIndDefService.java
View file @
db434e16
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -79,11 +80,11 @@ public class BaseIndDefService {
public
String
delete
(
List
<
String
>
indIds
)
throws
Exception
{
StringBuilder
message
=
new
StringBuilder
(
""
);
List
<
String
>
canDeleteList
=
new
ArrayList
<>();
for
(
String
indId
:
indIds
)
{
if
(
driveIndDefService
.
getByIndFormatLike
(
indId
).
isEmpty
()&&
this
.
getByIndFormatLike
(
indId
).
isEmpty
())
{
//基础项都没有关联指标才能删除
baseIndDefMapper
.
deleteByPrimaryKey
(
indId
);
baseIndDefVersionService
.
updateIsDeleteStatus
(
indId
,
"1"
);
//标识已删除
canDeleteList
.
add
(
indId
);
}
else
{
BaseIndDef
baseIndDef
=
this
.
getById
(
indId
);
if
(
baseIndDef
!=
null
)
{
...
...
@@ -92,6 +93,10 @@ public class BaseIndDefService {
}
}
}
if
(!
canDeleteList
.
isEmpty
())
{
baseIndDefMapper
.
deleteByIdIn
(
canDeleteList
);
baseIndDefVersionService
.
updateIsDeleteStatusByIndIdIn
(
canDeleteList
,
"1"
);
//标识已删除
}
if
(
StringUtils
.
isBlank
(
message
.
toString
()))
{
message
.
append
(
"删除成功"
);
}
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/BaseIndDefVersionService.java
View file @
db434e16
...
...
@@ -41,4 +41,8 @@ public class BaseIndDefVersionService {
public
void
updateIsDeleteStatus
(
String
indId
,
String
status
)
{
baseIndDefVersionDataMapper
.
updateIsDeleteStatus
(
indId
,
status
);
}
public
void
updateIsDeleteStatusByIndIdIn
(
List
<
String
>
indIds
,
String
status
)
{
baseIndDefVersionDataMapper
.
updateIsDeleteStatusByIndIdIn
(
indIds
,
status
);
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndCalResultService.java
View file @
db434e16
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.slf4j.Logger
;
...
...
@@ -33,6 +34,25 @@ public class DriveIndCalResultService {
return
driveIndCalResult
.
getId
();
}
//批量新增或者修改
public
void
batchSaveOrUpdate
(
List
<
DriveIndCalResultDef
>
driveIndCalResults
)
{
List
<
DriveIndCalResultDef
>
addList
=
new
ArrayList
<>();
List
<
DriveIndCalResultDef
>
updateList
=
new
ArrayList
<>();
for
(
DriveIndCalResultDef
driveIndCalResult
:
driveIndCalResults
)
{
if
(
driveIndCalResult
.
getId
()==
null
)
{
addList
.
add
(
driveIndCalResult
);
//新增list
}
else
{
updateList
.
add
(
driveIndCalResult
);
//修改list
}
}
if
(!
addList
.
isEmpty
())
{
//批量新增
driveIndCalResultDefMapper
.
batchSave
(
addList
);
}
if
(!
updateList
.
isEmpty
())
{
//批量修改
driveIndCalResultDefMapper
.
batchUpdate
(
updateList
);
}
}
public
DriveIndCalResultDef
findById
(
Integer
id
)
{
return
driveIndCalResultDefMapper
.
selectByPrimaryKey
(
id
);
}
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndCatalogService.java
View file @
db434e16
...
...
@@ -67,8 +67,11 @@ public class DriveIndCatalogService {
//递归删除
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
List
<
Integer
>
result
=
new
ArrayList
<>();
for
(
Integer
id
:
ids
)
{
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
result
.
addAll
(
this
.
getDeleteCatalogId
(
id
));
}
if
(!
result
.
isEmpty
())
{
this
.
delete
(
result
);
//删除目录关联的指标
driveIndDefMapper
.
deleteByCatalogIdIn
(
result
);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndDefService.java
View file @
db434e16
...
...
@@ -136,10 +136,8 @@ public class DriveIndDefService {
}
public
void
delete
(
List
<
String
>
indIds
)
throws
Exception
{
for
(
String
indId
:
indIds
)
{
driveIndDefMapper
.
deleteByPrimaryKey
(
indId
);
driveIndDefVersionService
.
updateIsDeleteStatus
(
indId
,
"1"
);
//标识已删除
}
driveIndDefMapper
.
deleteByIdIn
(
indIds
);
driveIndDefVersionService
.
updateIsDeleteStatusByIndIdIn
(
indIds
,
"1"
);
//标识已删除
}
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
Integer
catalogId
,
String
keyword
,
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndDefVersionService.java
View file @
db434e16
...
...
@@ -41,4 +41,8 @@ public class DriveIndDefVersionService {
public
void
updateIsDeleteStatus
(
String
indId
,
String
status
)
{
driveIndDefVersionDataMapper
.
updateIsDeleteStatus
(
indId
,
status
);
}
public
void
updateIsDeleteStatusByIndIdIn
(
List
<
String
>
indIds
,
String
status
)
{
driveIndDefVersionDataMapper
.
updateIsDeleteStatusByIndIdIn
(
indIds
,
status
);
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/IndCatalogService.java
View file @
db434e16
...
...
@@ -66,8 +66,11 @@ public class IndCatalogService {
//递归删除
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
List
<
Integer
>
result
=
new
ArrayList
<>();
for
(
Integer
id
:
ids
)
{
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
result
.
addAll
(
this
.
getDeleteCatalogId
(
id
));
}
if
(!
result
.
isEmpty
())
{
this
.
delete
(
result
);
//删除目录关联的指标
baseIndDefMapper
.
deleteByCatalogIdIn
(
result
);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/IndScorecardService.java
View file @
db434e16
...
...
@@ -73,6 +73,7 @@ public class IndScorecardService {
public
String
delete
(
List
<
Integer
>
ids
)
{
StringBuilder
message
=
new
StringBuilder
(
""
);
List
<
Integer
>
canDeleteIds
=
new
ArrayList
<>();
for
(
Integer
id
:
ids
)
{
if
(!
driveIndDefService
.
getByScorecardId
(
id
).
isEmpty
())
{
IndScorecard
scorecard
=
this
.
findById
(
id
);
...
...
@@ -81,9 +82,12 @@ public class IndScorecardService {
.
append
(
"'"
).
append
(
"关联了考核指标,无法删除;"
);
}
}
else
{
indScorecardMapper
.
deleteByPrimaryKey
(
id
);
canDeleteIds
.
add
(
id
);
}
}
if
(!
canDeleteIds
.
isEmpty
())
{
indScorecardMapper
.
deleteByIdIn
(
canDeleteIds
);
}
if
(
StringUtils
.
isBlank
(
message
.
toString
()))
{
message
.
append
(
"删除成功"
);
}
...
...
@@ -92,11 +96,6 @@ public class IndScorecardService {
public
List
<
IndScorecard
>
getAll
(
String
code
){
List
<
IndScorecard
>
scorecards
=
indScorecardMapper
.
findByCode
(
code
);
// List<IndScorecard> result = new ArrayList<>();
// for(IndScorecard scorecard : scorecards) {
// IndScorecard scorecard1 = this.changeJson(scorecard);
// result.add(scorecard1);
// }
return
scorecards
;
}
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ScoreRuleCatalogService.java
View file @
db434e16
...
...
@@ -66,8 +66,11 @@ public class ScoreRuleCatalogService {
//递归删除
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
List
<
Integer
>
result
=
new
ArrayList
<>();
for
(
Integer
id
:
ids
)
{
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
result
.
addAll
(
this
.
getDeleteCatalogId
(
id
));
}
if
(!
result
.
isEmpty
())
{
this
.
delete
(
result
);
//删除目录关联的单位评分规则
scoreRuleMapper
.
deleteByCatalogIdIn
(
result
);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ScoreRuleService.java
View file @
db434e16
...
...
@@ -61,9 +61,7 @@ public class ScoreRuleService {
}
public
void
delete
(
List
<
Integer
>
ids
)
{
for
(
Integer
id
:
ids
)
{
scoreRuleMapper
.
deleteByPrimaryKey
(
id
);
}
scoreRuleMapper
.
deleteByIdIn
(
ids
);
}
public
List
<
ScoreRule
>
getAll
(
String
code
){
...
...
@@ -104,6 +102,24 @@ public class ScoreRuleService {
return
scoreRuleMapper
.
findByIdList
(
ids
);
}
public
void
batchSaveOrUpdateObjScoreCalResult
(
List
<
ObjScoreCalResult
>
calDatas
)
{
List
<
ObjScoreCalResult
>
addList
=
new
ArrayList
<>();
//新增list
List
<
ObjScoreCalResult
>
updateList
=
new
ArrayList
<>();
//修改list
for
(
ObjScoreCalResult
calData
:
calDatas
)
{
if
(
calData
.
getId
()==
null
)
{
addList
.
add
(
calData
);
}
else
{
updateList
.
add
(
calData
);
}
}
if
(!
addList
.
isEmpty
())
{
objScoreCalResultMapper
.
batchSave
(
addList
);
}
if
(!
updateList
.
isEmpty
())
{
objScoreCalResultMapper
.
batchUpdate
(
updateList
);
}
}
//计算组内考核指标平均值
private
ObjScoreCalResult
calGroupIndAverage
(
ObjScoreCalResult
objResult
,
ScoreRule
scoreRule
,
List
<
String
>
indIds
,
String
compareObj
,
int
date
){
...
...
@@ -341,6 +357,7 @@ public class ScoreRuleService {
List
<
String
>
compareObjs
,
int
date
,
Integer
scoreRuleId
)
{
//根据单位得分评分卡id获取评分卡详情
ScoreRule
scoreRule
=
this
.
getById
(
scoreRuleId
);
List
<
ObjScoreCalResult
>
datas
=
new
ArrayList
<>();
if
(
scoreRule
!=
null
)
{
for
(
String
compareObj
:
compareObjs
)
{
//判断库表是否已存在改结果数据
...
...
@@ -361,12 +378,11 @@ public class ScoreRuleService {
compareObj
,
date
);
}
objScoreCalResult
.
setCompareId
(
compareId
);
if
(
objScoreCalResult
.
getId
()==
null
)
{
objScoreCalResultMapper
.
insert
(
objScoreCalResult
);
}
else
{
objScoreCalResultMapper
.
updateByPrimaryKey
(
objScoreCalResult
);
}
datas
.
add
(
objScoreCalResult
);
}
//批量新增或修改
this
.
batchSaveOrUpdateObjScoreCalResult
(
datas
);
}
else
{
logger
.
info
(
"单位评分卡id:"
+
scoreRuleId
+
" 不存在"
);
}
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ScorecardCatalogService.java
View file @
db434e16
...
...
@@ -66,8 +66,11 @@ public class ScorecardCatalogService {
//递归删除
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
List
<
Integer
>
result
=
new
ArrayList
<>();
for
(
Integer
id
:
ids
)
{
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
result
.
addAll
(
this
.
getDeleteCatalogId
(
id
));
}
if
(!
result
.
isEmpty
())
{
this
.
delete
(
result
);
//删除目录关联的评分卡
indScorecardMapper
.
deleteByCatalogIdIn
(
result
);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardCatalogService.java
View file @
db434e16
...
...
@@ -65,8 +65,11 @@ public class ShortboardCatalogService {
//递归删除
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
List
<
Integer
>
result
=
new
ArrayList
<>();
for
(
Integer
id
:
ids
)
{
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
result
.
addAll
(
this
.
getDeleteCatalogId
(
id
));
}
if
(!
result
.
isEmpty
())
{
this
.
delete
(
result
);
//删除目录关联的短板筛选规则
shortboardRuleMapper
.
deleteByCatalogIdIn
(
result
);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardRuleService.java
View file @
db434e16
...
...
@@ -57,9 +57,7 @@ public class ShortboardRuleService {
}
public
void
delete
(
List
<
Integer
>
ids
)
{
for
(
Integer
id
:
ids
)
{
shortboardRuleMapper
.
deleteByPrimaryKey
(
id
);
}
shortboardRuleMapper
.
deleteByIdIn
(
ids
);
}
public
Map
<
String
,
Object
>
getByCatalogId
(
Integer
catalogId
,
String
keyword
,
int
page
,
int
rows
){
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardUnitCatalogService.java
View file @
db434e16
...
...
@@ -66,8 +66,11 @@ public class ShortboardUnitCatalogService {
//递归删除
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
List
<
Integer
>
result
=
new
ArrayList
<>();
for
(
Integer
id
:
ids
)
{
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
result
.
addAll
(
this
.
getDeleteCatalogId
(
id
));
}
if
(!
result
.
isEmpty
())
{
this
.
delete
(
result
);
//删除目录关联的短板筛选规则
shortboardUnitMapper
.
deleteByCatalogIdIn
(
result
);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardUnitService.java
View file @
db434e16
...
...
@@ -79,7 +79,7 @@ public class ShortboardUnitService {
}
//保存预览数据生成短板预警池数据
public
List
<
ShortboardRecord
>
getShortboardObjFromUnit
(
Integer
id
,
String
user
)
throws
Exception
{
public
String
getShortboardObjFromUnit
(
Integer
id
,
String
user
)
throws
Exception
{
List
<
ShortboardRecord
>
result
=
new
ArrayList
<>();
ShortboardUnit
shortboardUnit
=
this
.
getById
(
id
);
//根据短板单元id获取短板单元
if
(
shortboardUnit
!=
null
)
{
...
...
@@ -113,11 +113,12 @@ public class ShortboardUnitService {
if
(!
result
.
isEmpty
())
{
for
(
ShortboardRecord
shortboardRecord
:
result
)
{
shortboardRecord
.
setShortboardUnitId
(
id
);
shortboardRecordMapper
.
insert
(
shortboardRecord
);
}
//批量保存
shortboardRecordMapper
.
batchSave
(
result
);
}
}
return
result
;
return
"保存成功"
;
}
//根据标识编码分页获取预警池短板数据
...
...
src/main/java/com/keymobile/indicators/service/report/IndicatorsReportService.java
View file @
db434e16
package
com
.
keymobile
.
indicators
.
service
.
report
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.slf4j.Logger
;
...
...
@@ -13,10 +14,12 @@ import com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
import
com.keymobile.indicators.model.entity.indicators.IndicatorsData
;
import
com.keymobile.indicators.model.entity.report.IndicatorsReportOne
;
import
com.keymobile.indicators.model.entity.report.IndicatorsReportTwo
;
import
com.keymobile.indicators.model.mapper.indicators.BaseIndDefMapper
;
import
com.keymobile.indicators.model.mapper.indicators.DriveIndDefMapper
;
import
com.keymobile.indicators.model.mapper.indmapper.DriveIndCalResultDefMapper
;
import
com.keymobile.indicators.model.mapper.report.ReportOneMapper
;
import
com.keymobile.indicators.model.mapper.report.ReportTwoMapper
;
import
com.keymobile.indicators.service.hytobacco.BaseIndDataService
;
import
com.keymobile.indicators.utils.CalculateUtils
;
...
...
@@ -27,6 +30,8 @@ public class IndicatorsReportService {
@Autowired
private
ReportOneMapper
reportOneMapper
;
@Autowired
private
ReportTwoMapper
reportTwoMapper
;
@Autowired
private
DriveIndCalResultDefMapper
driveIndCalResultDefMapper
;
@Autowired
private
DriveIndDefMapper
driveIndDefMapper
;
...
...
@@ -35,6 +40,16 @@ public class IndicatorsReportService {
@Autowired
private
BaseIndDataService
baseIndDataService
;
//保存指标本期同期结果
public
Integer
saveOrUpdateReportTwo
(
IndicatorsReportTwo
reportTwoData
)
{
if
(
reportTwoData
.
getId
()==
null
)
{
reportTwoMapper
.
insert
(
reportTwoData
);
}
else
{
reportTwoMapper
.
updateByPrimaryKey
(
reportTwoData
);
}
return
reportTwoData
.
getId
();
}
public
Integer
saveOrUpdate
(
IndicatorsReportOne
reportData
)
{
if
(
reportData
.
getId
()==
null
)
{
reportOneMapper
.
insert
(
reportData
);
...
...
@@ -44,13 +59,50 @@ public class IndicatorsReportService {
return
reportData
.
getId
();
}
public
void
batchSaveOrUpdate
(
List
<
IndicatorsReportOne
>
reportDatas
)
{
List
<
IndicatorsReportOne
>
addList
=
new
ArrayList
<>();
List
<
IndicatorsReportOne
>
updateList
=
new
ArrayList
<>();
for
(
IndicatorsReportOne
reportData
:
reportDatas
)
{
if
(
reportData
.
getId
()==
null
)
{
addList
.
add
(
reportData
);
}
else
{
updateList
.
add
(
reportData
);
}
}
if
(!
addList
.
isEmpty
())
{
//批量新增
reportOneMapper
.
batchSave
(
addList
);
}
if
(!
updateList
.
isEmpty
())
{
//批量修改
reportOneMapper
.
batchUpdate
(
updateList
);
}
}
public
void
dealDriveIndReportTwoData
(
String
compareUnitId
,
Integer
date
)
{
String
type
=
this
.
getCompareType
(
date
);
List
<
DriveIndCalResultDef
>
calDatas
=
driveIndCalResultDefMapper
.
findByCompareIdAndDate
(
compareUnitId
,
date
);
for
(
DriveIndCalResultDef
calData
:
calDatas
)
{
//判断是否存在
IndicatorsReportTwo
indReportData
=
reportTwoMapper
.
getDataByParam
(
calData
.
getIndId
(),
compareUnitId
,
date
,
type
);
if
(
indReportData
!=
null
)
{
indReportData
=
new
IndicatorsReportTwo
();
}
indReportData
.
setCompareType
(
type
);
indReportData
.
setUnit
(
calData
.
getUnit
());
//TODO:
this
.
saveOrUpdateReportTwo
(
indReportData
);
}
}
//异步执行基础项数据整合
@Async
public
void
dealBaseIndReportOneData
(
Integer
date
,
List
<
String
>
compareObjs
)
{
String
type
=
this
.
getCompareType
(
date
);
//根据条件获取基础项数据
List
<
IndicatorsData
>
indiDatas
=
baseIndDataService
.
getIndDataByParam
(
date
,
compareObjs
);
List
<
IndicatorsReportOne
>
datas
=
new
ArrayList
<>();
for
(
IndicatorsData
indiData
:
indiDatas
)
{
String
type
=
this
.
getCompareType
(
indiData
.
getDim2
());
//判断是否存在
IndicatorsReportOne
indReportData
=
reportOneMapper
.
getByParam
(
indiData
.
getIndId
(),
indiData
.
getDim1
(),
indiData
.
getDim2
(),
type
);
...
...
@@ -60,25 +112,32 @@ public class IndicatorsReportService {
indReportData
.
setCompareType
(
type
);
indReportData
.
setUnit
(
indiData
.
getUnit
());
indReportData
=
fillBaseIndiReportOneData
(
indiData
,
indReportData
);
this
.
saveOrUpdate
(
indReportData
);
datas
.
add
(
indReportData
);
}
//批量新增或修改
this
.
batchSaveOrUpdate
(
datas
);
logger
.
info
(
"完成基础项本期同期整合"
);
}
//处理单挑指标结果报表数据
public
void
dealSingleReportOneData
(
DriveIndCalResultDef
calData
)
{
String
type
=
this
.
getCompareType
(
calData
.
getDate
());
//判断是否存在
IndicatorsReportOne
indReportData
=
reportOneMapper
.
getByParam
(
calData
.
getIndId
(),
calData
.
getCompareObj
(),
calData
.
getDate
(),
type
);
if
(
indReportData
==
null
)
{
indReportData
=
new
IndicatorsReportOne
();
public
void
dealReportOneDatas
(
List
<
DriveIndCalResultDef
>
calDatas
)
{
List
<
IndicatorsReportOne
>
datas
=
new
ArrayList
<>();
for
(
DriveIndCalResultDef
calData
:
calDatas
)
{
String
type
=
this
.
getCompareType
(
calData
.
getDate
());
//判断是否存在
IndicatorsReportOne
indReportData
=
reportOneMapper
.
getByParam
(
calData
.
getIndId
(),
calData
.
getCompareObj
(),
calData
.
getDate
(),
type
);
if
(
indReportData
==
null
)
{
indReportData
=
new
IndicatorsReportOne
();
}
indReportData
.
setCode
(
calData
.
getCode
());
indReportData
.
setCompareType
(
type
);
indReportData
.
setUnit
(
calData
.
getUnit
());
indReportData
=
this
.
fillReportOneData
(
calData
,
indReportData
);
datas
.
add
(
indReportData
);
}
indReportData
.
setCode
(
calData
.
getCode
());
indReportData
.
setCompareType
(
type
);
indReportData
.
setUnit
(
calData
.
getUnit
());
indReportData
=
this
.
fillReportOneData
(
calData
,
indReportData
);
this
.
saveOrUpdate
(
indReportData
);
//批量新增或修改
this
.
batchSaveOrUpdate
(
datas
);
}
//整合指标本期同期指标报表数据
...
...
@@ -86,6 +145,7 @@ public class IndicatorsReportService {
public
String
dealReportOne
(
String
code
)
{
//获取所有考核指标结果
List
<
DriveIndCalResultDef
>
calDatas
=
driveIndCalResultDefMapper
.
findReportData
(
code
);
List
<
IndicatorsReportOne
>
datas
=
new
ArrayList
<>();
for
(
DriveIndCalResultDef
calData
:
calDatas
)
{
//判断是否存在
String
type
=
this
.
getCompareType
(
calData
.
getDate
());
...
...
@@ -98,8 +158,9 @@ public class IndicatorsReportService {
indReportData
.
setCompareType
(
type
);
indReportData
.
setUnit
(
calData
.
getUnit
());
indReportData
=
this
.
fillReportOneData
(
calData
,
indReportData
);
this
.
saveOrUpdate
(
indReportData
);
datas
.
add
(
indReportData
);
}
this
.
batchSaveOrUpdate
(
datas
);
//批量新增或修改
return
"deal indicators report one success"
;
}
...
...
src/main/resources/application-test.yml
View file @
db434e16
...
...
@@ -5,7 +5,7 @@ spring:
hibernate
:
ddl-auto
:
update
datasource
:
url
:
jdbc:mysql://139.198.127.54:9306/hyindicators?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
url
:
jdbc:mysql://139.198.127.54:9306/hyindicators?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
&allowMultiQueries=true
username
:
test
password
:
test
hikari
:
...
...
src/main/resources/mybatis/mapping/BaseIndDefMapper.xml
View file @
db434e16
...
...
@@ -55,4 +55,13 @@
#{id}
</foreach>
</select>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from base_ind_def
where ind_id in
<foreach
item=
"id"
collection=
"indIds"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/BaseIndDefVersionDataMapper.xml
View file @
db434e16
...
...
@@ -10,4 +10,13 @@
<update
id=
"updateIsDeleteStatus"
>
update base_ind_def_version_data set is_delete=#{status} where ind_id=#{indId}
</update>
<update
id=
"updateIsDeleteStatusByIndIdIn"
>
update base_ind_def_version_data
set is_delete=#{status}
where ind_id in
<foreach
item=
"id"
collection=
"indIds"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</update>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/DriveIndCalResultDefMapper.xml
View file @
db434e16
...
...
@@ -146,4 +146,79 @@
code = #{code}
order by date desc
</select>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
insert into drive_ind_cal_result_def(
compare_id, ind_id, compare_obj, compare_obj_desc, date, value, unit, type,
is_right, last_update_time, last_updater, average, rank, score, improve_score,
actual_average, code)
values
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
(
#{val.compareId}, #{val.indId}, #{val.compareObj}, #{val.compareObjDesc}, #{val.date},
#{val.value},#{val.unit},#{val.type},#{val.isRight},#{val.lastUpdateTime},#{val.lastUpdater},
#{val.average},#{val.rank},#{val.score},#{val.improveScore},#{val.actualAverage},#{val.code}
)
</foreach>
</insert>
<update
id=
"batchUpdate"
parameterType=
"java.util.List"
>
<foreach
collection=
"datas"
item=
"val"
index=
"index"
separator=
";"
>
update drive_ind_cal_result_def
<set>
<if
test=
"val.compareId != null"
>
compare_id = #{val.compareId},
</if>
<if
test=
"val.indId != null"
>
ind_id = #{val.indId},
</if>
<if
test=
"val.compareObj != null"
>
compare_obj = #{val.compareObj},
</if>
<if
test=
"val.compareObjDesc != null"
>
compare_obj_desc = #{val.compareObjDesc},
</if>
<if
test=
"val.date != null"
>
date = #{val.date},
</if>
<if
test=
"val.value != null"
>
value = #{val.value},
</if>
<if
test=
"val.unit != null"
>
unit = #{val.unit},
</if>
<if
test=
"val.type != null"
>
type = #{val.type},
</if>
<if
test=
"val.isRight != null"
>
is_right = #{val.isRight},
</if>
<if
test=
"val.lastUpdateTime != null"
>
last_update_time = #{val.lastUpdateTime},
</if>
<if
test=
"val.lastUpdater != null"
>
last_updater = #{val.lastUpdater},
</if>
<if
test=
"val.average != null"
>
average = #{val.average},
</if>
<if
test=
"val.rank != null"
>
rank = #{val.rank},
</if>
<if
test=
"val.score != null"
>
score = #{val.score},
</if>
<if
test=
"val.improveScore != null"
>
improve_score = #{val.improveScore},
</if>
<if
test=
"val.actualAverage != null"
>
actual_average = #{val.actualAverage},
</if>
<if
test=
"val.code != null"
>
code = #{val.code},
</if>
</set>
where id = ${val.id}
</foreach>
</update>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/DriveIndDefMapper.xml
View file @
db434e16
...
...
@@ -61,4 +61,13 @@
from drive_ind_def
where ind_format like #{indId}
</select>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from drive_ind_def
where ind_id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/DriveIndDefVersionDataMapper.xml
View file @
db434e16
...
...
@@ -10,4 +10,13 @@
<update
id=
"updateIsDeleteStatus"
>
update drive_ind_def_version_data set is_delete=#{status} where ind_id=#{indId}
</update>
<update
id=
"updateIsDeleteStatusByIndIdIn"
>
update drive_ind_def_version_data
set is_delete=#{status}
where ind_id in
<foreach
item=
"id"
collection=
"indIds"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</update>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/IndScorecardMapper.xml
View file @
db434e16
...
...
@@ -43,4 +43,13 @@
from drive_ind_score_card
where code = #{code}
</select>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from drive_ind_score_card
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ObjScoreCalResultMapper.xml
View file @
db434e16
...
...
@@ -8,4 +8,45 @@
compare_obj=#{compareObj} and
date=#{date}
</select>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
insert into obj_score_cal_result(
compare_id, compare_obj, compare_obj_desc, ind_ids, date, score_value, improve_value)
values
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
(
#{val.compareId}, #{val.compareObj}, #{val.compareObjDesc}, #{val.indIds}, #{val.date},
#{val.scoreValue},#{val.improveValue})
</foreach>
</insert>
<update
id=
"batchUpdate"
parameterType=
"java.util.List"
>
<foreach
collection=
"datas"
item=
"val"
separator=
";"
>
update obj_score_cal_result
<set>
<if
test=
"val.compareId != null"
>
compare_id = #{val.compareId},
</if>
<if
test=
"val.compareObj != null"
>
compare_obj = #{val.compareObj},
</if>
<if
test=
"val.compareObjDesc != null"
>
compare_obj_desc = #{val.compareObjDesc},
</if>
<if
test=
"val.indIds != null"
>
ind_ids = #{val.indIds},
</if>
<if
test=
"val.date != null"
>
date = #{val.date},
</if>
<if
test=
"val.scoreValue != null"
>
score_value = #{val.scoreValue},
</if>
<if
test=
"val.improveValue != null"
>
improve_value = #{val.improveValue},
</if>
</set>
where id = ${val.id}
</foreach>
</update>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ReportOneMapper.xml
View file @
db434e16
...
...
@@ -10,4 +10,87 @@
compare_date = #{date} and
compare_type = #{type}
</select>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
insert into indicators_report_one(
ind_id, ind_name, compare_obj, compare_obj_desc, compare_date, compare_type, unit, depart,
catalog_type, current_value, last_same_value, value_rate, current_rank, last_same_rank,
current_score, current_improve, last_same_score, last_same_improve, code)
values
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
(
#{val.indId}, #{val.indName}, #{val.compareObj}, #{val.compareObjDesc}, #{val.compareDate},
#{val.compareType},#{val.unit},#{val.depart},#{val.catalogType},#{val.currentValue},
#{val.lastSameValue},#{val.valueRate},#{val.currentRank},#{val.lastSameRank},
#{val.currentScore},#{val.currentImprove},#{val.lastSameScore},#{val.lastSameImprove},
#{val.code}
)
</foreach>
</insert>
<update
id=
"batchUpdate"
parameterType=
"java.util.List"
>
<foreach
collection=
"datas"
item=
"val"
separator=
";"
>
update indicators_report_one
<set>
<if
test=
"val.indId != null"
>
ind_id = #{val.indId},
</if>
<if
test=
"val.indName != null"
>
ind_name = #{val.indName},
</if>
<if
test=
"val.compareObj != null"
>
compare_obj = #{val.compareObj},
</if>
<if
test=
"val.compareObjDesc != null"
>
compare_obj_desc = #{val.compareObjDesc},
</if>
<if
test=
"val.compareDate != null"
>
compare_date = #{val.compareDate},
</if>
<if
test=
"val.compareType != null"
>
compare_type = #{val.compareType},
</if>
<if
test=
"val.unit != null"
>
unit = #{val.unit},
</if>
<if
test=
"val.depart != null"
>
depart = #{val.depart},
</if>
<if
test=
"val.catalogType != null"
>
catalog_type = #{val.catalogType},
</if>
<if
test=
"val.currentValue != null"
>
current_value = #{val.currentValue},
</if>
<if
test=
"val.lastSameValue != null"
>
last_same_value = #{val.lastSameValue},
</if>
<if
test=
"val.valueRate != null"
>
value_rate = #{val.valueRate},
</if>
<if
test=
"val.currentRank != null"
>
current_rank = #{val.currentRank},
</if>
<if
test=
"val.lastSameRank != null"
>
last_same_rank = #{val.lastSameRank},
</if>
<if
test=
"val.currentScore != null"
>
current_score = #{val.currentScore},
</if>
<if
test=
"val.currentImprove != null"
>
current_improve = #{val.currentImprove},
</if>
<if
test=
"val.lastSameScore != null"
>
last_same_score = #{val.lastSameScore},
</if>
<if
test=
"val.lastSameImprove != null"
>
last_same_improve = #{val.lastSameImprove},
</if>
<if
test=
"val.code != null"
>
code = #{val.code},
</if>
</set>
where id = ${val.id}
</foreach>
</update>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ReportTwoMapper.xml
0 → 100644
View file @
db434e16
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.report.ReportTwoMapper"
>
<select
id=
"getDataByParam"
resultType=
"com.keymobile.indicators.model.entity.report.IndicatorsReportTwo"
>
select *
from indicators_report_two
where
ind_id = #{indId} and
compare_unit_id = #{compareUnitId} and
compare_date = #{date} and
compare_type = #{type}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ScoreRuleMapper.xml
View file @
db434e16
...
...
@@ -43,4 +43,13 @@
#{id}
</foreach>
</select>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from obj_score_rule
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ShortboardRecordMapper.xml
View file @
db434e16
...
...
@@ -20,4 +20,20 @@
#{id}
</foreach>
</select>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
insert into short_board_record(
shortboard_unit_id, compare_obj, drive_id, drive_name, value, date, compare_cal_result_json,
shortboard_rule_ids, shortboard_name, shortboard_desc, shortboard_type, is_issue, code,
last_updater, last_update_time)
values
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
(
#{val.shortboardUnitId}, #{val.compareObj}, #{val.driveId}, #{val.driveName}, #{val.value},
#{val.date},#{val.compareCalResultJson},#{val.shortboardRuleIds},#{val.shortboardName},
#{val.shortboardDesc},#{val.shortboardType},#{val.isIssue},#{val.code},#{val.lastUpdater},
#{val.lastUpdateTime}
)
</foreach>
</insert>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ShortboardRuleMapper.xml
View file @
db434e16
...
...
@@ -28,4 +28,13 @@
#{id}
</foreach>
</delete>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from short_board_rule
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
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