AuthLevelManagerImpl.java
1.73 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.diligrp.website.manager.impl;
import com.diligrp.website.dao.AuthLevelDao;
import com.diligrp.website.domain.AuthLevel;
import com.diligrp.website.domain.PickUpPointDomain;
import com.diligrp.website.manager.AuthLevelManager;
import com.diligrp.website.util.dao.BaseQuery;
import com.diligrp.website.util.web.PageTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.sql.Timestamp;
import java.util.List;
@Component("authLevelManager")
public class AuthLevelManagerImpl implements AuthLevelManager {
@Resource
private AuthLevelDao authLevelDao;
@Override
public PageTemplate getAuthLevelList(BaseQuery query) {
Integer totalSize = authLevelDao.getAuthLevelCount(query);
List<AuthLevel> list = authLevelDao.getAuthLevelList(query);
return PageTemplate.create(query, totalSize, list);
}
@Override
public boolean addAuthLevel(AuthLevel authLevel) {
authLevel.setCreated(new Timestamp(System.currentTimeMillis()));
authLevel.setModified(authLevel.getCreated());
authLevel.setYn(1);
authLevel.setState(1);
return authLevelDao.save(authLevel);
}
@Override
public boolean modifyAuthLevel(AuthLevel authLevel) {
authLevel.setModified(new Timestamp(System.currentTimeMillis()));
return authLevelDao.modify(authLevel);
}
@Override
public AuthLevel getAuthLevelById(Long id){
return authLevelDao.getAuthLevelById(id);
}
@Override
public List<AuthLevel> getAllAuthLevel(){
return authLevelDao.getAllAuthLevel();
}
@Override
public AuthLevel checkName(Long id, String levelName) {
return authLevelDao.checkName(id,levelName);
}
}