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 ff67c891
authored
Dec 18, 2020
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
完成Dubbo基本开发 yangll
1 parent
e422a156
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
97 additions
and
10 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/mapper/PlatformUserMapper.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/IceOpenApiServiceImpl.java
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformApiCallMapper.xml
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformAppDownloadMapper.xml
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformDeviceMapper.xml
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformUserMapper.xml
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/service/IceOpenApiService.java
0 → 100644
View file @
ff67c89
package
cn
.
com
.
glsx
.
openplatform
.
service
;
import
java.util.Map
;
public
interface
IceOpenApiService
{
Map
<
String
,
Integer
>
getDataView
(
int
userId
);
}
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/mapper/PlatformDeviceMapper.java
View file @
ff67c89
...
...
@@ -34,4 +34,8 @@ public interface PlatformDeviceMapper extends OreMapper<PlatformDevice> {
List
<
Map
<
String
,
Integer
>>
getDeviceAccessTrendList
(
@Param
(
"statisticStartTime"
)
Date
statisticStartTime
,
@Param
(
"statisticEndTime"
)
Date
statisticEndTime
);
List
<
Map
<
String
,
Object
>>
getDeviceActivationStatistic
(
@Param
(
"startTime"
)
Date
startTime
,
@Param
(
"endTime"
)
Date
endTime
,
@Param
(
"customerName"
)
String
customerName
);
int
getDeviceCountByCustomerId
(
@Param
(
"customerId"
)
int
customerId
);
int
getacticveDeviceCountByCustomerId
(
@Param
(
"customerId"
)
int
customerId
);
}
\ No newline at end of file
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/mapper/PlatformUserMapper.java
View file @
ff67c89
...
...
@@ -28,4 +28,8 @@ public interface PlatformUserMapper extends OreMapper<PlatformUser> {
List
<
Map
<
String
,
Object
>>
getUserActivityStatistic
(
@Param
(
"startTime"
)
Date
startTime
,
@Param
(
"endTime"
)
Date
endTime
,
@Param
(
"customerName"
)
String
customerName
);
int
getCustomerId
(
@Param
(
"userId"
)
int
userId
);
int
getUserCountByCustomerId
(
@Param
(
"customerId"
)
int
customerId
);
}
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/IceOpenApiServiceImpl.java
0 → 100644
View file @
ff67c89
package
cn
.
com
.
glsx
.
openplatform
.
service
;
import
cn.com.glsx.openplatform.mapper.PlatformDeviceMapper
;
import
cn.com.glsx.openplatform.mapper.PlatformUserMapper
;
import
com.alibaba.dubbo.config.annotation.Service
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.Map
;
@Service
public
class
IceOpenApiServiceImpl
implements
IceOpenApiService
{
/**
* 日志
*/
private
final
static
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
IceOpenApiServiceImpl
.
class
);
@Resource
private
PlatformDeviceMapper
deviceMapper
;
@Resource
private
PlatformUserMapper
userMapper
;
@Override
public
Map
<
String
,
Integer
>
getDataView
(
int
userId
)
{
HashMap
<
String
,
Integer
>
hashMap
=
new
HashMap
<>();
int
customerId
=
userMapper
.
getCustomerId
(
userId
);
int
deviceCount
=
deviceMapper
.
getDeviceCountByCustomerId
(
customerId
);
int
userCount
=
userMapper
.
getUserCountByCustomerId
(
customerId
);
int
acticveDeviceCount
=
deviceMapper
.
getacticveDeviceCountByCustomerId
(
customerId
);
hashMap
.
put
(
"deviceCount"
,
deviceCount
);
hashMap
.
put
(
"userCount"
,
userCount
);
hashMap
.
put
(
"acticveDeviceCount"
,
acticveDeviceCount
);
return
hashMap
;
}
}
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformApiCallMapper.xml
View file @
ff67c89
...
...
@@ -57,12 +57,14 @@
</select>
<select
id=
"getApiCallTrendList"
resultType=
"java.util.Map"
>
select
select * from
(select
date_format(create_time,'%Y-%m-%d') as createTime,
count(id) as num
from t_platform_api_call
where create_time >= #{statisticStartTime,jdbcType=TIMESTAMP}
and create_time
<
#{statisticEndTime,jdbcType=TIMESTAMP}
group by createTime
group by createTime) a
order by a.createTime
</select>
</mapper>
\ No newline at end of file
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformAppDownloadMapper.xml
View file @
ff67c89
...
...
@@ -29,7 +29,8 @@
</select>
<select
id=
"getAppDownloadStatistic"
resultType=
"map"
>
select date_format(pad.create_time, '%Y-%m-%d') `time`,
select * from
(select date_format(pad.create_time, '%Y-%m-%d') `time`,
count(pad.create_time) `count`
from t_platform_app_download pad
left join t_platform_customer pc on pc.id = pad.customer_id
...
...
@@ -40,6 +41,7 @@
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time
group by time) a
order by a.time
</select>
</mapper>
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformDeviceMapper.xml
View file @
ff67c89
...
...
@@ -86,17 +86,20 @@
</select>
<select
id=
"getDeviceAccessTrendList"
resultType=
"java.util.Map"
>
select
select * from
(select
date_format(activat_time,'%Y-%m-%d') as activatTime,
count(id) as num
from t_platform_device
where activat_time >= #{statisticStartTime,jdbcType=TIMESTAMP}
and activat_time
<
#{statisticEndTime,jdbcType=TIMESTAMP}
group by activatTime
group by activatTime) a
order by a.activatTime
</select>
<select
id=
"getDeviceActivationStatistic"
resultType=
"map"
>
select date_format(pd.activat_time, '%Y-%m-%d') `time`,
select * from
(select date_format(pd.activat_time, '%Y-%m-%d') `time`,
count(pd.activat_time) `count`
from t_platform_device pd
left join t_platform_customer pc on pc.id = pd.customer_id
...
...
@@ -107,7 +110,21 @@
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time
group by time) a
order by a.time
</select>
<select
id=
"getDeviceCountByCustomerId"
resultType=
"java.lang.Integer"
>
select count(1)
from t_platform_device
where customer_id = #{customerId,jdbcType=INTEGER}
</select>
<select
id=
"getacticveDeviceCountByCustomerId"
resultType=
"java.lang.Integer"
>
select count(1)
from t_platform_device
where status = 1
and customer_id = #{customerId,jdbcType=INTEGER}
</select>
</mapper>
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformUserMapper.xml
View file @
ff67c89
...
...
@@ -75,7 +75,8 @@
</select>
<select
id=
"getUserActivityStatistic"
resultType=
"map"
>
select date_format(pu.last_login_time, '%Y-%m-%d') `time`,
select * from
(select date_format(pu.last_login_time, '%Y-%m-%d') `time`,
count(pu.last_login_time) `count`
from t_platform_user pu
left join t_platform_customer pc on pc.id = pu.customer_id
...
...
@@ -86,8 +87,20 @@
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time
group by time) a
order by a.time
</select>
<select
id=
"getCustomerId"
resultType=
"java.lang.Integer"
>
select customer_id
from t_platform_user
where id = #{userId,jdbcType=INTEGER}
</select>
<select
id=
"getUserCountByCustomerId"
resultType=
"java.lang.Integer"
>
select count(1)
from t_platform_user
where customer_id = #{customerId,jdbcType=INTEGER}
</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