Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
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
zengtianlai3
ioc_sixiang_license
Commits
8b335c2c
Commit
8b335c2c
authored
Jun 09, 2022
by
zengtianlai3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整合
parent
989a357e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
9 deletions
+10
-9
DeviceController.java
...java/iot/sixiang/license/controller/DeviceController.java
+3
-3
DeviceMapper.java
...rc/main/java/iot/sixiang/license/mapper/DeviceMapper.java
+1
-1
DeviceService.java
.../main/java/iot/sixiang/license/service/DeviceService.java
+1
-1
DeviceServiceImpl.java
...a/iot/sixiang/license/service/impl/DeviceServiceImpl.java
+3
-2
DeviceMapper.xml
license/src/main/resources/mapper/DeviceMapper.xml
+2
-2
No files found.
license/src/main/java/iot/sixiang/license/controller/DeviceController.java
View file @
8b335c2c
...
...
@@ -50,15 +50,15 @@ public class DeviceController {
* @param pageNo
* @param pageSize
* @param typeName
* @param user
Id
* @param user
Name
* @return
*/
@GetMapping
(
"list"
)
public
PageResult
getDeviceList
(
@RequestParam
(
"pageNo"
)
int
pageNo
,
@RequestParam
(
"pageSize"
)
int
pageSize
,
@RequestParam
(
value
=
"typeName"
,
required
=
false
)
String
typeName
,
@RequestParam
(
value
=
"user
Id"
,
required
=
false
)
Integer
userId
)
{
PageInfoModel
<
DeviceTypeVo
>
records
=
deviceService
.
getDeviceList
(
pageNo
,
pageSize
,
typeName
,
user
Id
);
@RequestParam
(
value
=
"user
Name"
,
required
=
false
)
String
userName
)
{
PageInfoModel
<
DeviceTypeVo
>
records
=
deviceService
.
getDeviceList
(
pageNo
,
pageSize
,
typeName
,
user
Name
);
int
total
=
records
.
getTotal
();
int
pages
=
total
/
pageSize
;
//pages为总页数
int
mod
=
total
%
pageSize
;
...
...
license/src/main/java/iot/sixiang/license/mapper/DeviceMapper.java
View file @
8b335c2c
...
...
@@ -16,7 +16,7 @@ import java.util.List;
*/
public
interface
DeviceMapper
extends
BaseMapper
<
Device
>
{
List
<
DeviceTypeVo
>
getDeviceList
(
String
typeName
,
Integer
userId
);
List
<
DeviceTypeVo
>
getDeviceList
(
String
typeName
,
String
userName
);
boolean
addDevice
(
String
sn
,
int
userId
,
int
typeId
);
}
license/src/main/java/iot/sixiang/license/service/DeviceService.java
View file @
8b335c2c
...
...
@@ -15,7 +15,7 @@ import iot.sixiang.license.model.vo.DeviceTypeVo;
*/
public
interface
DeviceService
extends
IService
<
Device
>
{
PageInfoModel
<
DeviceTypeVo
>
getDeviceList
(
int
pageNo
,
int
pageSize
,
String
typeName
,
Integer
userId
);
PageInfoModel
<
DeviceTypeVo
>
getDeviceList
(
int
pageNo
,
int
pageSize
,
String
typeName
,
String
userName
);
boolean
addDevice
(
int
userId
,
int
typeId
,
int
count
);
}
license/src/main/java/iot/sixiang/license/service/impl/DeviceServiceImpl.java
View file @
8b335c2c
...
...
@@ -28,9 +28,10 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
@Resource
private
DeviceMapper
deviceMapper
;
@Override
public
PageInfoModel
<
DeviceTypeVo
>
getDeviceList
(
int
pageNo
,
int
pageSize
,
String
typeName
,
Integer
userId
)
{
List
<
DeviceTypeVo
>
deviceTypes
=
deviceMapper
.
getDeviceList
(
typeName
,
user
Id
);
public
PageInfoModel
<
DeviceTypeVo
>
getDeviceList
(
int
pageNo
,
int
pageSize
,
String
typeName
,
String
userName
)
{
List
<
DeviceTypeVo
>
deviceTypes
=
deviceMapper
.
getDeviceList
(
typeName
,
user
Name
);
deviceTypes
=
deviceTypes
.
stream
().
sorted
(
Comparator
.
comparing
(
DeviceTypeVo:
:
getDeviceId
)).
collect
(
Collectors
.
toList
());
List
<
DeviceTypeVo
>
result
=
new
ArrayList
<>();
int
begin
=
(
pageNo
-
1
)
*
pageSize
;
...
...
license/src/main/resources/mapper/DeviceMapper.xml
View file @
8b335c2c
...
...
@@ -14,8 +14,8 @@
<if
test=
"null != typeName and '' != typeName"
>
and type_name like concat('%',#{typeName},'%')
</if>
<if
test=
"null != user
Id and '' != userId
"
>
and us.user_
id like concat('%',#{userId
},'%')
<if
test=
"null != user
Name and '' != userName
"
>
and us.user_
name like concat('%',#{userName
},'%')
</if>
</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