CityDaoImpl.java
1.67 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
package com.diligrp.website.dao.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Component;
import com.diligrp.website.dao.CityDao;
import com.diligrp.website.domain.City;
import com.diligrp.website.util.dao.impl.BaseDaoImpl;
@Component("CityDao")
public class CityDaoImpl extends BaseDaoImpl<City> implements CityDao {
private static final String STATEMENT = CityDaoImpl.class.getCanonicalName();
@Override
public List<City> getCityListByParentId(Integer pid) {
return getSqlSessionTemplate().selectList(STATEMENT + ".getCityListByParentId", pid);
}
/*
* (non-Javadoc)
*
* @see
* com.diligrp.website.dao.CityDao#getParentCityListById(java.lang.Integer)
*/
@Override
public List<City> getParentCityListById(Integer pid) {
List<City> list = getSqlSessionTemplate().selectList(STATEMENT + ".getParentCityListByRegionId", pid);
return list;
}
@Override
public List<City> getCityByText(String cityName, int cityLevel) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("cityName", cityName);
param.put("cityLevel", cityLevel);
return getSqlSessionTemplate().selectList(STATEMENT + ".getCityByText", param);
}
@Override
public List<City> getCityListByCityIds(List cityIds) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("cityIds", cityIds);
List<City> list = getSqlSessionTemplate().selectList(STATEMENT + ".getCityListByCityIds", param);
return list;
}
@Override
public List<City> getCityListByCountryId(Long countryId) {
List<City> list = getSqlSessionTemplate().selectList(STATEMENT + ".getCityListByCountryId", countryId);
return list;
}
}