libo лет назад: 4
Родитель
Сommit
0a2bbfceac

+ 2 - 2
src/main/java/com/tdba/cxb/ares/api/repository/UserMapper.java

@@ -38,8 +38,8 @@ public interface UserMapper {
38
     List<UserDto> selectChannel(@Param("beginTime")Long beginTime,
38
     List<UserDto> selectChannel(@Param("beginTime")Long beginTime,
39
                                @Param("endTime")Long endTime);
39
                                @Param("endTime")Long endTime);
40
 
40
 
41
-    List<UserDto> selectAgent(@Param("beginTime")Long beginTime,
42
-                               @Param("endTime")Long endTime);
41
+    List<UserDto> selectAgent(@Param("beginTime")LocalDateTime beginTime,
42
+                               @Param("endTime")LocalDateTime endTime);
43
 
43
 
44
     UserVo selectByAccount(@Param("mobile") String mobile);
44
     UserVo selectByAccount(@Param("mobile") String mobile);
45
 
45
 

+ 1 - 1
src/main/java/com/tdba/cxb/ares/api/service/UserService.java

@@ -265,7 +265,7 @@ public class UserService {
265
      */
265
      */
266
     public void resolverAgent(LocalDate localDate){
266
     public void resolverAgent(LocalDate localDate){
267
         LocalDateTime currentTime = LocalDateTime.now();
267
         LocalDateTime currentTime = LocalDateTime.now();
268
-        List<UserDto> userList = userMapper.selectAgent(LocalDateTime.of(localDate, LocalTime.MIN).toEpochSecond(ZoneOffset.ofHours(8)), LocalDateTime.of(localDate, LocalTime.MAX).toEpochSecond(ZoneOffset.ofHours(8)));
268
+        List<UserDto> userList = userMapper.selectAgent(LocalDateTime.of(localDate, LocalTime.MIN), LocalDateTime.of(localDate, LocalTime.MAX));
269
         List<UserCount> resultList = new ArrayList<>();
269
         List<UserCount> resultList = new ArrayList<>();
270
         userList.stream().forEach(row -> {
270
         userList.stream().forEach(row -> {
271
             if(0 < row.getNum()) {
271
             if(0 < row.getNum()) {

+ 4 - 8
src/main/resources/mapper/UserMapper.xml

@@ -71,18 +71,14 @@
71
     <select id="selectAgent" resultType="com.tdba.cxb.ares.api.model.UserDto">
71
     <select id="selectAgent" resultType="com.tdba.cxb.ares.api.model.UserDto">
72
         select
72
         select
73
             count(1) 'num',
73
             count(1) 'num',
74
-            u.spread_uid,
74
+                u.spread_uid,
75
             group_concat(u.uid) 'uid_concat'
75
             group_concat(u.uid) 'uid_concat'
76
         from
76
         from
77
-            rrx_user_agent da
78
-            left join
79
             rrx_user u
77
             rrx_user u
80
-            on da.user_id = u.uid
81
         where
78
         where
82
-            da.status = 1
83
-            and u.identity in (1, 2, 3)
84
-            <![CDATA[ and da.add_time >= #{beginTime} ]]>
85
-            <![CDATA[ and da.add_time <= #{endTime} ]]>
79
+            u.identity in (1, 2, 3)
80
+            <![CDATA[ and u.create_time >= #{beginTime} ]]>
81
+            <![CDATA[ and u.create_time <= #{endTime} ]]>
86
             and u.spread_uid > 0
82
             and u.spread_uid > 0
87
         group by u.spread_uid
83
         group by u.spread_uid
88
     </select>
84
     </select>