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.CrnDao;
|
import com.slcf.pojo.CrnBean;
|
import com.slcf.service.CrnService;
|
|
/**
|
* 堆垛机接口实现
|
* @author admin
|
* @date 2018年11月6日
|
*/
|
@Service
|
public class CrnServiceImpl implements CrnService {
|
|
@Autowired
|
CrnDao crnDao;
|
|
/**
|
* 添加
|
*/
|
public int insertCrn(CrnBean crn) {
|
int result=0;
|
try {
|
result=crnDao.insertCrn(crn);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 统计数量
|
*/
|
public int queryCrnCount(){
|
int result = 0;
|
try {
|
result = crnDao.getCrnCount();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 分页查询所有
|
*/
|
public List<CrnBean> queryCrnList(int spage, int epage) {
|
try {
|
return crnDao.queryCrnList(spage, epage);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
/**
|
* 根据id查找
|
*/
|
public CrnBean queryCrnById(int id) {
|
try {
|
return crnDao.getCrnById(id);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
//更新
|
public int upCrn(CrnBean crn) {
|
int result=0;
|
try {
|
result=crnDao.upCrn(crn);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 根据部门id删除
|
*/
|
public int delCrn(int did) {
|
int result=0;
|
try {
|
result=crnDao.delCrnById(did);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 查询所有
|
* @return
|
*/
|
public List<CrnBean> getCrnList() {
|
try {
|
return crnDao.getCrnList();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
}
|