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 f2a63078
authored
Dec 18, 2020
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
格式化代码
1 parent
0420d1bd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
213 additions
and
226 deletions
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformAdMapper.xml
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformApiCallMapper.xml
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformApiMapper.xml
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformAppDownloadMapper.xml
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformCustomerMapper.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-container/src/main/resources/META-INF/orm/PlatformAdMapper.xml
View file @
f2a6307
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.com.glsx.openplatform.mapper.PlatformAdMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.openplatform.model.PlatformAd"
>
<!--@mbg.generated-->
...
...
@@ -28,4 +29,4 @@
<include
refid=
"Base_Column_List"
/>
from t_platform_ad
</select>
</mapper>
\ No newline at end of file
</mapper>
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformApiCallMapper.xml
View file @
f2a6307
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.com.glsx.openplatform.mapper.PlatformApiCallMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.openplatform.model.PlatformApiCall"
>
<!--@mbg.generated-->
...
...
@@ -19,52 +20,49 @@
id, customer_id, api_id, call_result, create_time, create_by, remark
</sql>
<select
id=
"getApiCallMgrList"
parameterType=
"cn.com.glsx.openplatform.vo.ApiCallVo"
resultMap=
"BaseResultMap"
>
select
a.id,
b.customer_name,
c.api_name,
a.call_result,
a.create_time,
a.create_by,
a.remark
<select
id=
"getApiCallMgrList"
parameterType=
"cn.com.glsx.openplatform.vo.ApiCallVo"
resultMap=
"BaseResultMap"
>
select
a.id,
b.customer_name,
c.api_name,
a.call_result,
a.create_time,
a.create_by,
a.remark
from t_platform_api_call a
left join t_platform_customer b
on a.customer_id = b.id
left join t_platform_api c
on a.api_id = c.id
where 1=1
<if
test=
"accessStartTime != null "
>
left join t_platform_customer b on a.customer_id = b.id
left join t_platform_api c on a.api_id = c.id
where 1 = 1
<if
test=
"accessStartTime != null"
>
and create_time
>
= #{accessStartTime,jdbcType=TIMESTAMP}
</if>
<if
test=
"accessEndTime != null
"
>
<if
test=
"accessEndTime != null"
>
and create_time
<
= #{accessEndTime,jdbcType=TIMESTAMP}
</if>
</select>
<select
id=
"getApiCallCount"
resultType=
"java.lang.Integer"
>
select count(1)
from t_platform_api_call
</select>
select count(1)
from t_platform_api_call
</select>
<select
id=
"getApiCallGraphData"
resultType=
"java.util.Map"
>
select b.api_classification as apiClassification,
count(a.id) as num
from t_platform_api_call a
left join t_platform_api b
on a.api_id = b.id
group by apiClassification
</select>
select b.api_classification as apiClassification,
count(a.id) as num
from t_platform_api_call a
left join t_platform_api b on a.api_id = b.id
group by apiClassification
</select>
<select
id=
"getApiCallTrendList"
resultType=
"java.util.Map"
>
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) a
order by a.createTime
</select>
</mapper>
\ No newline at end of file
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) a
order by a.createTime
</select>
</mapper>
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformApiMapper.xml
View file @
f2a6307
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.com.glsx.openplatform.mapper.PlatformApiMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.openplatform.model.PlatformApi"
>
<!--@mbg.generated-->
...
...
@@ -28,4 +29,4 @@
<include
refid=
"Base_Column_List"
/>
from t_platform_api
</select>
</mapper>
\ No newline at end of file
</mapper>
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformAppDownloadMapper.xml
View file @
f2a6307
...
...
@@ -19,8 +19,7 @@
<select
id=
"getApiCallCountAuth"
resultType=
"java.lang.Integer"
>
select count(1)
from t_platform_app_download a
left join t_platform_customer b
on a.customer_id = b.id
left join t_platform_customer b on a.customer_id = b.id
<where>
<if
test=
"customerName != null and customerName != ''"
>
and b.customer_name = #{customerName,jdbcType=VARCHAR}
...
...
@@ -29,19 +28,20 @@
</select>
<select
id=
"getAppDownloadStatistic"
resultType=
"map"
>
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
<where>
pad.create_time >= #{startTime,jdbcType=TIMESTAMP}
and pad.create_time
<
#{endTime,jdbcType=TIMESTAMP}
<if
test=
"customerName != null and customerName != ''"
>
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time) a
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
<where>
pad.create_time >= #{startTime,jdbcType=TIMESTAMP}
and pad.create_time
<
#{endTime,jdbcType=TIMESTAMP}
<if
test=
"customerName != null and customerName != ''"
>
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time) a
order by a.time
</select>
</mapper>
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformCustomerMapper.xml
View file @
f2a6307
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.com.glsx.openplatform.mapper.PlatformCustomerMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.openplatform.model.PlatformCustomer"
>
<!--@mbg.generated-->
...
...
@@ -35,61 +36,56 @@
</sql>
<select
id=
"getCustomerMgrList"
resultMap=
"BaseResultMap"
>
select
a.id,
a.customer_name,
a.contact_person,
a.`password`,
a.contact_number,
a.contact_email,
a.province,
b.area_name as provinceName,
a.city,
c.area_name as cityName,
concat(b.area_name,c.area_name,d.area_name,a.address) as address,
a.`status`,
a.public_key,
a.private_key,
a.channel_number,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
select a.id,
a.customer_name,
a.contact_person,
a.`password`,
a.contact_number,
a.contact_email,
a.province,
b.area_name as provinceName,
a.city,
c.area_name as cityName,
concat(b.area_name, c.area_name, d.area_name, a.address) as address,
a.`status`,
a.public_key,
a.private_key,
a.channel_number,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
from t_platform_customer a
left join t_sys_area b
on a.province = b.id
left join t_sys_area c
on a.city = c.id
left join t_sys_area d
on a.area = d.id
left join t_sys_area b on a.province = b.id
left join t_sys_area c on a.city = c.id
left join t_sys_area d on a.area = d.id
</select>
<select
id=
"getCustomerNameList"
resultType=
"java.lang.String"
>
select distinct
customer_name
from t_platform_customer
</select>
select distinct customer_name
from t_platform_customer
</select>
<select
id=
"getCustomerCount"
resultType=
"java.lang.Integer"
>
select count(1)
from t_platform_customer
</select>
select count(1)
from t_platform_customer
</select>
<select
id=
"login"
parameterType=
"cn.com.glsx.openplatform.model.PlatformCustomer"
resultType=
"java.lang.Integer"
>
select count(1)
from t_platform_customer
where contact_number = #{contactNumber,jdbcType=VARCHAR}
and password = #{password,jdbcType=VARCHAR}
</select>
<select
id=
"login"
parameterType=
"cn.com.glsx.openplatform.model.PlatformCustomer"
resultType=
"java.lang.Integer"
>
select count(1)
from t_platform_customer
where contact_number = #{contactNumber,jdbcType=VARCHAR}
and password = #{password,jdbcType=VARCHAR}
</select>
<select
id=
"getAddressOptionList"
resultType=
"java.lang.String"
>
select
area_name
select area_name
from t_sys_area
where 1 = 1
<choose>
<when
test=
"id != null and id != ''
"
>
<when
test=
"id != null and id != ''"
>
and parent_id = #{id,jdbcType=INTEGER}
</when>
<otherwise>
...
...
@@ -99,10 +95,8 @@
</select>
<select
id=
"getAddressStr"
resultType=
"java.lang.String"
>
select
area_name
select area_name
from t_sys_area
where id = #{id,jdbcType=INTEGER}
</select>
</mapper>
\ No newline at end of file
</mapper>
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformDeviceMapper.xml
View file @
f2a6307
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.com.glsx.openplatform.mapper.PlatformDeviceMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.openplatform.model.PlatformDevice"
>
<!--@mbg.generated-->
...
...
@@ -23,94 +24,91 @@
create_by, update_by, remark
</sql>
<select
id=
"getDeviceMgrList"
parameterType=
"cn.com.glsx.openplatform.vo.DeviceVo"
resultMap=
"BaseResultMap"
>
select
a.id,
a.device_sn,
a.device_type,
b.customer_name,
a.activat_time,
a.`status`,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
<select
id=
"getDeviceMgrList"
parameterType=
"cn.com.glsx.openplatform.vo.DeviceVo"
resultMap=
"BaseResultMap"
>
select
a.id,
a.device_sn,
a.device_type,
b.customer_name,
a.activat_time,
a.`status`,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
from t_platform_device a
left join t_platform_customer b
on a.customer_id = b.id
left join t_platform_customer b on a.customer_id = b.id
where 1 = 1
<if
test=
"customerName != null and customerName != ''
"
>
<if
test=
"customerName != null and customerName != ''"
>
and b.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
<if
test=
"deviceType != null and deviceType != ''
"
>
<if
test=
"deviceType != null and deviceType != ''"
>
and a.device_type = #{deviceType,jdbcType=VARCHAR}
</if>
<if
test=
"activatStartTime != null
"
>
<if
test=
"activatStartTime != null"
>
and a.create_time
>
= #{accessStartTime,jdbcType=TIMESTAMP}
</if>
<if
test=
"activatEndTime != null
"
>
<if
test=
"activatEndTime != null"
>
and a.create_time
<
= #{accessEndTime,jdbcType=TIMESTAMP}
</if>
</select>
<select
id=
"getDeviceTypeList"
resultType=
"java.lang.String"
>
select distinct
device_type
from t_platform_device
</select>
select distinct device_type
from t_platform_device
</select>
<select
id=
"getDeviceCount"
resultType=
"java.lang.Integer"
>
select count(1)
from t_platform_device
</select>
select count(1)
from t_platform_device
</select>
<select
id=
"getDeviceGraphData"
resultType=
"java.util.Map"
>
select
device_type as deviceType,
count(id) as num
from t_platform_device
group by deviceType
</select>
select device_type as deviceType,
count(id) as num
from t_platform_device
group by deviceType
</select>
<select
id=
"getDeviceCountAuth"
resultType=
"java.lang.Integer"
>
select count(1)
from t_platform_device a
left join t_platform_customer b
on a.customer_id = b.id
<where>
<if
test=
"customerName != null and customerName != ''"
>
and b.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
</select>
<select
id=
"getDeviceAccessTrendList"
resultType=
"java.util.Map"
>
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) a
order by a.activatTime
</select>
<select
id=
"getDeviceActivationStatistic"
resultType=
"map"
>
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
select count(1)
from t_platform_device a
left join t_platform_customer b on a.customer_id = b.id
<where>
pd.activat_time >= #{startTime,jdbcType=TIMESTAMP}
and pd.activat_time
<
#{endTime,jdbcType=TIMESTAMP}
<if
test=
"customerName != null and customerName != ''"
>
and
pc
.customer_name = #{customerName,jdbcType=VARCHAR}
and
b
.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time) a
</select>
<select
id=
"getDeviceAccessTrendList"
resultType=
"java.util.Map"
>
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) a
order by a.activatTime
</select>
<select
id=
"getDeviceActivationStatistic"
resultType=
"map"
>
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
<where>
pd.activat_time >= #{startTime,jdbcType=TIMESTAMP}
and pd.activat_time
<
#{endTime,jdbcType=TIMESTAMP}
<if
test=
"customerName != null and customerName != ''"
>
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time) a
order by a.time
</select>
...
...
@@ -124,7 +122,6 @@
select count(1)
from t_platform_device
where status = 1
and customer_id = #{customerId,jdbcType=INTEGER}
and customer_id = #{customerId,jdbcType=INTEGER}
</select>
</mapper>
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformUserMapper.xml
View file @
f2a6307
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.com.glsx.openplatform.mapper.PlatformUserMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.openplatform.model.PlatformUser"
>
<!--@mbg.generated-->
...
...
@@ -28,74 +29,70 @@
app_account_id, create_time, update_time, create_by, update_by, remark
</sql>
<select
id=
"getUserMgrList"
parameterType=
"cn.com.glsx.openplatform.vo.UserVo"
resultMap=
"BaseResultMap"
>
select
a.id,
a.nickname,
a.contact_number,
a.wechat_id,
a.province,
c.area_name as provinceName,
a.city,
d.area_name as cityName,
b.customer_name,
a.last_login_time,
a.app_account_id,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
<select
id=
"getUserMgrList"
parameterType=
"cn.com.glsx.openplatform.vo.UserVo"
resultMap=
"BaseResultMap"
>
select
a.id,
a.nickname,
a.contact_number,
a.wechat_id,
a.province,
c.area_name as provinceName,
a.city,
d.area_name as cityName,
b.customer_name,
a.last_login_time,
a.app_account_id,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
from t_platform_user a
left join t_platform_customer b
on a.customer_id = b.id
left join t_sys_area c
on a.province = c.id
left join t_sys_area d
on a.city = d.id
left join t_platform_customer b on a.customer_id = b.id
left join t_sys_area c on a.province = c.id
left join t_sys_area d on a.city = d.id
where 1 = 1
<if
test=
"customerName != null and customerName != ''
"
>
<if
test=
"customerName != null and customerName != ''"
>
and b.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
<if
test=
"registerStartTime != null
"
>
<if
test=
"registerStartTime != null"
>
and a.create_time
>
= #{registerStartTime,jdbcType=TIMESTAMP}
</if>
<if
test=
"registerEndTime != null
"
>
<if
test=
"registerEndTime != null"
>
and a.create_time
<
= #{registerEndTime,jdbcType=TIMESTAMP}
</if>
</select>
<select
id=
"getUserCount"
resultType=
"java.lang.Integer"
>
select count(1)
from t_platform_user
</select>
select count(1)
from t_platform_user
</select>
<select
id=
"getUserCountAuth"
resultType=
"java.lang.Integer"
>
select count(1)
from t_platform_user a
left join t_platform_customer b
on a.customer_id = b.id
<where>
<if
test=
"customerName != null and customerName != ''"
>
and b.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
</select>
<select
id=
"getUserActivityStatistic"
resultType=
"map"
>
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
select count(1)
from t_platform_user a
left join t_platform_customer b on a.customer_id = b.id
<where>
pu.last_login_time >= #{startTime,jdbcType=TIMESTAMP}
and pu.last_login_time
<
#{endTime,jdbcType=TIMESTAMP}
<if
test=
"customerName != null and customerName != ''"
>
and
pc
.customer_name = #{customerName,jdbcType=VARCHAR}
and
b
.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time) a
</select>
<select
id=
"getUserActivityStatistic"
resultType=
"map"
>
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
<where>
pu.last_login_time >= #{startTime,jdbcType=TIMESTAMP}
and pu.last_login_time
<
#{endTime,jdbcType=TIMESTAMP}
<if
test=
"customerName != null and customerName != ''"
>
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time) a
order by a.time
</select>
...
...
@@ -110,5 +107,4 @@
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