12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package com.sinosoft.cm.test;
- import java.util.List;
- import java.util.Map;
- import org.junit.Before;
- import org.junit.Test;
- import com.sinosoft.cm.dept.service.DeptServiceImpl;
- import com.sinosoft.cm.ex.SQLStringException;
- public class TestDeptServiceImpl {
-
- private DeptServiceImpl dsi=null;
- @Before
- public void init(){
- dsi=new DeptServiceImpl();
- }
-
- @Test
- public void testFindAll(){
- try {
- //查询部门
- List<Map<String,String>> list=dsi.findAllByNameAndIN("getDept", (List<String>)null,"11");
- System.out.println("getDept=="+list);
- //查询子部门
- list=dsi.findAllByNameAndIN("getChildDept", (List<String>)null, "11");
- System.out.println("getChildDept=="+list);
-
- //模糊查询该部门
- list=dsi.findAllByNameAndIN("getLikeChildDept", (List<String>)null, "%广东%","/_1_");
- System.out.println("getLikeChildDept=="+list);
-
- //查询上级部门
- list=dsi.findAllByNameAndIN("getParentDept", "'1','11','52CBA051D490487DA2D1F258EB8F595D'",(String)null);
- System.out.println("getParentDept=="+list);
-
- } catch (SQLStringException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
|