Administrator
2024-01-26 08e9685fa3f343f91c714489c9036bf5a9f8e49e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.dy.pipIrrDemo.auth;
 
 
import com.dy.pipIrrGlobal.daoDemo.DemoAuthMapper;
import com.dy.pipIrrGlobal.pojoDemo.DemoAddress;
import com.dy.pipIrrGlobal.pojoDemo.DemoAuth;
import com.dy.pipIrrGlobal.pojoDemo.DemoRole;
import com.dy.pipIrrGlobal.pojoDemo.DemoUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.Date;
import java.util.List;
 
@Service
public class AuthSv {
    @Autowired
    private DemoAuthMapper demoAuthMapper ;
 
    public List<DemoAuth> selectAll() {
        List<DemoAuth> list = this.demoAuthMapper.selectAll() ;
        for(DemoAuth po : list){
            po.date = new Date() ;
            List<DemoRole> roleList = po.getRoleList() ;
            if(roleList != null){
                for(DemoRole rpo : roleList){
                    List<DemoUser> userList = rpo.getUserList() ;
                    if(userList != null){
                        for(DemoUser upo : userList){
                            DemoAddress dPo = upo.getAddress() ;
                            if(dPo != null){
                                System.out.println(dPo.name);
                            }
                        }
                    }
                }
            }
        }
        return list ;
    }
}