whycxzp
2021-04-15 e4e8380597b5abdd2ede656cf5291c5d760b1149
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
package com.whyc.service;
 
import com.whyc.mapper.RoleMapper;
import com.whyc.pojo.Role;
import com.whyc.pojo.UserRole;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.List;
 
@Service
public class RoleService {
 
    @Resource
    private RoleMapper mapper;
 
    public List<Role> getAll() {
        return mapper.selectList(null);
    }
 
    public boolean add(Role role) {
        return mapper.insert(role)>0;
    }
 
    public boolean addBatch(List<Role> roles) {
        return mapper.insertBatchSomeColumn(roles)==roles.size();
    }
 
}