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.PlcErrorDao;
|
import com.slcf.pojo.PlcErrorBean;
|
import com.slcf.service.PlcErrorService;
|
|
/**
|
* PLC异常码接口实现
|
* @author admin
|
* @date 2018年11月6日
|
*/
|
@Service
|
public class PlcErrorServiceImpl implements PlcErrorService {
|
|
@Autowired
|
PlcErrorDao plcErrorDao;
|
|
/**
|
* 添加
|
*/
|
public int insertPlcError(PlcErrorBean plcError) {
|
int result=0;
|
try {
|
result=plcErrorDao.insertPlcError(plcError);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 统计数量
|
*/
|
public int queryPlcErrorCount(){
|
int result = 0;
|
try {
|
result = plcErrorDao.getPlcErrorCount();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 分页查询所有
|
*/
|
public List<PlcErrorBean> queryPlcErrorList(int spage, int epage) {
|
try {
|
return plcErrorDao.queryPlcErrorList(spage, epage);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
/**
|
* 根据id查找
|
*/
|
public PlcErrorBean queryPlcErrorById(int id) {
|
try {
|
return plcErrorDao.getPlcErrorById(id);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
//更新
|
public int upPlcError(PlcErrorBean plcError) {
|
int result=0;
|
try {
|
result=plcErrorDao.upPlcError(plcError);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 根据部门id删除
|
*/
|
public int delPlcError(int did) {
|
int result=0;
|
try {
|
result=plcErrorDao.delPlcErrorById(did);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 查询所有
|
* @return
|
*/
|
public List<PlcErrorBean> getPlcErrorList() {
|
try {
|
return plcErrorDao.getPlcErrorList();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
}
|