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.WorkNoDao;
|
import com.slcf.pojo.WorkNoBean;
|
import com.slcf.service.WorkNoService;
|
|
/**
|
* 工作号接口实现
|
* @author admin
|
* @date 2018年11月7日
|
*/
|
@Service
|
public class WorkNoServiceImpl implements WorkNoService {
|
|
@Autowired
|
WorkNoDao workNoDao;
|
|
/**
|
* 添加
|
*/
|
public int insertWorkNo(WorkNoBean workNo) {
|
int result=0;
|
try {
|
result=workNoDao.insertWorkNo(workNo);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 统计数量
|
*/
|
public int queryWorkNoCount(){
|
int result = 0;
|
try {
|
result = workNoDao.getWorkNoCount();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 分页查询所有
|
*/
|
public List<WorkNoBean> queryWorkNoList(int spage, int epage) {
|
try {
|
return workNoDao.queryWorkNoList(spage, epage);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
/**
|
* 根据id查找
|
*/
|
public WorkNoBean queryWorkNoById(int id) {
|
try {
|
return workNoDao.getWorkNoById(id);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
//更新
|
public int upWorkNo(WorkNoBean workNo) {
|
int result=0;
|
try {
|
result=workNoDao.upWorkNo(workNo);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 根据部门id删除
|
*/
|
public int delWorkNo(int did) {
|
int result=0;
|
try {
|
result=workNoDao.delWorkNoById(did);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 查询所有
|
* @return
|
*/
|
public List<WorkNoBean> getWorkNoList() {
|
try {
|
return workNoDao.getWorkNoList();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
}
|