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
631560aa
Commit
631560aa
authored
Jul 09, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单位计分规则,短板规则和短板单元分页加载接口添加关键字查询
parent
b3565086
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
57 additions
and
21 deletions
+57
-21
ObjScoreRuleCtrl.java
.../keymobile/indicators/api/hytobacco/ObjScoreRuleCtrl.java
+3
-2
ShortboardRuleCtrl.java
...eymobile/indicators/api/hytobacco/ShortboardRuleCtrl.java
+2
-1
ShortboardUnitCtrl.java
...eymobile/indicators/api/hytobacco/ShortboardUnitCtrl.java
+2
-1
ScoreRuleMapper.java
...le/indicators/model/mapper/indmapper/ScoreRuleMapper.java
+2
-2
ShortboardRuleMapper.java
...dicators/model/mapper/indmapper/ShortboardRuleMapper.java
+2
-2
ShortboardUnitMapper.java
...dicators/model/mapper/indmapper/ShortboardUnitMapper.java
+2
-2
ScoreRuleService.java
...mobile/indicators/service/hytobacco/ScoreRuleService.java
+9
-4
ShortboardRuleService.java
...e/indicators/service/hytobacco/ShortboardRuleService.java
+8
-3
ShortboardUnitService.java
...e/indicators/service/hytobacco/ShortboardUnitService.java
+8
-3
ScoreRuleMapper.xml
src/main/resources/mybatis/mapping/ScoreRuleMapper.xml
+6
-0
ShortboardRuleMapper.xml
src/main/resources/mybatis/mapping/ShortboardRuleMapper.xml
+6
-0
ShortboardUnitMapper.xml
src/main/resources/mybatis/mapping/ShortboardUnitMapper.xml
+7
-1
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/ObjScoreRuleCtrl.java
View file @
631560aa
...
...
@@ -81,9 +81,10 @@ public class ObjScoreRuleCtrl {
@ApiOperation
(
value
=
"根据单位评分规则目录获取单位评分规则"
,
notes
=
"根据单位评分规则目录获取单位评分规则"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
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
){
return
scoreRuleService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
return
scoreRuleService
.
getByCatalogId
(
catalogId
,
keyword
,
page
,
rows
);
}
@ApiOperation
(
value
=
"根据id获取单位评分规则"
,
notes
=
"根据id获取单位评分规则"
)
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/ShortboardRuleCtrl.java
View file @
631560aa
...
...
@@ -81,9 +81,10 @@ public class ShortboardRuleCtrl {
@ApiOperation
(
value
=
"根据短板筛选规则目录获取短板筛选规则"
,
notes
=
"根据短板筛选规则目录获取短板筛选规则"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
public
Map
<
String
,
Object
>
getByCatalogId
(
@RequestParam
Integer
catalogId
,
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
return
shortboardRuleService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
return
shortboardRuleService
.
getByCatalogId
(
catalogId
,
keyword
,
page
,
rows
);
}
@ApiOperation
(
value
=
"根据id获取短板筛选规则"
,
notes
=
"根据id获取短板筛选规则"
)
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/ShortboardUnitCtrl.java
View file @
631560aa
...
...
@@ -85,9 +85,10 @@ public class ShortboardUnitCtrl {
@ApiOperation
(
value
=
"根据短板筛选单元目录获取短板筛选单元"
,
notes
=
"根据短板筛选单元目录获取短板筛选单元"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
public
Map
<
String
,
Object
>
getByCatalogId
(
@RequestParam
Integer
catalogId
,
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
return
shortboardUnitService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
return
shortboardUnitService
.
getByCatalogId
(
catalogId
,
keyword
,
page
,
rows
);
}
@ApiOperation
(
value
=
"根据id获取短板筛选单元"
,
notes
=
"根据id获取短板筛选单元"
)
...
...
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ScoreRuleMapper.java
View file @
631560aa
...
...
@@ -15,7 +15,7 @@ public interface ScoreRuleMapper extends BaseMapper<ScoreRule>{
public
void
deleteByCatalogIdIn
(
@Param
(
"ids"
)
List
<
Integer
>
ids
);
public
List
<
ScoreRule
>
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
,
@Param
(
"keyword"
)
String
keyword
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ShortboardRuleMapper.java
View file @
631560aa
...
...
@@ -13,7 +13,7 @@ public interface ShortboardRuleMapper extends BaseMapper<ShortboardRule>{
public
void
deleteByCatalogIdIn
(
@Param
(
"ids"
)
List
<
Integer
>
ids
);
public
List
<
ShortboardRule
>
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
,
@Param
(
"keyword"
)
String
keyword
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ShortboardUnitMapper.java
View file @
631560aa
...
...
@@ -13,7 +13,7 @@ public interface ShortboardUnitMapper extends BaseMapper<ShortboardUnit>{
public
void
deleteByCatalogIdIn
(
@Param
(
"ids"
)
List
<
Integer
>
ids
);
public
List
<
ShortboardUnit
>
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
,
@Param
(
"keyword"
)
String
keyword
);
}
src/main/java/com/keymobile/indicators/service/hytobacco/ScoreRuleService.java
View file @
631560aa
...
...
@@ -70,13 +70,18 @@ public class ScoreRuleService {
return
scoreRuleMapper
.
findByCode
(
code
);
}
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
<>();
if
(
StringUtils
.
isNotBlank
(
keyword
))
{
keyword
=
"%"
+
keyword
+
"%"
;
}
else
{
keyword
=
null
;
}
int
count
=
0
;
//计算start
int
start
=
(
page
-
1
)
*
rows
;
count
=
scoreRuleMapper
.
countByCatalogId
(
catalogId
);
List
<
ScoreRule
>
datas
=
scoreRuleMapper
.
findByCatalogId
(
catalogId
,
start
,
rows
);
int
start
=
page
*
rows
;
count
=
scoreRuleMapper
.
countByCatalogId
(
catalogId
,
keyword
);
List
<
ScoreRule
>
datas
=
scoreRuleMapper
.
findByCatalogId
(
catalogId
,
keyword
,
start
,
rows
);
// List<ScoreRule> resultDatas = new ArrayList<>();
// for(ScoreRule data : datas) {
// ScoreRule data1 = this.changeJson(data);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardRuleService.java
View file @
631560aa
...
...
@@ -62,13 +62,18 @@ public class ShortboardRuleService {
}
}
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
<>();
if
(
StringUtils
.
isNotBlank
(
keyword
))
{
keyword
=
"%"
+
keyword
+
"%"
;
}
else
{
keyword
=
null
;
}
int
count
=
0
;
//计算start
int
start
=
(
page
-
1
)*
rows
;
count
=
shortboardRuleMapper
.
countByCatalogId
(
catalogId
);
List
<
ShortboardRule
>
datas
=
shortboardRuleMapper
.
findByCatalogId
(
catalogId
,
start
,
rows
);
count
=
shortboardRuleMapper
.
countByCatalogId
(
catalogId
,
keyword
);
List
<
ShortboardRule
>
datas
=
shortboardRuleMapper
.
findByCatalogId
(
catalogId
,
keyword
,
start
,
rows
);
// List<ShortboardRule> resultDatas = new ArrayList<>();
// for(ShortboardRule data : datas) {
// ShortboardRule data1 = this.changeJson(data);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardUnitService.java
View file @
631560aa
...
...
@@ -53,13 +53,18 @@ public class ShortboardUnitService {
shortboardUnitMapper
.
deleteByPrimaryKey
(
id
);
}
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
<>();
if
(
StringUtils
.
isNotBlank
(
keyword
))
{
keyword
=
"%"
+
keyword
+
"%"
;
}
else
{
keyword
=
null
;
}
int
count
=
0
;
//计算start
int
start
=
(
page
-
1
)*
rows
;
count
=
shortboardUnitMapper
.
countByCatalogId
(
catalogId
);
List
<
ShortboardUnit
>
datas
=
shortboardUnitMapper
.
findByCatalogId
(
catalogId
,
start
,
rows
);
count
=
shortboardUnitMapper
.
countByCatalogId
(
catalogId
,
keyword
);
List
<
ShortboardUnit
>
datas
=
shortboardUnitMapper
.
findByCatalogId
(
catalogId
,
keyword
,
start
,
rows
);
result
.
put
(
"count"
,
count
);
result
.
put
(
"data"
,
datas
);
return
result
;
...
...
src/main/resources/mybatis/mapping/ScoreRuleMapper.xml
View file @
631560aa
...
...
@@ -11,6 +11,9 @@
select *
from obj_score_rule
where catalog_id = #{catalogId}
<if
test=
"keyword!=null"
>
and rule_name like #{keyword}
</if>
limit #{start},#{end}
</select>
...
...
@@ -18,6 +21,9 @@
select count(1)
from obj_score_rule
where catalog_id = #{catalogId}
<if
test=
"keyword!=null"
>
and rule_name like #{keyword}
</if>
</select>
<delete
id=
"deleteByCatalogIdIn"
parameterType=
"java.util.List"
>
...
...
src/main/resources/mybatis/mapping/ShortboardRuleMapper.xml
View file @
631560aa
...
...
@@ -5,6 +5,9 @@
select *
from short_board_rule
where catalog_id = #{catalogId}
<if
test=
"keyword!=null"
>
and rule_name like #{keyword}
</if>
limit #{start},#{end}
</select>
...
...
@@ -12,6 +15,9 @@
select count(1)
from short_board_rule
where catalog_id = #{catalogId}
<if
test=
"keyword!=null"
>
and rule_name like #{keyword}
</if>
</select>
<delete
id=
"deleteByCatalogIdIn"
parameterType=
"java.util.List"
>
...
...
src/main/resources/mybatis/mapping/ShortboardUnitMapper.xml
View file @
631560aa
...
...
@@ -5,13 +5,19 @@
select *
from short_board_unit
where catalog_id = #{catalogId}
<if
test=
"keyword!=null"
>
and unit_name like #{keyword}
</if>
limit #{start},#{end}
</select>
<select
id=
"countByCatalogId"
resultType=
"java.lang.Integer"
>
select count(1)
from short_board_unit
where catalog_id = #{catalogId}
where catalog_id = #{catalogId}
<if
test=
"keyword!=null"
>
and unit_name like #{keyword}
</if>
</select>
<delete
id=
"deleteByCatalogIdIn"
parameterType=
"java.util.List"
>
...
...
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