Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
rpc-openplatform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e4e81072
authored
Dec 19, 2020
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
2 parents
28690ac8
3bfba3bf
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
6 deletions
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/service/IceOpenApiService.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/mapper/PlatformDeviceMapper.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/IceOpenApiServiceImpl.java
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformDeviceMapper.xml
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/service/IceOpenApiService.java
View file @
e4e8107
...
...
@@ -3,5 +3,5 @@ package cn.com.glsx.openplatform.service;
import
java.util.Map
;
public
interface
IceOpenApiService
{
Map
<
String
,
Integer
>
getDataView
(
int
userId
);
Map
<
String
,
Integer
>
getDataView
(
int
userId
,
int
deviceType
);
}
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/mapper/PlatformDeviceMapper.java
View file @
e4e8107
...
...
@@ -34,7 +34,7 @@ public interface PlatformDeviceMapper extends OreMapper<PlatformDevice> {
List
<
Map
<
String
,
Object
>>
getDeviceActivationStatistic
(
@Param
(
"startTime"
)
Date
startTime
,
@Param
(
"endTime"
)
Date
endTime
,
@Param
(
"customerName"
)
String
customerName
);
int
getDeviceCountByCustomerId
(
@Param
(
"customerId"
)
int
customerId
);
int
getDeviceCountByCustomerId
(
@Param
(
"customerId"
)
int
customerId
,
@Param
(
"deviceTypeStr"
)
String
deviceTypeStr
);
int
getacticveDeviceCountByCustomerId
(
@Param
(
"customerId"
)
int
customerId
);
int
getacticveDeviceCountByCustomerId
(
@Param
(
"customerId"
)
int
customerId
,
@Param
(
"deviceTypeStr"
)
String
deviceTypeStr
);
}
\ No newline at end of file
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/IceOpenApiServiceImpl.java
View file @
e4e8107
...
...
@@ -24,12 +24,28 @@ public class IceOpenApiServiceImpl implements IceOpenApiService {
private
PlatformUserMapper
userMapper
;
@Override
public
Map
<
String
,
Integer
>
getDataView
(
int
userId
)
{
public
Map
<
String
,
Integer
>
getDataView
(
int
userId
,
int
deviceType
)
{
HashMap
<
String
,
Integer
>
hashMap
=
new
HashMap
<>();
String
deviceTypeStr
;
// 设备类型 1 模组 2 核心板 3 完整板
switch
(
deviceType
)
{
case
1
:
deviceTypeStr
=
"模组"
;
break
;
case
2
:
deviceTypeStr
=
"核心板"
;
break
;
case
3
:
deviceTypeStr
=
"完整板"
;
break
;
default
:
deviceTypeStr
=
""
;
}
int
customerId
=
userMapper
.
getCustomerId
(
userId
);
int
deviceCount
=
deviceMapper
.
getDeviceCountByCustomerId
(
customerId
);
int
deviceCount
=
deviceMapper
.
getDeviceCountByCustomerId
(
customerId
,
deviceTypeStr
);
int
userCount
=
userMapper
.
getUserCountByCustomerId
(
customerId
);
int
acticveDeviceCount
=
deviceMapper
.
getacticveDeviceCountByCustomerId
(
customerId
);
int
acticveDeviceCount
=
deviceMapper
.
getacticveDeviceCountByCustomerId
(
customerId
,
deviceTypeStr
);
hashMap
.
put
(
"totaldevice"
,
deviceCount
);
hashMap
.
put
(
"totalusers"
,
userCount
);
hashMap
.
put
(
"onlinedevices"
,
acticveDeviceCount
);
...
...
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformDeviceMapper.xml
View file @
e4e8107
...
...
@@ -112,6 +112,9 @@
select count(1)
from t_platform_device
where customer_id = #{customerId,jdbcType=INTEGER}
<if
test=
"deviceTypeStr != null and deviceTypeStr != ''"
>
and device_type = #{deviceTypeStr,jdbcType=VARCHAR}
</if>
</select>
<select
id=
"getacticveDeviceCountByCustomerId"
resultType=
"java.lang.Integer"
>
...
...
@@ -119,5 +122,8 @@
from t_platform_device
where status = 1
and customer_id = #{customerId,jdbcType=INTEGER}
<if
test=
"deviceTypeStr != null and deviceTypeStr != ''"
>
and device_type = #{deviceTypeStr,jdbcType=VARCHAR}
</if>
</select>
</mapper>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment