package com.slcf.service.impl;
|
|
import java.util.List;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import com.slcf.dao.StationDao;
|
import com.slcf.pojo.StationBean;
|
import com.slcf.service.StationService;
|
|
/**
|
* 输送设备站点接口实现
|
* @author admin
|
* @date 2018年11月6日
|
*/
|
@Service
|
public class StationServiceImpl implements StationService {
|
|
@Autowired
|
StationDao stationDao;
|
|
/**
|
* 添加
|
*/
|
public int insertStation(StationBean station) {
|
int result=0;
|
try {
|
result=stationDao.insertStation(station);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 统计数量
|
*/
|
public int queryStationCount(){
|
int result = 0;
|
try {
|
result = stationDao.getStationCount();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 分页查询所有
|
*/
|
public List<StationBean> queryStationList(int spage, int epage) {
|
try {
|
return stationDao.queryStationList(spage, epage);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
/**
|
* 根据id查找
|
*/
|
public StationBean queryStationById(int id) {
|
try {
|
return stationDao.getStationById(id);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
//更新
|
public int upStation(StationBean station) {
|
int result=0;
|
try {
|
result=stationDao.upStation(station);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 根据部门id删除
|
*/
|
public int delStation(int did) {
|
int result=0;
|
try {
|
result=stationDao.delStationById(did);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 查询所有
|
* @return
|
*/
|
public List<StationBean> getStationList() {
|
try {
|
return stationDao.getStationList();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
/**
|
* 删除所有站点
|
*/
|
public int resetStation() {
|
int result=0;
|
try {
|
result=stationDao.resetStation();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
}
|