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
dd50eab5
Commit
dd50eab5
authored
Nov 25, 2022
by
马33
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备列表增加SN搜索条件
parent
166dc5af
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
7 deletions
+12
-7
DeviceController.java
...java/iot/sixiang/license/controller/DeviceController.java
+4
-2
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
+2
-2
DeviceMapper.xml
license/src/main/resources/mapper/DeviceMapper.xml
+3
-0
PmsUseLogMapper.xml
license/src/main/resources/mapper/PmsUseLogMapper.xml
+1
-1
No files found.
license/src/main/java/iot/sixiang/license/controller/DeviceController.java
View file @
dd50eab5
...
@@ -78,20 +78,22 @@ public class DeviceController {
...
@@ -78,20 +78,22 @@ public class DeviceController {
*/
*/
@ApiOperation
(
value
=
"获取设备列表接口"
,
notes
=
"用于获取设备列表"
)
@ApiOperation
(
value
=
"获取设备列表接口"
,
notes
=
"用于获取设备列表"
)
@GetMapping
(
"list"
)
@GetMapping
(
"list"
)
@MyLog
(
title
=
"获取设备列表"
,
optParam
=
"#{pageNo},#{pageSize},#{appName},#{userName},#{status}"
,
businessType
=
BusinessType
.
SELECT
)
@MyLog
(
title
=
"获取设备列表"
,
optParam
=
"#{pageNo},#{pageSize},#{appName},#{userName},#{s
n},#{s
tatus}"
,
businessType
=
BusinessType
.
SELECT
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"appName"
,
value
=
"应用名"
),
@ApiImplicitParam
(
name
=
"appName"
,
value
=
"应用名"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
),
@ApiImplicitParam
(
name
=
"sn"
,
value
=
"设备编码"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态"
,
dataType
=
"int"
)
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态"
,
dataType
=
"int"
)
})
})
public
PageResult
<
DeviceVo
>
getDeviceList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
public
PageResult
<
DeviceVo
>
getDeviceList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
,
@RequestParam
(
value
=
"appName"
,
required
=
false
)
String
appName
,
@RequestParam
(
value
=
"appName"
,
required
=
false
)
String
appName
,
@RequestParam
(
value
=
"userName"
,
required
=
false
)
String
userName
,
@RequestParam
(
value
=
"userName"
,
required
=
false
)
String
userName
,
@RequestParam
(
value
=
"sn"
,
required
=
false
)
String
sn
,
@RequestParam
(
value
=
"status"
,
required
=
false
)
Integer
status
)
{
@RequestParam
(
value
=
"status"
,
required
=
false
)
Integer
status
)
{
PageInfoModel
<
DeviceVo
>
records
=
deviceService
.
getDeviceList
(
pageNo
,
pageSize
,
appName
,
userName
,
status
);
PageInfoModel
<
DeviceVo
>
records
=
deviceService
.
getDeviceList
(
pageNo
,
pageSize
,
appName
,
userName
,
s
n
,
s
tatus
);
int
total
=
records
.
getTotal
();
int
total
=
records
.
getTotal
();
int
pages
=
total
/
pageSize
;
//pages为总页数
int
pages
=
total
/
pageSize
;
//pages为总页数
int
mod
=
total
%
pageSize
;
int
mod
=
total
%
pageSize
;
...
...
license/src/main/java/iot/sixiang/license/mapper/DeviceMapper.java
View file @
dd50eab5
...
@@ -13,7 +13,7 @@ import java.util.List;
...
@@ -13,7 +13,7 @@ import java.util.List;
* @since 2022-06-08
* @since 2022-06-08
*/
*/
public
interface
DeviceMapper
extends
BaseMapper
<
Device
>
{
public
interface
DeviceMapper
extends
BaseMapper
<
Device
>
{
List
<
DeviceVo
>
getDeviceList
(
String
appName
,
String
userName
,
Integer
status
);
List
<
DeviceVo
>
getDeviceList
(
String
appName
,
String
userName
,
String
sn
,
Integer
status
);
boolean
addDevice
(
String
sn
,
String
appId
);
boolean
addDevice
(
String
sn
,
String
appId
);
}
}
license/src/main/java/iot/sixiang/license/service/DeviceService.java
View file @
dd50eab5
...
@@ -13,7 +13,7 @@ import iot.sixiang.license.model.vo.DeviceVo;
...
@@ -13,7 +13,7 @@ import iot.sixiang.license.model.vo.DeviceVo;
* @since 2022-06-08
* @since 2022-06-08
*/
*/
public
interface
DeviceService
extends
IService
<
Device
>
{
public
interface
DeviceService
extends
IService
<
Device
>
{
PageInfoModel
<
DeviceVo
>
getDeviceList
(
int
pageNo
,
int
pageSize
,
String
appName
,
String
userName
,
Integer
status
);
PageInfoModel
<
DeviceVo
>
getDeviceList
(
int
pageNo
,
int
pageSize
,
String
appName
,
String
userName
,
String
sn
,
Integer
status
);
boolean
addDevice
(
String
appId
,
int
count
);
boolean
addDevice
(
String
appId
,
int
count
);
...
...
license/src/main/java/iot/sixiang/license/service/impl/DeviceServiceImpl.java
View file @
dd50eab5
...
@@ -35,11 +35,11 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
...
@@ -35,11 +35,11 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
private
DeviceMapper
deviceMapper
;
private
DeviceMapper
deviceMapper
;
@Override
@Override
public
PageInfoModel
<
DeviceVo
>
getDeviceList
(
int
pageNo
,
int
pageSize
,
String
appName
,
String
userName
,
Integer
status
)
{
public
PageInfoModel
<
DeviceVo
>
getDeviceList
(
int
pageNo
,
int
pageSize
,
String
appName
,
String
userName
,
String
sn
,
Integer
status
)
{
if
(
pageNo
==
0
||
pageSize
==
0
)
{
if
(
pageNo
==
0
||
pageSize
==
0
)
{
throw
new
IotLicenseException
(
ResultCode
.
VALIDATE_FAILED
.
getCode
(),
ResultCode
.
VALIDATE_FAILED
.
getMsg
());
throw
new
IotLicenseException
(
ResultCode
.
VALIDATE_FAILED
.
getCode
(),
ResultCode
.
VALIDATE_FAILED
.
getMsg
());
}
}
List
<
DeviceVo
>
deviceTypes
=
deviceMapper
.
getDeviceList
(
appName
,
userName
,
status
);
List
<
DeviceVo
>
deviceTypes
=
deviceMapper
.
getDeviceList
(
appName
,
userName
,
s
n
,
s
tatus
);
deviceTypes
=
deviceTypes
.
stream
().
sorted
(
Comparator
.
comparing
(
DeviceVo:
:
getCreateTime
,
Comparator
.
reverseOrder
())).
collect
(
Collectors
.
toList
());
deviceTypes
=
deviceTypes
.
stream
().
sorted
(
Comparator
.
comparing
(
DeviceVo:
:
getCreateTime
,
Comparator
.
reverseOrder
())).
collect
(
Collectors
.
toList
());
List
<
DeviceVo
>
result
=
new
ArrayList
<>();
List
<
DeviceVo
>
result
=
new
ArrayList
<>();
int
begin
=
(
pageNo
-
1
)
*
pageSize
;
int
begin
=
(
pageNo
-
1
)
*
pageSize
;
...
...
license/src/main/resources/mapper/DeviceMapper.xml
View file @
dd50eab5
...
@@ -14,6 +14,9 @@
...
@@ -14,6 +14,9 @@
<if
test=
"null != userName and '' != userName"
>
<if
test=
"null != userName and '' != userName"
>
and user_name like concat('%',#{userName},'%')
and user_name like concat('%',#{userName},'%')
</if>
</if>
<if
test=
"null != sn and '' != sn"
>
and sn like concat('%',#{sn},'%')
</if>
<if
test=
"null != status"
>
<if
test=
"null != status"
>
and status = #{status}
and status = #{status}
</if>
</if>
...
...
license/src/main/resources/mapper/PmsUseLogMapper.xml
View file @
dd50eab5
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
SELECT * FROM pms_use_log
SELECT * FROM pms_use_log
where 1=1
where 1=1
<if
test=
"null != sn and '' != sn"
>
<if
test=
"null != sn and '' != sn"
>
and sn
= #{sn}
and sn
like concat('%',#{sn},'%')
</if>
</if>
<if
test=
"null != status"
>
<if
test=
"null != status"
>
and status = #{status}
and status = #{status}
...
...
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