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
201c94f9
Commit
201c94f9
authored
Jun 14, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改指标评分卡到mysql库表
parent
8b50a32f
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
314 additions
and
206 deletions
+314
-206
DriveIndCalculateRegionActor.java
...ors/akka/actor/specific/DriveIndCalculateRegionActor.java
+1
-1
IndCatalogCtrl.java
...om/keymobile/indicators/api/hytobacco/IndCatalogCtrl.java
+4
-4
IndScorecardCtrl.java
.../keymobile/indicators/api/hytobacco/IndScorecardCtrl.java
+8
-9
DriveIndCalResultDef.java
...icators/model/entity/indicators/DriveIndCalResultDef.java
+3
-0
DriveIndCatalog.java
...e/indicators/model/entity/indicators/DriveIndCatalog.java
+9
-12
IndCatalog.java
...mobile/indicators/model/entity/indicators/IndCatalog.java
+3
-0
IndicatorsData.java
...le/indicators/model/entity/indicators/IndicatorsData.java
+3
-0
IndScorecard.java
...obile/indicators/model/entity/scorecard/IndScorecard.java
+24
-32
ScorecardCatalog.java
...e/indicators/model/entity/scorecard/ScorecardCatalog.java
+9
-13
DriveIndDefMapper.java
...indicators/model/mapper/indicators/DriveIndDefMapper.java
+1
-1
DriveIndCatalogMapper.java
...icators/model/mapper/indmapper/DriveIndCatalogMapper.java
+19
-0
DriveIndDefVersionDataMapper.java
.../model/mapper/indmapper/DriveIndDefVersionDataMapper.java
+3
-0
IndCatalogMapper.java
...e/indicators/model/mapper/indmapper/IndCatalogMapper.java
+3
-1
IndScorecardMapper.java
...indicators/model/mapper/indmapper/IndScorecardMapper.java
+20
-0
ScorecardCatalogMapper.java
...cators/model/mapper/indmapper/ScorecardCatalogMapper.java
+20
-0
DriveIndCatalogRepository.java
...s/persistence/hyindicators/DriveIndCatalogRepository.java
+0
-15
IndScorecardRepository.java
...tors/persistence/hyindicators/IndScorecardRepository.java
+0
-15
ScorecardCatalogRepository.java
.../persistence/hyindicators/ScorecardCatalogRepository.java
+0
-14
DriveIndCalResultService.java
...ndicators/service/hytobacco/DriveIndCalResultService.java
+1
-3
DriveIndCatalogService.java
.../indicators/service/hytobacco/DriveIndCatalogService.java
+26
-27
IndCatalogService.java
...obile/indicators/service/hytobacco/IndCatalogService.java
+3
-8
IndScorecardService.java
...ile/indicators/service/hytobacco/IndScorecardService.java
+38
-21
ScorecardCatalogService.java
...indicators/service/hytobacco/ScorecardCatalogService.java
+30
-30
DriveIndCatalogMapper.xml
src/main/resources/mybatis/mapping/DriveIndCatalogMapper.xml
+30
-0
IndScorecardMapper.xml
src/main/resources/mybatis/mapping/IndScorecardMapper.xml
+26
-0
ScorecardCatalogMapper.xml
...main/resources/mybatis/mapping/ScorecardCatalogMapper.xml
+30
-0
No files found.
src/main/java/com/keymobile/indicators/akka/actor/specific/DriveIndCalculateRegionActor.java
View file @
201c94f9
...
...
@@ -114,7 +114,7 @@ public class DriveIndCalculateRegionActor extends AbstractActor{
//计算分数
Map
<
String
,
String
>
scoreMap
=
indScorecardService
.
calculateIndiScore
(
driveIndCalResult
.
getIndId
(),
driveIndCalResult
.
getDate
(),
driveIndCalResult
.
getCompareObj
(),
markType
,
driveIndCalResult
.
getCompareObj
(),
Integer
.
parseInt
(
markType
)
,
driveIndCalResult
.
getCompareId
(),
compareObjs
);
driveIndCalResult
.
setScore
(
scoreMap
.
get
(
"score"
));
driveIndCalResult
.
setImproveScore
(
scoreMap
.
get
(
"improveScore"
));
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/IndCatalogCtrl.java
View file @
201c94f9
...
...
@@ -28,7 +28,7 @@ public class IndCatalogCtrl {
@ApiOperation
(
value
=
"新建基础指标目录"
,
notes
=
"新建基础指标目录"
)
@PostMapping
(
value
=
"/createBaseIndCatalog"
)
public
int
createBaseIndCatalog
(
@RequestBody
IndCatalog
indCatalog
)
throws
Exception
{
public
Integer
createBaseIndCatalog
(
@RequestBody
IndCatalog
indCatalog
)
throws
Exception
{
indCatalog
=
indCatalogService
.
saveOrUpdate
(
indCatalog
);
return
indCatalog
.
getId
();
}
...
...
@@ -49,20 +49,20 @@ public class IndCatalogCtrl {
//考核指标目录
@ApiOperation
(
value
=
"新建考核指标目录"
,
notes
=
"新建考核指标目录"
)
@PostMapping
(
value
=
"/createDriveIndCatalog"
)
public
String
createDriveIndCatalog
(
@RequestBody
DriveIndCatalog
driveIndCatalog
)
throws
Exception
{
public
Integer
createDriveIndCatalog
(
@RequestBody
DriveIndCatalog
driveIndCatalog
)
throws
Exception
{
driveIndCatalog
=
driveIndCatalogService
.
saveOrUpdate
(
driveIndCatalog
);
return
driveIndCatalog
.
getId
();
}
@ApiOperation
(
value
=
"批量级联删除考核指标目录"
,
notes
=
"批量级联删除考核指标目录"
)
@PostMapping
(
value
=
"/deleteDriveIndCatalog"
)
public
void
deleteDriveIndCatalog
(
@RequestParam
List
<
String
>
ids
)
throws
Exception
{
public
void
deleteDriveIndCatalog
(
@RequestParam
List
<
Integer
>
ids
)
throws
Exception
{
driveIndCatalogService
.
recursionDelete
(
ids
);
}
@ApiOperation
(
value
=
"获取考核指标目录"
,
notes
=
"获取考核指标目录"
)
@PostMapping
(
value
=
"/getDriveIndCatalog"
)
public
List
<
DriveIndCatalog
>
getDriveIndCatalog
(
@RequestParam
(
required
=
false
)
String
parentId
,
public
List
<
DriveIndCatalog
>
getDriveIndCatalog
(
@RequestParam
(
required
=
false
)
Integer
parentId
,
@RequestParam
List
<
String
>
codes
){
return
driveIndCatalogService
.
getCatalog
(
parentId
,
codes
);
}
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/IndScorecardCtrl.java
View file @
201c94f9
...
...
@@ -4,7 +4,6 @@ import java.util.List;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -30,34 +29,34 @@ public class IndScorecardCtrl {
@ApiOperation
(
value
=
"新增/修改评分卡目录"
,
notes
=
"新增/修改评分卡目录"
)
@PostMapping
(
value
=
"/saveOrUpdateCatalog"
)
public
String
saveOrUpdateCatalog
(
@RequestBody
ScorecardCatalog
scorecardCatalog
)
throws
Exception
{
public
Integer
saveOrUpdateCatalog
(
@RequestBody
ScorecardCatalog
scorecardCatalog
)
throws
Exception
{
scorecardCatalog
=
scorecardCatalogService
.
saveOrUpdate
(
scorecardCatalog
);
return
scorecardCatalog
.
getId
();
}
@ApiOperation
(
value
=
"批量级联删除评分卡目录"
,
notes
=
"批量级联删除评分卡目录"
)
@PostMapping
(
value
=
"/deleteCatalog"
)
public
void
deleteCatalog
(
@RequestParam
List
<
String
>
ids
)
throws
Exception
{
public
void
deleteCatalog
(
@RequestParam
List
<
Integer
>
ids
)
throws
Exception
{
scorecardCatalogService
.
recursionDelete
(
ids
);
}
@ApiOperation
(
value
=
"获取评分卡目录"
,
notes
=
"获取评分卡目录"
)
@PostMapping
(
value
=
"/getCatalog"
)
public
List
<
ScorecardCatalog
>
getCatalog
(
@RequestParam
(
required
=
false
)
String
parentId
,
public
List
<
ScorecardCatalog
>
getCatalog
(
@RequestParam
(
required
=
false
)
Integer
parentId
,
@RequestParam
List
<
String
>
codes
){
return
scorecardCatalogService
.
getCatalog
(
parentId
,
codes
);
}
@ApiOperation
(
value
=
"新增/修改"
,
notes
=
"新增/修改"
)
@PostMapping
(
value
=
"/saveOrUpdate"
)
public
String
saveOrUpdate
(
@RequestBody
IndScorecard
indScorecard
,
@RequestParam
String
catalogId
,
public
Integer
saveOrUpdate
(
@RequestBody
IndScorecard
indScorecard
,
@RequestParam
Integer
catalogId
,
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
{
return
indScorecardService
.
saveOrUpdate
(
indScorecard
,
catalogId
,
catalogIdPath
,
user
);
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@PostMapping
(
value
=
"/delete"
)
public
void
delete
(
@RequestBody
List
<
String
>
ids
)
{
public
void
delete
(
@RequestBody
List
<
Integer
>
ids
)
{
indScorecardService
.
delete
(
ids
);
}
...
...
@@ -69,7 +68,7 @@ public class IndScorecardCtrl {
@ApiOperation
(
value
=
"根据评分卡目录获取评分卡"
,
notes
=
"根据评分卡目录获取评分卡"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
public
Page
<
IndScorecard
>
getByCatalogId
(
@RequestParam
String
catalogId
,
public
Map
<
String
,
Object
>
getByCatalogId
(
@RequestParam
Integer
catalogId
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
return
indScorecardService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
...
...
@@ -77,14 +76,14 @@ public class IndScorecardCtrl {
@ApiOperation
(
value
=
"根据id获取评分卡"
,
notes
=
"根据id获取评分卡"
)
@PostMapping
(
value
=
"/findById"
)
public
IndScorecard
findById
(
@RequestParam
String
id
)
{
public
IndScorecard
findById
(
@RequestParam
Integer
id
)
{
return
indScorecardService
.
findById
(
id
);
}
@ApiOperation
(
value
=
"根据评分卡计算指标分数"
,
notes
=
"根据评分卡计算指标分数"
)
@PostMapping
(
value
=
"/calculateIndiScore"
)
public
Map
<
String
,
String
>
calculateIndiScore
(
@RequestParam
String
indId
,
@RequestParam
int
date
,
@RequestParam
String
compareObj
,
@RequestParam
String
indScorecardId
,
@RequestParam
String
compareObj
,
@RequestParam
Integer
indScorecardId
,
@RequestParam
String
compareId
,
@RequestBody
List
<
String
>
compareObjs
)
throws
Exception
{
return
indScorecardService
.
calculateIndiScore
(
indId
,
date
,
compareObj
,
indScorecardId
,
compareId
,
compareObjs
);
...
...
src/main/java/com/keymobile/indicators/model/entity/indicators/DriveIndCalResultDef.java
View file @
201c94f9
...
...
@@ -2,6 +2,8 @@ package com.keymobile.indicators.model.entity.indicators;
import
java.util.Date
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
...
...
@@ -16,6 +18,7 @@ import lombok.Data;
@Table
(
name
=
"drive_ind_cal_result_def"
)
public
class
DriveIndCalResultDef
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
compareId
;
...
...
src/main/java/com/keymobile/indicators/model/entity/indicators/DriveIndCatalog.java
View file @
201c94f9
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
java.io.Serializable
;
import
java.util.Date
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
...
...
@@ -14,19 +15,15 @@ import lombok.Data;
*author:zhangkb time:2020-5-18 desc:考核指标目录
*/
@Data
@Document
(
collection
=
"drive_ind_catalog"
)
public
class
DriveIndCatalog
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Table
(
name
=
"drive_ind_catalog"
)
public
class
DriveIndCatalog
{
@Id
private
String
id
;
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
catalogName
;
//private String type;
private
String
catalogType
;
//分为数据项级别和数据项类别 0:数据项级别 1:数据项类别 2:普通目录
private
String
parentId
;
//顶层节点parentId为0
private
Integer
parentId
;
//顶层节点parentId为0
private
String
idPath
;
private
String
code
;
//目录编码
private
String
lastUpdater
;
...
...
src/main/java/com/keymobile/indicators/model/entity/indicators/IndCatalog.java
View file @
201c94f9
...
...
@@ -2,6 +2,8 @@ package com.keymobile.indicators.model.entity.indicators;
import
java.util.Date
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
...
...
@@ -16,6 +18,7 @@ import lombok.Data;
@Table
(
name
=
"base_ind_catalog"
)
public
class
IndCatalog
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
catalogName
;
//private String type;
...
...
src/main/java/com/keymobile/indicators/model/entity/indicators/IndicatorsData.java
View file @
201c94f9
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
...
...
@@ -12,6 +14,7 @@ import lombok.Data;
@Table
(
name
=
"indi_data_def"
)
public
class
IndicatorsData
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
indId
;
...
...
src/main/java/com/keymobile/indicators/model/entity/scorecard/IndScorecard.java
View file @
201c94f9
package
com
.
keymobile
.
indicators
.
model
.
entity
.
scorecard
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
...
...
@@ -16,48 +16,40 @@ import lombok.Data;
*author:zhangkb time:2020-5-6 desc:考核指标评分卡
*/
@Data
@Document
(
collection
=
"drive_ind_score_card"
)
public
class
IndScorecard
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Table
(
name
=
"drive_ind_score_card"
)
public
class
IndScorecard
{
@Id
private
String
id
;
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
cardName
;
private
String
d
esc
;
private
String
cardD
esc
;
private
String
scoreType
;
//综合评分类型 0:定义 1:公式
//定义综合评价
private
double
indBaseScore
;
//基础分
private
double
moreAverage
;
//大于组内平均分加分
private
double
lessAverage
;
//小于组内平均分减分
private
Double
indBaseScore
;
//基础分
private
Double
moreAverage
;
//大于组内平均分加分
private
Double
lessAverage
;
//小于组内平均分减分
private
String
addScoreItemJson
;
//加分项json
private
String
minusScoreItemJson
;
//减分项json
private
List
<
RankScoreDef
>
addScoreItem
=
new
ArrayList
<>();
//加分项
private
List
<
RankScoreDef
>
minusScoreItem
=
new
ArrayList
<>();
//减分项
//公式综合评价
private
d
ouble
bestIndScore
;
//最佳指标分
private
d
ouble
worstIndScore
;
//最差指标分
private
D
ouble
bestIndScore
;
//最佳指标分
private
D
ouble
worstIndScore
;
//最差指标分
private
String
otherCalFormula
;
//其他计算公式
//改善提升
private
String
isIncluScore
;
//是否纳入单位计分 0:不纳入 1:纳入
private
double
limitScore
;
//上限分数
private
Double
limitScore
;
//上限分数
private
String
improveScoreItemJson
;
//改善提升分数json
private
List
<
ImproveScoreDef
>
improveScoreItem
=
new
ArrayList
<>();
//改善提升分数
private
String
catalogId
;
//评分卡目录id
private
Integer
catalogId
;
//评分卡目录id
private
String
catalogIdPath
;
//评分卡目录idPath
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
private
String
lastUpdater
;
public
void
setAddScoreItem
(
List
<
RankScoreDef
>
addScoreItem
)
{
this
.
addScoreItem
.
addAll
(
addScoreItem
);
}
public
void
setMinusScoreItem
(
List
<
RankScoreDef
>
minusScoreItem
)
{
this
.
minusScoreItem
.
addAll
(
minusScoreItem
);
}
public
void
setImproveScoreItem
(
List
<
ImproveScoreDef
>
improveScoreItem
)
{
this
.
improveScoreItem
.
addAll
(
improveScoreItem
);
}
}
src/main/java/com/keymobile/indicators/model/entity/scorecard/ScorecardCatalog.java
View file @
201c94f9
package
com
.
keymobile
.
indicators
.
model
.
entity
.
scorecard
;
import
java.io.Serializable
;
import
java.util.Date
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
...
...
@@ -14,18 +14,14 @@ import lombok.Data;
*author:zhangkb time:2020-6-9 desc:指标评分卡目录实体
*/
@Data
@Document
(
collection
=
"score_card_catalog"
)
public
class
ScorecardCatalog
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Table
(
name
=
"score_card_catalog"
)
public
class
ScorecardCatalog
{
@Id
private
String
id
;
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
catalogName
;
private
String
catalogType
;
private
String
parentId
;
//顶层节点parentId为0
private
Integer
parentId
;
//顶层节点parentId为0
private
String
idPath
;
private
String
code
;
//目录编码
private
String
lastUpdater
;
...
...
src/main/java/com/keymobile/indicators/model/mapper/indicators/DriveIndDefMapper.java
View file @
201c94f9
...
...
@@ -15,5 +15,5 @@ public interface DriveIndDefMapper extends BaseMapper<DriveIndDef>{
public
int
getByKeywordCount
(
Map
<
String
,
Object
>
param
);
public
void
deleteByCatalogIdIn
(
List
<
String
>
catalogIds
);
public
void
deleteByCatalogIdIn
(
List
<
Integer
>
catalogIds
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/DriveIndCatalogMapper.java
0 → 100644
View file @
201c94f9
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCatalog
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
DriveIndCatalogMapper
extends
BaseMapper
<
DriveIndCatalog
>{
public
void
deleteByIdIn
(
List
<
Integer
>
ids
);
public
List
<
DriveIndCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
Map
<
String
,
Object
>
params
);
public
List
<
DriveIndCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/DriveIndDefVersionDataMapper.java
View file @
201c94f9
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
DriveIndDefVersionDataMapper
extends
BaseMapper
<
DriveIndDefVersionData
>{
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/IndCatalogMapper.java
View file @
201c94f9
...
...
@@ -3,11 +3,13 @@ package com.keymobile.indicators.model.mapper.indmapper;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.indicators.IndCatalog
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
IndCatalogMapper
extends
BaseMapper
<
IndCatalog
>{
public
void
deleteByIdIn
(
List
<
Integer
>
ids
);
...
...
src/main/java/com/keymobile/indicators/model/mapper/indmapper/IndScorecardMapper.java
0 → 100644
View file @
201c94f9
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.scorecard.IndScorecard
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
IndScorecardMapper
extends
BaseMapper
<
IndScorecard
>{
public
void
deleteByCatalogIdIn
(
List
<
Integer
>
catalogIds
);
public
List
<
IndScorecard
>
findByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
,
@Param
(
"start"
)
int
start
,
@Param
(
"end"
)
int
end
);
public
int
countByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ScorecardCatalogMapper.java
0 → 100644
View file @
201c94f9
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.scorecard.ScorecardCatalog
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
ScorecardCatalogMapper
extends
BaseMapper
<
ScorecardCatalog
>{
public
void
deleteByIdIn
(
List
<
Integer
>
ids
);
public
List
<
ScorecardCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
Map
<
String
,
Object
>
params
);
public
List
<
ScorecardCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/DriveIndCatalogRepository.java
deleted
100644 → 0
View file @
8b50a32f
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCatalog
;
public
interface
DriveIndCatalogRepository
extends
MongoRepository
<
DriveIndCatalog
,
String
>{
public
void
deleteByIdIn
(
List
<
String
>
ids
);
public
List
<
DriveIndCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
String
pid
,
List
<
String
>
codes
);
public
List
<
DriveIndCatalog
>
findByParentId
(
String
pid
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/IndScorecardRepository.java
deleted
100644 → 0
View file @
8b50a32f
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.scorecard.IndScorecard
;
public
interface
IndScorecardRepository
extends
MongoRepository
<
IndScorecard
,
String
>{
public
void
deleteByCatalogIdIn
(
List
<
String
>
catalogIds
);
public
Page
<
IndScorecard
>
findByCatalogId
(
String
catalogId
,
Pageable
page
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/ScorecardCatalogRepository.java
deleted
100644 → 0
View file @
8b50a32f
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.scorecard.ScorecardCatalog
;
public
interface
ScorecardCatalogRepository
extends
MongoRepository
<
ScorecardCatalog
,
String
>{
public
void
deleteByIdIn
(
List
<
String
>
ids
);
public
List
<
ScorecardCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
String
pid
,
List
<
String
>
codes
);
public
List
<
ScorecardCatalog
>
findByParentId
(
String
pid
);
}
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndCalResultService.java
View file @
201c94f9
...
...
@@ -30,9 +30,7 @@ public class DriveIndCalResultService {
}
public
DriveIndCalResultDef
findById
(
Integer
id
)
{
DriveIndCalResultDef
driveCalResultDef
=
new
DriveIndCalResultDef
();
driveCalResultDef
.
setId
(
id
);
return
driveIndCalResultDefMapper
.
selectOne
(
driveCalResultDef
);
return
driveIndCalResultDefMapper
.
selectByPrimaryKey
(
id
);
}
public
DriveIndCalResultDef
findCompareObjInfo
(
String
driveIndId
,
int
date
,
String
compareObj
)
{
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndCatalogService.java
View file @
201c94f9
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Optional
;
import
org.apache.commons.lang.StringUtils
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -12,50 +11,50 @@ import org.springframework.stereotype.Service;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCatalog
;
import
com.keymobile.indicators.model.mapper.indicators.DriveIndDefMapper
;
import
com.keymobile.indicators.
persistence.hyindicators.DriveIndCatalogRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.DriveIndCatalogMapper
;
@Service
public
class
DriveIndCatalogService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
DriveIndCatalogService
.
class
);
@Autowired
private
DriveIndCatalog
Repository
driveIndCatalogRepo
;
private
DriveIndCatalog
Mapper
driveIndCatalogMapper
;
@Autowired
private
DriveIndDefMapper
driveIndDefMapper
;
public
DriveIndCatalog
saveOrUpdate
(
DriveIndCatalog
driveIndCatalog
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
driveIndCatalog
.
getId
())
)
{
//新增
if
(
driveIndCatalog
.
getId
()==
null
)
{
//新增
//保存
driveIndCatalog
=
driveIndCatalogRepo
.
save
(
driveIndCatalog
);
driveIndCatalog
Mapper
.
insert
(
driveIndCatalog
);
}
//获取parentId拼接idPath
String
parentId
=
driveIndCatalog
.
getParentId
();
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
)
)
{
//顶层节点
driveIndCatalog
.
setIdPath
(
driveIndCatalog
.
getId
(
));
Integer
parentId
=
driveIndCatalog
.
getParentId
();
if
(
parentId
==
0
)
{
//顶层节点
driveIndCatalog
.
setIdPath
(
String
.
valueOf
(
driveIndCatalog
.
getId
()
));
}
else
{
Optional
<
DriveIndCatalog
>
parentDriveIndCatalog
=
driveIndCatalogRepo
.
findById
(
driveIndCatalog
.
getParentId
());
if
(
!
parentDriveIndCatalog
.
isPresent
()
)
{
DriveIndCatalog
parentDriveIndCatalog
=
driveIndCatalogMapper
.
selectByPrimaryKey
(
driveIndCatalog
.
getParentId
());
if
(
parentDriveIndCatalog
==
null
)
{
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
}
else
{
driveIndCatalog
.
setIdPath
(
parentDriveIndCatalog
.
get
().
get
IdPath
()+
";"
+
driveIndCatalog
.
setIdPath
(
parentDriveIndCatalog
.
getIdPath
()+
";"
+
driveIndCatalog
.
getId
());
}
}
//保存
driveIndCatalog
=
driveIndCatalogRepo
.
save
(
driveIndCatalog
);
driveIndCatalog
Mapper
.
updateByPrimaryKey
(
driveIndCatalog
);
return
driveIndCatalog
;
}
public
void
delete
(
List
<
String
>
ids
)
{
driveIndCatalog
Repo
.
deleteByIdIn
(
ids
);
public
void
delete
(
List
<
Integer
>
ids
)
{
driveIndCatalog
Mapper
.
deleteByIdIn
(
ids
);
}
//递归查找父目录下的子目录
public
List
<
String
>
getDeleteCatalogId
(
String
id
){
List
<
String
>
result
=
new
ArrayList
<>();
public
List
<
Integer
>
getDeleteCatalogId
(
Integer
id
){
List
<
Integer
>
result
=
new
ArrayList
<>();
result
.
add
(
id
);
//根据id获取子节点
List
<
DriveIndCatalog
>
children
=
driveIndCatalog
Repo
.
findByParentId
(
id
);
List
<
DriveIndCatalog
>
children
=
driveIndCatalog
Mapper
.
findByParentId
(
id
);
if
(!
children
.
isEmpty
())
{
for
(
DriveIndCatalog
child
:
children
)
{
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
...
...
@@ -65,9 +64,9 @@ public class DriveIndCatalogService {
}
//递归删除
public
void
recursionDelete
(
List
<
String
>
ids
)
{
for
(
String
id
:
ids
)
{
List
<
String
>
result
=
this
.
getDeleteCatalogId
(
id
);
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
for
(
Integer
id
:
ids
)
{
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
this
.
delete
(
result
);
//删除目录关联的指标
driveIndDefMapper
.
deleteByCatalogIdIn
(
result
);
...
...
@@ -75,10 +74,10 @@ public class DriveIndCatalogService {
}
//获取目录树
public
List
<
DriveIndCatalog
>
getCatalog
(
String
parentId
,
List
<
String
>
codes
){
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
))
{
return
driveIndCatalogRepo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
"0"
,
codes
);
}
return
driveIndCatalog
Repo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
parentId
,
codes
);
public
List
<
DriveIndCatalog
>
getCatalog
(
Integer
parentId
,
List
<
String
>
codes
){
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"pid"
,
parentId
);
paramMap
.
put
(
"codes"
,
codes
);
return
driveIndCatalog
Mapper
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
paramMap
);
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/IndCatalogService.java
View file @
201c94f9
...
...
@@ -4,9 +4,6 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -26,7 +23,7 @@ public class IndCatalogService {
private
BaseIndDefMapper
baseIndDefMapper
;
public
IndCatalog
saveOrUpdate
(
IndCatalog
indCatalog
)
throws
Exception
{
if
(
indCatalog
.
getId
()
!
=
null
)
{
//新增
if
(
indCatalog
.
getId
()
=
=
null
)
{
//新增
//保存
indCatalogMapper
.
insert
(
indCatalog
);
}
...
...
@@ -35,9 +32,7 @@ public class IndCatalogService {
if
(
parentId
==
0
)
{
//顶层节点
indCatalog
.
setIdPath
(
String
.
valueOf
(
indCatalog
.
getId
()));
}
else
{
IndCatalog
findIndCatalog
=
new
IndCatalog
();
findIndCatalog
.
setId
(
indCatalog
.
getParentId
());
IndCatalog
parentIndCatalog
=
indCatalogMapper
.
selectOne
(
findIndCatalog
);
IndCatalog
parentIndCatalog
=
indCatalogMapper
.
selectByPrimaryKey
(
indCatalog
.
getParentId
());
if
(
parentIndCatalog
==
null
)
{
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
}
else
{
...
...
@@ -45,7 +40,7 @@ public class IndCatalogService {
}
}
//保存
indCatalogMapper
.
insert
(
indCatalog
);
indCatalogMapper
.
updateByPrimaryKey
(
indCatalog
);
return
indCatalog
;
}
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/IndScorecardService.java
View file @
201c94f9
...
...
@@ -5,18 +5,15 @@ import java.util.HashMap;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.stereotype.Service
;
import
com.google.common.collect.Maps
;
import
com.google.gson.Gson
;
import
com.googlecode.aviator.AviatorEvaluator
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
...
...
@@ -24,7 +21,7 @@ import com.keymobile.indicators.model.entity.scorecard.ImproveScoreDef;
import
com.keymobile.indicators.model.entity.scorecard.IndScorecard
;
import
com.keymobile.indicators.model.entity.scorecard.RankScoreDef
;
import
com.keymobile.indicators.model.mapper.indmapper.DriveIndCalResultDefMapper
;
import
com.keymobile.indicators.
persistence.hyindicators.IndScorecardRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.IndScorecardMapper
;
import
com.keymobile.indicators.utils.CalculateUtils
;
@Service
...
...
@@ -32,54 +29,74 @@ public class IndScorecardService {
private
Logger
logger
=
LoggerFactory
.
getLogger
(
IndScorecardService
.
class
);
@Autowired
private
IndScorecard
Repository
indScorecardRepo
;
private
IndScorecard
Mapper
indScorecardMapper
;
@Autowired
private
DriveIndDefService
driveIndDefService
;
@Autowired
private
DriveIndCalResultDefMapper
driveIndCalResultDefMapper
;
//id不为空为修改,为空为新增
public
String
saveOrUpdate
(
IndScorecard
indScorecard
,
String
catalogId
,
public
Integer
saveOrUpdate
(
IndScorecard
indScorecard
,
Integer
catalogId
,
String
catalogIdPath
,
String
user
)
{
Gson
gson
=
new
Gson
();
if
(!
indScorecard
.
getAddScoreItem
().
isEmpty
())
{
String
addScoreItemJson
=
gson
.
toJson
(
indScorecard
.
getAddScoreItem
());
indScorecard
.
setAddScoreItemJson
(
addScoreItemJson
);
}
if
(!
indScorecard
.
getMinusScoreItem
().
isEmpty
())
{
String
minusScoreItemJson
=
gson
.
toJson
(
indScorecard
.
getMinusScoreItem
());
indScorecard
.
setMinusScoreItemJson
(
minusScoreItemJson
);
}
if
(!
indScorecard
.
getImproveScoreItem
().
isEmpty
())
{
String
improveScoreItemJson
=
gson
.
toJson
(
indScorecard
.
getImproveScoreItem
());
indScorecard
.
setImproveScoreItemJson
(
improveScoreItemJson
);
}
indScorecard
.
setCatalogId
(
catalogId
);
indScorecard
.
setCatalogIdPath
(
catalogIdPath
);
indScorecard
.
setLastUpdater
(
user
);
indScorecard
=
indScorecardRepo
.
save
(
indScorecard
);
indScorecard
Mapper
.
insert
(
indScorecard
);
return
indScorecard
.
getId
();
}
public
void
delete
(
List
<
String
>
ids
)
{
for
(
String
id
:
ids
)
{
indScorecard
Repo
.
deleteById
(
id
);
public
void
delete
(
List
<
Integer
>
ids
)
{
for
(
Integer
id
:
ids
)
{
indScorecard
Mapper
.
deleteByPrimaryKey
(
id
);
}
}
public
List
<
IndScorecard
>
getAll
(){
return
indScorecard
Repo
.
find
All
();
return
indScorecard
Mapper
.
select
All
();
}
public
IndScorecard
findById
(
String
id
)
{
Optional
<
IndScorecard
>
result
=
indScorecardRepo
.
findById
(
id
);
if
(
result
.
isPresent
()
)
{
return
result
.
get
()
;
public
IndScorecard
findById
(
Integer
id
)
{
IndScorecard
result
=
indScorecardMapper
.
selectByPrimaryKey
(
id
);
if
(
result
!=
null
)
{
return
result
;
}
return
null
;
}
public
Page
<
IndScorecard
>
getByCatalogId
(
String
catalogId
,
int
page
,
int
rows
){
Pageable
pageable
=
PageRequest
.
of
(
page
-
1
,
rows
);
return
indScorecardRepo
.
findByCatalogId
(
catalogId
,
pageable
);
public
Map
<
String
,
Object
>
getByCatalogId
(
Integer
catalogId
,
int
page
,
int
rows
){
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
int
count
=
0
;
//计算start
int
start
=
(
page
-
1
)*
rows
;
count
=
indScorecardMapper
.
countByCatalogId
(
catalogId
);
List
<
IndScorecard
>
datas
=
indScorecardMapper
.
findByCatalogId
(
catalogId
,
start
,
rows
);
result
.
put
(
"count"
,
count
);
result
.
put
(
"data"
,
datas
);
return
result
;
}
public
Map
<
String
,
String
>
calculateIndiScore
(
String
indId
,
int
date
,
String
compareObj
,
String
indScorecardId
,
String
compareId
,
List
<
String
>
compareObjs
)
throws
Exception
{
Integer
indScorecardId
,
String
compareId
,
List
<
String
>
compareObjs
)
throws
Exception
{
Map
<
String
,
String
>
result
=
new
HashMap
<>();
String
indScoreValue
=
"0.0"
;
String
indImproveScoreValue
=
"0.0"
;
result
.
put
(
"score"
,
indScoreValue
);
result
.
put
(
"improveScore"
,
indImproveScoreValue
);
if
(
StringUtils
.
isNotBlank
(
indScorecardId
)
)
{
if
(
indScorecardId
!=
null
)
{
//根据评分卡id获取评分卡信息
IndScorecard
scoreCard
=
this
.
findById
(
indScorecardId
);
double
baseScoreValue
=
0
;
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ScorecardCatalogService.java
View file @
201c94f9
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.
Optional
;
import
java.util.
Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.scorecard.ScorecardCatalog
;
import
com.keymobile.indicators.
persistence.hyindicators.IndScorecardRepository
;
import
com.keymobile.indicators.
persistence.hyindicators.ScorecardCatalogRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.IndScorecardMapper
;
import
com.keymobile.indicators.
model.mapper.indmapper.ScorecardCatalogMapper
;
@Service
public
class
ScorecardCatalogService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ScorecardCatalogService
.
class
);
@Autowired
private
ScorecardCatalog
Repository
scorecardCatalogRepo
;
private
ScorecardCatalog
Mapper
scorecardCatalogMapper
;
@Autowired
private
IndScorecard
Repository
indScorecardRepo
;
private
IndScorecard
Mapper
indScorecardMapper
;
public
ScorecardCatalog
saveOrUpdate
(
ScorecardCatalog
scorecardCatalog
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
scorecardCatalog
.
getId
())
)
{
//新增
if
(
scorecardCatalog
.
getId
()==
null
)
{
//新增
//保存
scorecardCatalog
=
scorecardCatalogRepo
.
save
(
scorecardCatalog
);
scorecardCatalog
Mapper
.
insert
(
scorecardCatalog
);
}
//获取parentId拼接idPath
String
parentId
=
scorecardCatalog
.
getParentId
();
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
)
)
{
//顶层节点
scorecardCatalog
.
setIdPath
(
scorecardCatalog
.
getId
(
));
Integer
parentId
=
scorecardCatalog
.
getParentId
();
if
(
parentId
==
0
)
{
//顶层节点
scorecardCatalog
.
setIdPath
(
String
.
valueOf
(
scorecardCatalog
.
getId
()
));
}
else
{
Optional
<
ScorecardCatalog
>
parentScorecardCatalog
=
scorecardCatalogRepo
.
findById
(
scorecardCatalog
.
getParentId
());
if
(
!
parentScorecardCatalog
.
isPresent
()
)
{
ScorecardCatalog
parentScorecardCatalog
=
scorecardCatalogMapper
.
selectByPrimaryKey
(
scorecardCatalog
.
getParentId
());
if
(
parentScorecardCatalog
==
null
)
{
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
}
else
{
scorecardCatalog
.
setIdPath
(
parentScorecardCatalog
.
get
().
get
IdPath
()+
";"
+
scorecardCatalog
.
getId
());
scorecardCatalog
.
setIdPath
(
parentScorecardCatalog
.
getIdPath
()+
";"
+
scorecardCatalog
.
getId
());
}
}
//保存
scorecardCatalog
=
scorecardCatalogRepo
.
save
(
scorecardCatalog
);
scorecardCatalog
Mapper
.
updateByPrimaryKey
(
scorecardCatalog
);
return
scorecardCatalog
;
}
public
void
delete
(
List
<
String
>
ids
)
{
scorecardCatalog
Repo
.
deleteByIdIn
(
ids
);
public
void
delete
(
List
<
Integer
>
ids
)
{
scorecardCatalog
Mapper
.
deleteByIdIn
(
ids
);
}
//递归查找父目录下的子目录
public
List
<
String
>
getDeleteCatalogId
(
String
id
){
List
<
String
>
result
=
new
ArrayList
<>();
public
List
<
Integer
>
getDeleteCatalogId
(
Integer
id
){
List
<
Integer
>
result
=
new
ArrayList
<>();
result
.
add
(
id
);
//根据id获取子节点
List
<
ScorecardCatalog
>
children
=
scorecardCatalog
Repo
.
findByParentId
(
id
);
List
<
ScorecardCatalog
>
children
=
scorecardCatalog
Mapper
.
findByParentId
(
id
);
if
(!
children
.
isEmpty
())
{
for
(
ScorecardCatalog
child
:
children
)
{
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
...
...
@@ -65,20 +65,20 @@ public class ScorecardCatalogService {
}
//递归删除
public
void
recursionDelete
(
List
<
String
>
ids
)
{
for
(
String
id
:
ids
)
{
List
<
String
>
result
=
this
.
getDeleteCatalogId
(
id
);
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
for
(
Integer
id
:
ids
)
{
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
this
.
delete
(
result
);
//删除目录关联的评分卡
indScorecard
Repo
.
deleteByCatalogIdIn
(
result
);
indScorecard
Mapper
.
deleteByCatalogIdIn
(
result
);
}
}
//获取目录树
public
List
<
ScorecardCatalog
>
getCatalog
(
String
parentId
,
List
<
String
>
codes
){
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
))
{
return
scorecardCatalogRepo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
"0"
,
codes
);
}
return
scorecardCatalog
Repo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
parentId
,
codes
);
public
List
<
ScorecardCatalog
>
getCatalog
(
Integer
parentId
,
List
<
String
>
codes
){
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"pid"
,
parentId
);
paramMap
.
put
(
"codes"
,
codes
);
return
scorecardCatalog
Mapper
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
paramMap
);
}
}
src/main/resources/mybatis/mapping/DriveIndCatalogMapper.xml
0 → 100644
View file @
201c94f9
<?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.indmapper.DriveIndCatalogMapper"
>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from drive_ind_catalog
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
<select
id=
"findByParentIdAndCodeInOrderByLastUpdateTimeDesc"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCatalog"
>
select *
from drive_ind_catalog
where parent_id = #{pid} and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
order by last_update_time desc
</select>
<select
id=
"findByParentId"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCatalog"
>
select *
from drive_ind_catalog
where parent_id = #{pid}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/IndScorecardMapper.xml
0 → 100644
View file @
201c94f9
<?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.indmapper.IndScorecardMapper"
>
<select
id=
"findByCatalogId"
resultType=
"com.keymobile.indicators.model.entity.scorecard.IndScorecard"
>
select *
from drive_ind_score_card
where catalog_id = #{catalogId}
limit #{start},#{end}
</select>
<select
id=
"countByCatalogId"
resultType=
"java.lang.Integer"
>
select count(1)
from drive_ind_score_card
where catalog_id = #{catalogId}
</select>
<delete
id=
"deleteByCatalogIdIn"
parameterType=
"java.util.List"
>
delete
from drive_ind_score_card
where catalog_id in
<foreach
item=
"id"
collection=
"catalogIds"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ScorecardCatalogMapper.xml
0 → 100644
View file @
201c94f9
<?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.indmapper.ScorecardCatalogMapper"
>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from score_card_catalog
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
<select
id=
"findByParentIdAndCodeInOrderByLastUpdateTimeDesc"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.scorecard.ScorecardCatalog"
>
select *
from score_card_catalog
where parent_id = #{pid} and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
order by last_update_time desc
</select>
<select
id=
"findByParentId"
resultType=
"com.keymobile.indicators.model.entity.scorecard.ScorecardCatalog"
>
select *
from score_card_catalog
where parent_id = #{pid}
</select>
</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