SysConfigDaoImpl.java
1.55 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
package com.diligrp.website.dao.impl;
import java.util.List;
import org.springframework.stereotype.Component;
import com.diligrp.website.dao.SysConfigDao;
import com.diligrp.website.domain.SysConfig;
import com.diligrp.website.util.dao.BaseQuery;
import com.diligrp.website.util.dao.impl.BaseDaoImpl;
@Component("sysConfigDao")
public class SysConfigDaoImpl extends BaseDaoImpl<SysConfig> implements
SysConfigDao {
private static final String PREFIX = SysConfigDaoImpl.class
.getCanonicalName();
@Override
public SysConfig getSysConfigByCode(String code) {
return getSqlSessionTemplate().selectOne(
PREFIX + ".getSysConfigByCode", code);
}
@Override
public Integer getSysConfigListCount(BaseQuery query) {
return getSqlSessionTemplate().selectOne(
PREFIX + ".getSysConfigListCount", query);
}
@Override
public List<SysConfig> getSysConfigList(BaseQuery query) {
return getSqlSessionTemplate().selectList(PREFIX + ".getSysConfigList",
query);
}
@Override
public boolean saveSysConfig(SysConfig cfg) {
return getSqlSessionTemplate().insert(PREFIX + ".saveSysConfig", cfg) > 0;
}
@Override
public SysConfig getSysConfigById(Integer id) {
return getSqlSessionTemplate().selectOne(PREFIX + ".getSysConfigById",
id);
}
@Override
public boolean editSysConfig(SysConfig newCfg) {
return getSqlSessionTemplate()
.update(PREFIX + ".editSysConfig", newCfg) > 0;
}
}