DepartmentServiceImpl.java 1.5 KB
Newer Older
afe's avatar
afe committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
package com.cmsz.ws.impl;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.cmsz.dao.DepartmentDaoSupport;
import com.cmsz.vo.DepartmentVO;
import com.cmsz.ws.DepartmentService;
import com.hp.cmsz.entity.Department;
import com.hp.cmsz.repository.DepartmentDao;

public class DepartmentServiceImpl implements DepartmentService {

    private static Logger logger = LoggerFactory.getLogger(DepartmentServiceImpl.class);

    @Autowired
   // private DepartmentDaoSupport departmentDao;
    
	/**
	 * 查询部门列表
	 */
	public List<DepartmentVO> queryDepartment (String departmentId) {
		logger.info("开始查询部门列表信息-----------------");
		DepartmentDaoSupport departmentDao=new DepartmentDaoSupport();
		List<DepartmentVO> resultList = new ArrayList<DepartmentVO>();
		//List<Department> departmentList = new ArrayList<Department>();
		/*if (departmentId.equals("") || departmentId == null) {//为空
			departmentList = (List<Department>) departmentDao.findAll();
		} else {
			departmentList = (List<Department>) departmentDao.findByDepartmentId(Long.valueOf(departmentId));
		}
	
	 */
		resultList=departmentDao.findByDepartmentId(departmentId);
			/*for (int i = 0; i < departmentList.size(); i++) {
			DepartmentVO vo = new DepartmentVO();
			vo.setDepartmentId(String.valueOf(departmentList.get(i).getDepartmentId()));
			resultList.add(vo);
		}*/
		return resultList;
	}
	
}