-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmpService.java
More file actions
46 lines (32 loc) · 911 Bytes
/
EmpService.java
File metadata and controls
46 lines (32 loc) · 911 Bytes
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
package com.spring.service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.spring.dao.DeptDao;
import com.spring.dao.EmpDao;
import com.spring.dto.Dept;
import com.spring.dto.Emp;
@Service
public class EmpService {
@Autowired
EmpDao emp;
@Autowired
DeptDao dep;
public List<Emp> searchEmp(String ename, String job){
Map<String, String> map = new HashMap<>();
map.put("ename", ename);
map.put("job", job);
return emp.searchEmp(job, ename);
}
public List<Dept> showOption(){
return dep.deptAll(); // 부서 정보를 전부 가져옴
}
public List<Emp> showEmp(int deptno){
return emp.showEmp(deptno);
}
public Emp selectEmp(String ename){
return emp.selectEmp(ename);
}
}