lyhzzz 2 년 전
부모
커밋
597166212c

+ 1 - 1
src/main/java/com/fdkankan/agent/controller/AgentNewLogController.java

@@ -24,7 +24,7 @@ public class AgentNewLogController extends BaseController {
 
     @GetMapping("/logData")
     public ResultData logData(){
-        return ResultData.ok( agentNewLogService.getLogDataM());
+        return ResultData.ok( agentNewLogService.getLogDataM(getAgent().getId()));
     }
 
     @PostMapping("/logList")

+ 2 - 1
src/main/java/com/fdkankan/agent/mapper/IAgentNewLogMapper.java

@@ -9,6 +9,7 @@ import com.fdkankan.agent.response.DownLogVo;
 import com.fdkankan.agent.response.LogDataVo;
 import com.fdkankan.agent.response.LogListVo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -25,6 +26,6 @@ public interface IAgentNewLogMapper extends BaseMapper<AgentNewLog> {
 
     Page<DownLogVo> downLogList(Page<Object> page, DownParam param);
 
-    List<AgentNewLog> getLogDataM();
+    List<AgentNewLog> getLogDataM(@Param("agentId") Integer agentId);
 
 }

+ 1 - 1
src/main/java/com/fdkankan/agent/service/IAgentNewLogService.java

@@ -26,7 +26,7 @@ public interface IAgentNewLogService extends IService<AgentNewLog> {
 
     void addDown(IncrementParam param, AgentNewVo agent);
 
-    LogDataVo getLogDataM();
+    LogDataVo getLogDataM(Integer agentId);
 
     PageInfo pageUnList(LogListParam param);
 

+ 2 - 2
src/main/java/com/fdkankan/agent/service/impl/AgentNewLogServiceImpl.java

@@ -81,8 +81,8 @@ public class AgentNewLogServiceImpl extends ServiceImpl<IAgentNewLogMapper, Agen
     }
 
     @Override
-    public LogDataVo getLogDataM() {
-        List<AgentNewLog> logDataM = this.getBaseMapper().getLogDataM();
+    public LogDataVo getLogDataM(Integer agentId) {
+        List<AgentNewLog> logDataM = this.getBaseMapper().getLogDataM(agentId);
         LogDataVo logDataVo = new LogDataVo();
         for (AgentNewLog log : logDataM) {
             switch (log.getType()){

+ 2 - 2
src/main/resources/mapper/agent/AgentNewLogMapper.xml

@@ -4,7 +4,7 @@
 
     <select id="downLogList" resultType="com.fdkankan.agent.response.DownLogVo" parameterType="com.fdkankan.agent.request.DownParam">
         select u.user_name,al.count,al.create_time from  t_agent_new_log al left join t_user u on al.user_id = u.id
-        where al.type = 2
+        where al.type = 2 and agent_id = #{param.agentId}
         <if test="param.userName!= null and param.userName != ''">
             and u.user_name like  concat('%',#{param.userName},'%')
         </if>
@@ -14,7 +14,7 @@
     </select>
     <select id="getLogDataM" resultType="com.fdkankan.agent.entity.AgentNewLog">
         SELECT *
-        FROM t_agent_new WHERE PERIOD_DIFF( date_format( now( ) , '%Y%m' ) , date_format( create_time, '%Y%m' ) ) =1
+        FROM t_agent_new_log WHERE agent_id =#{agentId} PERIOD_DIFF( date_format( now( ) , '%Y%m' ) , date_format( create_time, '%Y%m' ) ) =1
 
     </select>