Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
9e4b5191
提交
9e4b5191
authored
9月 24, 2022
作者:
gh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户付费激活与近月平均充值
上级
b1a6e9bb
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
647 行增加
和
9 行删除
+647
-9
AsynchronousSpringEventsConfig.java
...com/yaoyaozw/customer/AsynchronousSpringEventsConfig.java
+20
-0
IntegrationRequestDTO.java
...yaozw/customer/dto/integration/IntegrationRequestDTO.java
+35
-0
AccountOrder.java
src/main/java/com/yaoyaozw/customer/entity/AccountOrder.java
+74
-0
RegisterUserEntity.java
...java/com/yaoyaozw/customer/entity/RegisterUserEntity.java
+116
-0
AccountOrderMapper.java
...java/com/yaoyaozw/customer/mapper/AccountOrderMapper.java
+19
-0
RegisterUserEntityMapper.java
...om/yaoyaozw/customer/mapper/RegisterUserEntityMapper.java
+10
-0
SchedulingTask.java
...java/com/yaoyaozw/customer/scheduling/SchedulingTask.java
+50
-0
AccountOrderService.java
...va/com/yaoyaozw/customer/service/AccountOrderService.java
+22
-0
RegisterUserEntityService.java
.../yaoyaozw/customer/service/RegisterUserEntityService.java
+9
-0
AccountOrderServiceImpl.java
...oyaozw/customer/service/impl/AccountOrderServiceImpl.java
+94
-0
RegisterUserEntityServiceImpl.java
.../customer/service/impl/RegisterUserEntityServiceImpl.java
+13
-0
WechatResponseEntity.java
.../customer/service/wechat/entity/WechatResponseEntity.java
+15
-0
WeChatRestService.java
...zw/customer/service/wechat/service/WeChatRestService.java
+45
-0
WeChatService.java
...oyaozw/customer/service/wechat/service/WeChatService.java
+9
-0
WeChatServiceImpl.java
...zw/customer/service/wechat/service/WeChatServiceImpl.java
+17
-0
UserAvgAmountVO.java
src/main/java/com/yaoyaozw/customer/vo/UserAvgAmountVO.java
+23
-0
application-dev.yml
src/main/resources/application-dev.yml
+0
-3
application-pro.yml
src/main/resources/application-pro.yml
+0
-3
application-test.yml
src/main/resources/application-test.yml
+0
-3
AccountOrderMapper.xml
src/main/resources/mapper/AccountOrderMapper.xml
+50
-0
RegisterUserEntityMapper.xml
src/main/resources/mapper/RegisterUserEntityMapper.xml
+26
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/AsynchronousSpringEventsConfig.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.event.ApplicationEventMulticaster
;
import
org.springframework.context.event.SimpleApplicationEventMulticaster
;
import
org.springframework.core.task.SimpleAsyncTaskExecutor
;
import
org.springframework.stereotype.Component
;
@Component
public
class
AsynchronousSpringEventsConfig
{
@Bean
(
name
=
"applicationEventMulticaster"
)
public
ApplicationEventMulticaster
simpleApplicationEventMulticaster
()
{
SimpleApplicationEventMulticaster
eventMulticaster
=
new
SimpleApplicationEventMulticaster
();
eventMulticaster
.
setTaskExecutor
(
new
SimpleAsyncTaskExecutor
());
return
eventMulticaster
;
}
}
src/main/java/com/yaoyaozw/customer/dto/integration/IntegrationRequestDTO.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
dto
.
integration
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 获取数据DTO
*/
@Data
public
class
IntegrationRequestDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
9128287125234317100L
;
/**
* 获取数据的事件
* 例如: 2021-04-01 00:00:00
*/
private
Date
requestDate
;
/**
* 数据频次
* 例如: 实时
*/
private
Integer
dataFrequency
;
/**
* 获取的数据类型
* 渠道账号, 用户数据, 订单, 消耗
* 例如: 渠道账号
*/
private
String
dataType
;
}
src/main/java/com/yaoyaozw/customer/entity/AccountOrder.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
lombok.Data
;
/**
* 订单表
*/
@Data
@TableName
(
value
=
"account_order"
)
public
class
AccountOrder
implements
Serializable
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 投放信息外键
*/
@TableField
(
value
=
"setup_id"
)
private
Long
setupId
;
/**
* 分成后收入
*/
@TableField
(
value
=
"profit"
)
private
Double
profit
;
/**
* 下单完成时间
*/
@TableField
(
value
=
"finish_time"
)
private
Date
finishTime
;
/**
* 类型
*/
@TableField
(
value
=
"`type`"
)
private
Integer
type
;
/**
* 用户OPENID
*/
@TableField
(
value
=
"open_id"
)
private
String
openId
;
/**
* 用户关注时间
*/
@TableField
(
value
=
"user_subscribe_time"
)
private
Date
userSubscribeTime
;
private
static
final
long
serialVersionUID
=
1L
;
public
static
final
String
COL_ID
=
"id"
;
public
static
final
String
COL_SETUP_ID
=
"setup_id"
;
public
static
final
String
COL_PROFIT
=
"profit"
;
public
static
final
String
COL_FINISH_TIME
=
"finish_time"
;
public
static
final
String
COL_TYPE
=
"type"
;
public
static
final
String
COL_OPEN_ID
=
"open_id"
;
public
static
final
String
COL_USER_SUBSCRIBE_TIME
=
"user_subscribe_time"
;
}
\ No newline at end of file
src/main/java/com/yaoyaozw/customer/entity/RegisterUserEntity.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
lombok.Data
;
/**
* 注册用户信息
*/
@Data
@TableName
(
value
=
"register_user_entity"
)
public
class
RegisterUserEntity
implements
Serializable
{
/**
* 主键
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* app_id
*/
@TableField
(
value
=
"app_id"
)
private
String
appId
;
/**
* openid
*/
@TableField
(
value
=
"open_id"
)
private
String
openId
;
/**
* 投放信息id
*/
@TableField
(
value
=
"setup_id"
)
private
Long
setupId
;
/**
* 未付费0/付费1/VIP 2
*/
@TableField
(
value
=
"pay_type"
)
private
Integer
payType
;
/**
* 支付次数
*/
@TableField
(
value
=
"pay_num"
)
private
Integer
payNum
;
/**
* 累充金额
*/
@TableField
(
value
=
"pay_amount"
)
private
Double
payAmount
;
/**
* 近一月平均金额
*/
@TableField
(
value
=
"avg_month"
)
private
Double
avgMonth
;
/**
* 最近活跃时间
*/
@TableField
(
value
=
"last_active"
)
private
Date
lastActive
;
/**
* 创建时间
*/
@TableField
(
value
=
"gmt_create"
)
private
Date
gmtCreate
;
/**
* 延时客服序列
*/
@TableField
(
value
=
"customer_sort"
)
private
Integer
customerSort
;
/**
* 延时客服发送时间
*/
@TableField
(
value
=
"customer_publish"
)
private
Date
customerPublish
;
private
static
final
long
serialVersionUID
=
1L
;
public
static
final
String
COL_ID
=
"id"
;
public
static
final
String
COL_APP_ID
=
"app_id"
;
public
static
final
String
COL_OPEN_ID
=
"open_id"
;
public
static
final
String
COL_SETUP_ID
=
"setup_id"
;
public
static
final
String
COL_PAY_TYPE
=
"pay_type"
;
public
static
final
String
COL_PAY_NUM
=
"pay_num"
;
public
static
final
String
COL_PAY_AMOUNT
=
"pay_amount"
;
public
static
final
String
COL_AVG_MONTH
=
"avg_month"
;
public
static
final
String
COL_LAST_ACTIVE
=
"last_active"
;
public
static
final
String
COL_GMT_CREATE
=
"gmt_create"
;
public
static
final
String
COL_CUSTOMER_SORT
=
"customer_sort"
;
public
static
final
String
COL_CUSTOMER_PUBLISH
=
"customer_publish"
;
}
\ No newline at end of file
src/main/java/com/yaoyaozw/customer/mapper/AccountOrderMapper.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yaoyaozw.customer.entity.AccountOrder
;
import
com.yaoyaozw.customer.vo.UserAvgAmountVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Date
;
import
java.util.List
;
@Mapper
public
interface
AccountOrderMapper
extends
BaseMapper
<
AccountOrder
>
{
List
<
AccountOrder
>
findNewestRuntimeAccountOrder
();
List
<
UserAvgAmountVO
>
findMonthDailyAccountOrder
();
}
\ No newline at end of file
src/main/java/com/yaoyaozw/customer/mapper/RegisterUserEntityMapper.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yaoyaozw.customer.entity.RegisterUserEntity
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
RegisterUserEntityMapper
extends
BaseMapper
<
RegisterUserEntity
>
{
}
\ No newline at end of file
src/main/java/com/yaoyaozw/customer/scheduling/SchedulingTask.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
scheduling
;
import
com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO
;
import
com.yaoyaozw.customer.service.AccountOrderService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
java.util.Calendar
;
@Component
public
class
SchedulingTask
{
@Autowired
private
AccountOrderService
accountOrderService
;
/**
* 拉取付费订单(每15min一次)
*/
public
void
retrieveOrderData
(){
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
SECOND
,
0
);
calendar
.
set
(
Calendar
.
MILLISECOND
,
0
);
IntegrationRequestDTO
integrationRequestDTO
=
new
IntegrationRequestDTO
();
accountOrderService
.
activeUserByOrder
(
integrationRequestDTO
);
}
/**
* 更新付费用户近一月平均充值(每天一次)
*/
public
void
retrieveMonthOrder
(){
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
SECOND
,
0
);
calendar
.
set
(
Calendar
.
MILLISECOND
,
0
);
IntegrationRequestDTO
integrationRequestDTO
=
new
IntegrationRequestDTO
();
accountOrderService
.
calculateAvgMonth
(
integrationRequestDTO
);
}
}
src/main/java/com/yaoyaozw/customer/service/AccountOrderService.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
service
;
import
com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO
;
import
com.yaoyaozw.customer.entity.AccountOrder
;
import
com.baomidou.mybatisplus.extension.service.IService
;
public
interface
AccountOrderService
extends
IService
<
AccountOrder
>
{
/**
* 付费激活
* @param integrationRequestDTO
*/
void
activeUserByOrder
(
IntegrationRequestDTO
integrationRequestDTO
);
/**
* 计算近一月平均付费
* @param integrationRequestDTO
*/
void
calculateAvgMonth
(
IntegrationRequestDTO
integrationRequestDTO
);
}
src/main/java/com/yaoyaozw/customer/service/RegisterUserEntityService.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
service
;
import
com.yaoyaozw.customer.entity.RegisterUserEntity
;
import
com.baomidou.mybatisplus.extension.service.IService
;
public
interface
RegisterUserEntityService
extends
IService
<
RegisterUserEntity
>{
}
src/main/java/com/yaoyaozw/customer/service/impl/AccountOrderServiceImpl.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO
;
import
com.yaoyaozw.customer.entity.RegisterUserEntity
;
import
com.yaoyaozw.customer.service.RegisterUserEntityService
;
import
com.yaoyaozw.customer.vo.UserAvgAmountVO
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yaoyaozw.customer.mapper.AccountOrderMapper
;
import
com.yaoyaozw.customer.entity.AccountOrder
;
import
com.yaoyaozw.customer.service.AccountOrderService
;
@Service
public
class
AccountOrderServiceImpl
extends
ServiceImpl
<
AccountOrderMapper
,
AccountOrder
>
implements
AccountOrderService
{
@Autowired
private
RegisterUserEntityService
registerUserEntityService
;
@Override
public
void
activeUserByOrder
(
IntegrationRequestDTO
integrationRequestDTO
)
{
//获取runtime订单最新一版数据
List
<
AccountOrder
>
runtimeOrders
=
baseMapper
.
findNewestRuntimeAccountOrder
();
Set
<
String
>
openIdSet
=
runtimeOrders
.
stream
().
map
(
AccountOrder:
:
getOpenId
).
collect
(
Collectors
.
toSet
());
Map
<
String
,
List
<
AccountOrder
>>
userOrderMap
=
runtimeOrders
.
stream
().
collect
(
Collectors
.
groupingBy
(
AccountOrder:
:
getOpenId
));
//获取注册用户信息
List
<
RegisterUserEntity
>
userList
=
registerUserEntityService
.
list
(
new
QueryWrapper
<
RegisterUserEntity
>().
in
(
RegisterUserEntity
.
COL_OPEN_ID
,
openIdSet
));
for
(
RegisterUserEntity
registerUser
:
userList
)
{
//获取用户订单
List
<
AccountOrder
>
accountOrders
=
userOrderMap
.
get
(
registerUser
.
getOpenId
());
Date
lastFinishTime
=
registerUser
.
getLastActive
();
int
type
=
registerUser
.
getPayType
()!=
null
?
registerUser
.
getPayType
():
0
;
Double
sum
=
registerUser
.
getPayAmount
();
for
(
AccountOrder
accountOrder
:
accountOrders
)
{
//最近时间
lastFinishTime
=
(
lastFinishTime
!=
null
&&
lastFinishTime
.
compareTo
(
accountOrder
.
getFinishTime
())
>
0
)
?
lastFinishTime
:
accountOrder
.
getFinishTime
();
//最大类型
type
=
Math
.
max
(
accountOrder
.
getType
()
+
1
,
type
);
sum
+=
accountOrder
.
getProfit
();
}
//计算用户信息
if
(
registerUser
.
getLastActive
()==
null
){
//排期重置....
}
//活跃时间重置
registerUser
.
setLastActive
(
lastFinishTime
);
//如果类型大于当前类型
registerUser
.
setPayType
(
type
);
//累计次数
registerUser
.
setPayNum
(
registerUser
.
getPayNum
()+
accountOrders
.
size
());
//累计金额
registerUser
.
setPayAmount
(
sum
);
}
registerUserEntityService
.
updateBatchById
(
userList
);
}
@Override
public
void
calculateAvgMonth
(
IntegrationRequestDTO
integrationRequestDTO
)
{
//获取近一月每个用户的平均充值
List
<
UserAvgAmountVO
>
userAvgAmountVos
=
baseMapper
.
findMonthDailyAccountOrder
();
Map
<
String
,
Double
>
userAvgAmountMap
=
userAvgAmountVos
.
stream
().
collect
(
Collectors
.
toMap
(
UserAvgAmountVO:
:
getOpenId
,
UserAvgAmountVO:
:
getAvgAmount
,
(
v1
,
v2
)
->
v1
));
//获取注册用户信息
List
<
RegisterUserEntity
>
userList
=
registerUserEntityService
.
list
(
new
QueryWrapper
<
RegisterUserEntity
>().
gt
(
RegisterUserEntity
.
COL_PAY_TYPE
,
0
));
if
(
userList
!=
null
&&!
userList
.
isEmpty
()){
for
(
RegisterUserEntity
registerUserEntity
:
userList
)
{
registerUserEntity
.
setAvgMonth
(
userAvgAmountMap
.
get
(
registerUserEntity
.
getOpenId
()));
}
}
registerUserEntityService
.
updateBatchById
(
userList
);
}
}
src/main/java/com/yaoyaozw/customer/service/impl/RegisterUserEntityServiceImpl.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
service
.
impl
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yaoyaozw.customer.mapper.RegisterUserEntityMapper
;
import
com.yaoyaozw.customer.entity.RegisterUserEntity
;
import
com.yaoyaozw.customer.service.RegisterUserEntityService
;
@Service
public
class
RegisterUserEntityServiceImpl
extends
ServiceImpl
<
RegisterUserEntityMapper
,
RegisterUserEntity
>
implements
RegisterUserEntityService
{
}
src/main/java/com/yaoyaozw/customer/service/wechat/entity/WechatResponseEntity.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
service
.
wechat
.
entity
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
WechatResponseEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
7200832532059064880L
;
private
Integer
errcode
;
private
String
errmsg
;
}
src/main/java/com/yaoyaozw/customer/service/wechat/service/WeChatRestService.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
service
.
wechat
.
service
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.web.client.RestClientException
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.util.UriComponents
;
import
org.springframework.web.util.UriComponentsBuilder
;
import
java.util.Map
;
@Service
public
class
WeChatRestService
{
/**
* POST请求
* @param fullPath 请求路径
* @param queryMap query
* @param requestMap Body
* @param urlParams 路径变量
* @param responseEntity 返回实体
* @param <T> 泛型
* @return 响应结果
* @throws RestClientException 异常
*/
public
<
T
>
ResponseEntity
<
T
>
postRequest
(
String
fullPath
,
MultiValueMap
<
String
,
String
>
queryMap
,
Map
<
String
,
Object
>
requestMap
,
Map
<
String
,
Object
>
urlParams
,
Class
<
T
>
responseEntity
)
throws
RestClientException
{
RestTemplate
restTemplate
=
new
RestTemplate
();
UriComponentsBuilder
uriComponentsBuilder
=
UriComponentsBuilder
.
fromHttpUrl
(
fullPath
).
queryParams
(
queryMap
);
UriComponents
uriComponents
=
uriComponentsBuilder
.
build
();
if
(
urlParams
!=
null
){
uriComponents
=
uriComponentsBuilder
.
buildAndExpand
(
urlParams
);
}
ResponseEntity
<
T
>
result
=
restTemplate
.
postForEntity
(
uriComponents
.
toUri
(),
requestMap
,
responseEntity
);
return
result
;
}
}
src/main/java/com/yaoyaozw/customer/service/wechat/service/WeChatService.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
service
.
wechat
.
service
;
public
interface
WeChatService
{
/**
* 发送客服消息
*/
void
sendCustomerServiceMessage
();
}
src/main/java/com/yaoyaozw/customer/service/wechat/service/WeChatServiceImpl.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
service
.
wechat
.
service
;
import
org.springframework.stereotype.Service
;
@Service
public
class
WeChatServiceImpl
implements
WeChatService
{
@Override
public
void
sendCustomerServiceMessage
()
{
//根据人群包发送客服
}
}
src/main/java/com/yaoyaozw/customer/vo/UserAvgAmountVO.java
0 → 100644
浏览文件 @
9e4b5191
package
com
.
yaoyaozw
.
customer
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
@Data
public
class
UserAvgAmountVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
5172574895622870993L
;
private
String
openId
;
private
Double
avgAmount
;
}
src/main/resources/application-dev.yml
浏览文件 @
9e4b5191
...
...
@@ -20,5 +20,3 @@ mybatis-plus:
logging
:
level
:
com.example.material.mapper
:
debug
wx
:
requestUrl
:
https://api.weixin.qq.com
\ No newline at end of file
src/main/resources/application-pro.yml
浏览文件 @
9e4b5191
...
...
@@ -21,5 +21,3 @@ mybatis-plus:
logging
:
level
:
com.example.material.mapper
:
debug
wx
:
requestUrl
:
https://api.weixin.qq.com
\ No newline at end of file
src/main/resources/application-test.yml
浏览文件 @
9e4b5191
...
...
@@ -20,5 +20,3 @@ mybatis-plus:
logging
:
level
:
com.example.material.mapper
:
debug
wx
:
requestUrl
:
https://api.weixin.qq.com
\ No newline at end of file
src/main/resources/mapper/AccountOrderMapper.xml
0 → 100644
浏览文件 @
9e4b5191
<?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">
<mapper
namespace=
"com.yaoyaozw.customer.mapper.AccountOrderMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yaoyaozw.customer.entity.AccountOrder"
>
<!--@mbg.generated-->
<!--@Table account_order-->
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"setup_id"
jdbcType=
"BIGINT"
property=
"setupId"
/>
<result
column=
"profit"
jdbcType=
"DOUBLE"
property=
"profit"
/>
<result
column=
"finish_time"
jdbcType=
"TIMESTAMP"
property=
"finishTime"
/>
<result
column=
"type"
jdbcType=
"BIGINT"
property=
"type"
/>
<result
column=
"open_id"
jdbcType=
"VARCHAR"
property=
"openId"
/>
<result
column=
"user_subscribe_time"
jdbcType=
"TIMESTAMP"
property=
"userSubscribeTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--@mbg.generated-->
id, setup_id, profit, finish_time, `type`, open_id, user_subscribe_time
</sql>
<select
id=
"findNewestRuntimeAccountOrder"
resultMap=
"BaseResultMap"
>
SELECT
ao.id, ao.setup_id, ao.profit, ao.finish_time, ao.`type`, ao.open_id, ao.user_subscribe_time
FROM
account_order ao
INNER JOIN ( SELECT max( gmt_create) AS maxDate FROM account_order where data_frequency=0 and gmt_create>CURRENT_DATE ) st ON
ao.gmt_create = st.maxDate
where ao.data_frequency=0 and ao.open_id LIKE 'o%'
</select>
<select
id=
"findMonthDailyAccountOrder"
resultType=
"com.yaoyaozw.customer.vo.UserAvgAmountVO"
>
SELECT
open_id,convert(SUM(profit)/(if(datediff(CURDATE(),user_subscribe_time)
<
30,datediff(CURDATE(),user_subscribe_time),30)),decimal(8,2))
FROM
account_order
where data_frequency=1 and open_id LIKE 'o%' and datediff(CURDATE(),finish_time)
<
30 GROUP BY open_id
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/RegisterUserEntityMapper.xml
0 → 100644
浏览文件 @
9e4b5191
<?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">
<mapper
namespace=
"com.yaoyaozw.customer.mapper.RegisterUserEntityMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yaoyaozw.customer.entity.RegisterUserEntity"
>
<!--@mbg.generated-->
<!--@Table register_user_entity-->
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"app_id"
jdbcType=
"VARCHAR"
property=
"appId"
/>
<result
column=
"open_id"
jdbcType=
"VARCHAR"
property=
"openId"
/>
<result
column=
"setup_id"
jdbcType=
"BIGINT"
property=
"setupId"
/>
<result
column=
"pay_type"
jdbcType=
"INTEGER"
property=
"payType"
/>
<result
column=
"pay_num"
jdbcType=
"INTEGER"
property=
"payNum"
/>
<result
column=
"pay_amount"
jdbcType=
"DOUBLE"
property=
"payAmount"
/>
<result
column=
"avg_month"
jdbcType=
"DOUBLE"
property=
"avgMonth"
/>
<result
column=
"last_active"
jdbcType=
"TIMESTAMP"
property=
"lastActive"
/>
<result
column=
"gmt_create"
jdbcType=
"TIMESTAMP"
property=
"gmtCreate"
/>
<result
column=
"customer_sort"
jdbcType=
"INTEGER"
property=
"customerSort"
/>
<result
column=
"customer_publish"
jdbcType=
"TIMESTAMP"
property=
"customerPublish"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--@mbg.generated-->
id, app_id, open_id, setup_id, pay_type, pay_num, pay_amount, avg_month, last_active,
gmt_create, customer_sort, customer_publish
</sql>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论