-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add the city service and it's implemention
- Loading branch information
Showing
2 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
src/main/java/com/zmsport/iyuesai/service/CityService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.zmsport.iyuesai.service; | ||
|
||
import com.zmsport.iyuesai.mapper.Admin; | ||
import com.zmsport.iyuesai.mapper.City; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* 城市管理相关服务 | ||
* @author bilei | ||
* | ||
*/ | ||
public interface CityService { | ||
/** | ||
* 查询城市 | ||
* @param cityName | ||
* @return | ||
*/ | ||
public City findCityByName(String cityName); | ||
|
||
/** | ||
* 分页获取城市列表 | ||
* @param page | ||
* @param pageSize | ||
* @return | ||
*/ | ||
public List<City> getCitys(int page, int pageSize); | ||
|
||
/** | ||
* 获取城市总数 | ||
* @return | ||
*/ | ||
public int getTotalNum(); | ||
|
||
/** | ||
* 插入 | ||
* @param city | ||
*/ | ||
public void insert(City city); | ||
|
||
/** | ||
* 修改 | ||
* @param city | ||
*/ | ||
public void update(City city); | ||
|
||
/** | ||
* 查找城市 | ||
* @param id | ||
* @return | ||
*/ | ||
public City findCityById(long id); | ||
|
||
/** | ||
* 删除城市 | ||
* @param ids | ||
*/ | ||
public void delete(String ids); | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/com/zmsport/iyuesai/service/CityServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.zmsport.iyuesai.service; | ||
|
||
import com.zmsport.iyuesai.mapper.Admin; | ||
import com.zmsport.iyuesai.mapper.City; | ||
import com.zmsport.iyuesai.mapper.CityMapper; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by ken.kang on 2016/2/19. | ||
*/ | ||
public class CityServiceImpl implements CityService { | ||
|
||
@Autowired | ||
private CityMapper mapper; | ||
|
||
public City findCityByName(String cityName) { | ||
return mapper.findCityByName(cityName) ; | ||
} | ||
|
||
public List<City> getCitys(int page, int pageSize) { | ||
return mapper.getCitys(page, pageSize); | ||
} | ||
|
||
public int getTotalNum() { | ||
return mapper.getTotalNum(); | ||
} | ||
|
||
public void insert(City city) { | ||
mapper.insert(city); | ||
} | ||
|
||
public void update(City city) { | ||
mapper.update(city); | ||
} | ||
|
||
public City findCityById(long id) { | ||
return mapper.findCityById(id); | ||
} | ||
|
||
|
||
public void delete(String ids) { | ||
mapper.delete(Arrays.asList(ids.split(","))); | ||
} | ||
} |