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
d6d03838
Commit
d6d03838
authored
Jul 06, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加分页获取预警池数据
parent
00b3d340
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
0 deletions
+53
-0
ShortboardUnitCtrl.java
...eymobile/indicators/api/hytobacco/ShortboardUnitCtrl.java
+7
-0
ShortboardRecordMapper.java
...cators/model/mapper/indmapper/ShortboardRecordMapper.java
+5
-0
ShortboardUnitService.java
...e/indicators/service/hytobacco/ShortboardUnitService.java
+18
-0
ShortboardRecordMapper.xml
...main/resources/mybatis/mapping/ShortboardRecordMapper.xml
+23
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/ShortboardUnitCtrl.java
View file @
d6d03838
...
...
@@ -111,4 +111,11 @@ public class ShortboardUnitCtrl {
@RequestParam
(
required
=
false
)
String
user
)
throws
Exception
{
return
shortboardUnitService
.
getShortboardObjFromUnit
(
unitId
,
user
);
}
@ApiOperation
(
value
=
"分页获取短板预警池数据"
,
notes
=
"分页获取短板预警池数据"
)
@PostMapping
(
value
=
"/getPageShortboardWarnData"
)
public
Map
<
String
,
Object
>
getPageShortboardWarnData
(
@RequestParam
List
<
String
>
codes
,
@RequestParam
(
defaultValue
=
"0"
)
int
page
,
@RequestParam
(
defaultValue
=
"10"
)
int
rows
)
throws
Exception
{
return
shortboardUnitService
.
getShortboardRecordPage
(
codes
,
page
,
rows
);
}
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ShortboardRecordMapper.java
View file @
d6d03838
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.shortboard.ShortboardRecord
;
...
...
@@ -8,5 +11,7 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper
public
interface
ShortboardRecordMapper
extends
BaseMapper
<
ShortboardRecord
>{
public
List
<
ShortboardRecord
>
getPageByCodeIn
(
Map
<
String
,
Object
>
param
);
public
int
countByCodeIn
(
Map
<
String
,
Object
>
param
);
}
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardUnitService.java
View file @
d6d03838
...
...
@@ -114,4 +114,22 @@ public class ShortboardUnitService {
}
return
result
;
}
//根据标识编码分页获取预警池短板数据
public
Map
<
String
,
Object
>
getShortboardRecordPage
(
List
<
String
>
codes
,
int
page
,
int
rows
){
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
paramMap
.
put
(
"codes"
,
codes
);
int
count
=
shortboardRecordMapper
.
countByCodeIn
(
paramMap
);
//计算start
int
start
=
page
*
rows
;
paramMap
.
put
(
"start"
,
start
);
paramMap
.
put
(
"end"
,
rows
);
List
<
ShortboardRecord
>
resultList
=
shortboardRecordMapper
.
getPageByCodeIn
(
paramMap
);
result
.
put
(
"total"
,
count
);
result
.
put
(
"data"
,
resultList
);
return
result
;
}
}
src/main/resources/mybatis/mapping/ShortboardRecordMapper.xml
0 → 100644
View file @
d6d03838
<?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.ShortboardRecordMapper"
>
<select
id=
"getPageByCodeIn"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.shortboard.ShortboardRecord"
>
select *
from short_board_record
where code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
limit #{start},#{end}
</select>
<select
id=
"countByCodeIn"
parameterType=
"map"
resultType=
"java.lang.Integer"
>
select count(1)
from short_board_record
where code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</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