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 1f05e85c
authored
Dec 19, 2020
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
格式化 yangll
1 parent
704c1abb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 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 @
1f05e85
...
@@ -3,5 +3,5 @@ package cn.com.glsx.openplatform.service;
...
@@ -3,5 +3,5 @@ package cn.com.glsx.openplatform.service;
import
java.util.Map
;
import
java.util.Map
;
public
interface
IceOpenApiService
{
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 @
1f05e85
...
@@ -34,7 +34,7 @@ public interface PlatformDeviceMapper extends OreMapper<PlatformDevice> {
...
@@ -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
);
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
\ No newline at end of file
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/IceOpenApiServiceImpl.java
View file @
1f05e85
...
@@ -24,12 +24,27 @@ public class IceOpenApiServiceImpl implements IceOpenApiService {
...
@@ -24,12 +24,27 @@ public class IceOpenApiServiceImpl implements IceOpenApiService {
private
PlatformUserMapper
userMapper
;
private
PlatformUserMapper
userMapper
;
@Override
@Override
public
Map
<
String
,
Integer
>
getDataView
(
int
userId
)
{
public
Map
<
String
,
Integer
>
getDataView
(
int
userId
,
int
deviceType
)
{
HashMap
<
String
,
Integer
>
hashMap
=
new
HashMap
<>();
HashMap
<
String
,
Integer
>
hashMap
=
new
HashMap
<>();
String
deviceTypeStr
;
switch
(
deviceType
)
{
case
1
:
deviceTypeStr
=
"模组"
;
break
;
case
2
:
deviceTypeStr
=
"核心板"
;
break
;
case
3
:
deviceTypeStr
=
"完整板"
;
break
;
default
:
deviceTypeStr
=
""
;
}
int
customerId
=
userMapper
.
getCustomerId
(
userId
);
int
customerId
=
userMapper
.
getCustomerId
(
userId
);
int
deviceCount
=
deviceMapper
.
getDeviceCountByCustomerId
(
customerId
);
int
deviceCount
=
deviceMapper
.
getDeviceCountByCustomerId
(
customerId
,
deviceTypeStr
);
int
userCount
=
userMapper
.
getUserCountByCustomerId
(
customerId
);
int
userCount
=
userMapper
.
getUserCountByCustomerId
(
customerId
);
int
acticveDeviceCount
=
deviceMapper
.
getacticveDeviceCountByCustomerId
(
customerId
);
int
acticveDeviceCount
=
deviceMapper
.
getacticveDeviceCountByCustomerId
(
customerId
,
deviceTypeStr
);
hashMap
.
put
(
"totaldevice"
,
deviceCount
);
hashMap
.
put
(
"totaldevice"
,
deviceCount
);
hashMap
.
put
(
"totalusers"
,
userCount
);
hashMap
.
put
(
"totalusers"
,
userCount
);
hashMap
.
put
(
"onlinedevices"
,
acticveDeviceCount
);
hashMap
.
put
(
"onlinedevices"
,
acticveDeviceCount
);
...
...
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformDeviceMapper.xml
View file @
1f05e85
...
@@ -116,6 +116,9 @@
...
@@ -116,6 +116,9 @@
select count(1)
select count(1)
from t_platform_device
from t_platform_device
where customer_id = #{customerId,jdbcType=INTEGER}
where customer_id = #{customerId,jdbcType=INTEGER}
<if
test=
"deviceTypeStr != null and deviceTypeStr != ''"
>
and device_type = #{deviceTypeStr,jdbcType=VARCHAR}
</if>
</select>
</select>
<select
id=
"getacticveDeviceCountByCustomerId"
resultType=
"java.lang.Integer"
>
<select
id=
"getacticveDeviceCountByCustomerId"
resultType=
"java.lang.Integer"
>
...
@@ -123,5 +126,8 @@
...
@@ -123,5 +126,8 @@
from t_platform_device
from t_platform_device
where status = 1
where status = 1
and customer_id = #{customerId,jdbcType=INTEGER}
and customer_id = #{customerId,jdbcType=INTEGER}
<if
test=
"deviceTypeStr != null and deviceTypeStr != ''"
>
and device_type = #{deviceTypeStr,jdbcType=VARCHAR}
</if>
</select>
</select>
</mapper>
</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