4858bb18179235e94c4b9a1b0308ffb8e3983f41.svn-base 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.sinosoft.cm.test;
  2. import java.util.List;
  3. import java.util.Map;
  4. import org.junit.Before;
  5. import org.junit.Test;
  6. import com.sinosoft.cm.dept.service.DeptServiceImpl;
  7. import com.sinosoft.cm.ex.SQLStringException;
  8. public class TestDeptServiceImpl {
  9. private DeptServiceImpl dsi=null;
  10. @Before
  11. public void init(){
  12. dsi=new DeptServiceImpl();
  13. }
  14. @Test
  15. public void testFindAll(){
  16. try {
  17. //查询部门
  18. List<Map<String,String>> list=dsi.findAllByNameAndIN("getDept", (List<String>)null,"11");
  19. System.out.println("getDept=="+list);
  20. //查询子部门
  21. list=dsi.findAllByNameAndIN("getChildDept", (List<String>)null, "11");
  22. System.out.println("getChildDept=="+list);
  23. //模糊查询该部门
  24. list=dsi.findAllByNameAndIN("getLikeChildDept", (List<String>)null, "%广东%","/_1_");
  25. System.out.println("getLikeChildDept=="+list);
  26. //查询上级部门
  27. list=dsi.findAllByNameAndIN("getParentDept", "'1','11','52CBA051D490487DA2D1F258EB8F595D'",(String)null);
  28. System.out.println("getParentDept=="+list);
  29. } catch (SQLStringException e) {
  30. // TODO Auto-generated catch block
  31. e.printStackTrace();
  32. }
  33. }
  34. }