DataDictionaryDaoImpl.java
3.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package com.diligrp.website.dao.impl;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Component;
import com.diligrp.website.dao.DataDictionaryDao;
import com.diligrp.website.domain.DataDictionary;
import com.diligrp.website.domain.DataDictionaryValue;
import com.diligrp.website.domain.SysConfig;
import com.diligrp.website.util.dao.BaseQuery;
import com.diligrp.website.util.dao.impl.BaseDaoImpl;
import com.google.common.collect.Maps;
@Component("dataDictionaryDao")
public class DataDictionaryDaoImpl extends BaseDaoImpl<DataDictionary>
implements DataDictionaryDao {
private static final String PREFIX = DataDictionaryDaoImpl.class
.getCanonicalName();
@Override
public DataDictionary getDataDictionaryByCode(String code) {
return getSqlSessionTemplate().selectOne(
PREFIX + ".getDataDictionaryByCode", code);
}
@Override
public List<DataDictionaryValue> getDataDictionaryValue(Long id) {
return getSqlSessionTemplate().selectList(
PREFIX + ".getDataDictionaryValue", id);
}
@Override
public Integer getDataDicListCount(BaseQuery query) {
return getSqlSessionTemplate().selectOne(
PREFIX + ".getDataDicListCount", query);
}
@Override
public List<SysConfig> getDataDicList(BaseQuery query) {
return getSqlSessionTemplate().selectList(PREFIX + ".getDataDicList",
query);
}
@Override
public boolean deleteValue(Long id) {
return getSqlSessionTemplate().delete(PREFIX + ".deleteValue", id) > 0;
}
@Override
public boolean delete(Long id) {
return getSqlSessionTemplate().delete(PREFIX + ".delete", id) > 0;
}
/*
* (non-Javadoc)
* @see com.diligrp.website.util.dao.impl.BaseDaoImpl#save(java.lang.Object)
*/
@Override
public boolean save(DataDictionary value) {
return super.save(value);
}
/*
* (non-Javadoc)
* @see
* com.diligrp.website.util.dao.impl.BaseDaoImpl#update(java.lang.Object)
*/
@Override
public boolean update(DataDictionary value) {
return super.update(value);
}
@Override
public DataDictionary getDataDictionaryById(Long id) {
return super.getById(id);
}
@Override
public boolean saveValue(DataDictionaryValue dicv) {
return getSqlSessionTemplate().insert(PREFIX + ".saveValue", dicv) > 0;
}
@Override
public DataDictionaryValue getDataDicValById(Long id) {
return getSqlSessionTemplate().selectOne(
PREFIX + ".getDataDicValById", id);
}
@Override
public boolean editValue(DataDictionaryValue dicv) {
return getSqlSessionTemplate().update(PREFIX + ".editValue", dicv) > 0;
}
@Override
public DataDictionaryValue getDataDicValByCode(String code, Integer ddId) {
Map<String, Object> param = Maps.newHashMap();
param.put("code", code);
param.put("ddId", ddId);
return getSqlSessionTemplate().selectOne(
PREFIX + ".getDataDicValByCode", param);
}
@Override
public DataDictionaryValue getDataDicValByName(String name, Integer ddId) {
Map<String, Object> param = Maps.newHashMap();
param.put("name", name);
param.put("ddId", ddId);
return getSqlSessionTemplate().selectOne(
PREFIX + ".getDataDicValByName", param);
}
@Override
public DataDictionaryValue getDataDicValBySort(Integer sort, Integer ddId) {
Map<String, Object> param = Maps.newHashMap();
param.put("sort", sort);
param.put("ddId", ddId);
return getSqlSessionTemplate().selectOne(
PREFIX + ".getDataDicValBySort", param);
}
}