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
58bbef08
Commit
58bbef08
authored
Jul 09, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指标评分规则添加关键字查询
parent
8a57fe6d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
6 deletions
+13
-6
IndScorecardCtrl.java
.../keymobile/indicators/api/hytobacco/IndScorecardCtrl.java
+3
-2
IndScorecardMapper.java
...indicators/model/mapper/indmapper/IndScorecardMapper.java
+1
-1
IndScorecardService.java
...ile/indicators/service/hytobacco/IndScorecardService.java
+6
-3
IndScorecardMapper.xml
src/main/resources/mybatis/mapping/IndScorecardMapper.xml
+3
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/IndScorecardCtrl.java
View file @
58bbef08
...
@@ -87,9 +87,10 @@ public class IndScorecardCtrl {
...
@@ -87,9 +87,10 @@ public class IndScorecardCtrl {
@ApiOperation
(
value
=
"根据评分卡目录获取评分卡"
,
notes
=
"根据评分卡目录获取评分卡"
)
@ApiOperation
(
value
=
"根据评分卡目录获取评分卡"
,
notes
=
"根据评分卡目录获取评分卡"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
public
Map
<
String
,
Object
>
getByCatalogId
(
@RequestParam
Integer
catalogId
,
public
Map
<
String
,
Object
>
getByCatalogId
(
@RequestParam
Integer
catalogId
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"0"
)
int
page
,
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
return
indScorecardService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
return
indScorecardService
.
getByCatalogId
(
catalogId
,
keyword
,
page
,
rows
);
}
}
@ApiOperation
(
value
=
"根据id获取评分卡"
,
notes
=
"根据id获取评分卡"
)
@ApiOperation
(
value
=
"根据id获取评分卡"
,
notes
=
"根据id获取评分卡"
)
...
...
src/main/java/com/keymobile/indicators/model/mapper/indmapper/IndScorecardMapper.java
View file @
58bbef08
...
@@ -13,7 +13,7 @@ public interface IndScorecardMapper extends BaseMapper<IndScorecard>{
...
@@ -13,7 +13,7 @@ public interface IndScorecardMapper extends BaseMapper<IndScorecard>{
public
void
deleteByCatalogIdIn
(
@Param
(
"catalogIds"
)
List
<
Integer
>
catalogIds
);
public
void
deleteByCatalogIdIn
(
@Param
(
"catalogIds"
)
List
<
Integer
>
catalogIds
);
public
List
<
IndScorecard
>
findByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
,
public
List
<
IndScorecard
>
findByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
,
@Param
(
"start"
)
int
start
,
@Param
(
"end"
)
int
end
);
@Param
(
"
keyword"
)
String
keyword
,
@Param
(
"
start"
)
int
start
,
@Param
(
"end"
)
int
end
);
public
int
countByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
);
public
int
countByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/IndScorecardService.java
View file @
58bbef08
...
@@ -118,13 +118,16 @@ public class IndScorecardService {
...
@@ -118,13 +118,16 @@ public class IndScorecardService {
return
scorecards
;
return
scorecards
;
}
}
public
Map
<
String
,
Object
>
getByCatalogId
(
Integer
catalogId
,
int
page
,
int
rows
){
public
Map
<
String
,
Object
>
getByCatalogId
(
Integer
catalogId
,
String
keyword
,
int
page
,
int
rows
){
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
int
count
=
0
;
int
count
=
0
;
//计算start
//计算start
int
start
=
(
page
-
1
)
*
rows
;
int
start
=
page
*
rows
;
count
=
indScorecardMapper
.
countByCatalogId
(
catalogId
);
count
=
indScorecardMapper
.
countByCatalogId
(
catalogId
);
List
<
IndScorecard
>
datas
=
indScorecardMapper
.
findByCatalogId
(
catalogId
,
start
,
rows
);
if
(
StringUtils
.
isNotBlank
(
keyword
))
{
keyword
=
"%"
+
keyword
+
"%"
;
}
List
<
IndScorecard
>
datas
=
indScorecardMapper
.
findByCatalogId
(
catalogId
,
keyword
,
start
,
rows
);
// List<IndScorecard> resultDatas = new ArrayList<>();
// List<IndScorecard> resultDatas = new ArrayList<>();
// for(IndScorecard data : datas) {
// for(IndScorecard data : datas) {
// IndScorecard data1 = this.changeJson(data);
// IndScorecard data1 = this.changeJson(data);
...
...
src/main/resources/mybatis/mapping/IndScorecardMapper.xml
View file @
58bbef08
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
select *
select *
from drive_ind_score_card
from drive_ind_score_card
where catalog_id = #{catalogId}
where catalog_id = #{catalogId}
<if
test=
"keyword!=null"
>
and card_name like #{keyword}
</if>
limit #{start},#{end}
limit #{start},#{end}
</select>
</select>
...
...
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