Commit 5142423e by 杨林龙

1.50.0 开发1.50.0需求版本 优化用户行为按天统计行为查询展示

1 parent 0b5018e7
...@@ -20,6 +20,18 @@ public class UserBehaviorDayDTO implements Serializable { ...@@ -20,6 +20,18 @@ public class UserBehaviorDayDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 年
*/
@ApiModelProperty(value = "年")
private Integer yearInt;
/**
* 月
*/
@ApiModelProperty(value = "月")
private Integer monthInt;
/**
* 天 * 天
*/ */
@ApiModelProperty(value = "天") @ApiModelProperty(value = "天")
......
...@@ -476,7 +476,7 @@ public class RiskAssessmentService { ...@@ -476,7 +476,7 @@ public class RiskAssessmentService {
log.info("userBehaviorDayDTOMap===" + JSONUtil.toJsonStr(userBehaviorDayDTOMap)); log.info("userBehaviorDayDTOMap===" + JSONUtil.toJsonStr(userBehaviorDayDTOMap));
for (int i = minDayInt; i < maxDayInt + 1; i++) { for (int i = minDayInt; i < maxDayInt + 1; i++) {
Integer dayNum = userBehaviorDayDTOMap.getOrDefault(i, 0); Integer dayNum = userBehaviorDayDTOMap.getOrDefault(i, 0);
userBehaviorDayNewList.add(new UserBehaviorDayDTO(i, dayNum)); userBehaviorDayNewList.add(new UserBehaviorDayDTO(0, 0, i, dayNum));
} }
// 如果集合全部为0 则返回空数据 // 如果集合全部为0 则返回空数据
......
...@@ -69,8 +69,10 @@ ...@@ -69,8 +69,10 @@
<select id="statisticsDeviceJourneyWithDay" <select id="statisticsDeviceJourneyWithDay"
resultType="cn.com.glsx.admin.modules.model.dto.UserBehaviorDayDTO"> resultType="cn.com.glsx.admin.modules.model.dto.UserBehaviorDayDTO">
SELECT SELECT
YEAR(begin_time) AS yearInt,
MONTH(begin_time) AS monthInt,
DAY(begin_time) AS dayInt, DAY(begin_time) AS dayInt,
sum(mileage)/1000 AS dayNum SUM(mileage)/1000 AS dayNum
FROM t_device_journey FROM t_device_journey
WHERE sn = #{sn} WHERE sn = #{sn}
GROUP BY dayInt GROUP BY dayInt
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!