刚刚通过user 查出对应group_user表的group_id 下面继续查对应group表的name名称: 同时用了sql的N+1查询,不推荐,要进行优化:
[sy.dao.UserMapper.getAll]==> Preparing: select id, name, loginname, pwd, email, mobile, createtime from user [sy.dao.UserMapper.getAll]==> Parameters: [sy.dao.UserMapper.selectGroupUser]====> Preparing: SELECT group_user.id, group_user.userid, group_user.groupid FROM group_user where group_user.userid=? [sy.dao.UserMapper.selectGroupUser]====> Parameters: 1(Integer) [sy.dao.UserMapper.selectGroupUser]<==== Total: 1 [sy.dao.UserMapper.selectGroupUser]====> Preparing: SELECT group_user.id, group_user.userid, group_user.groupid FROM group_user where group_user.userid=? [sy.dao.UserMapper.selectGroupUser]====> Parameters: 3(Integer) [sy.dao.UserMapper.selectGroupUser]<==== Total: 1
|