You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
package com.esms.dao;
|
|
|
|
import com.esms.dao.DepartmentMapper;
|
|
import com.esms.po.Department;
|
|
import com.esms.po.Salary;
|
|
import com.esms.vo.EchSalary;
|
|
import org.junit.Test;
|
|
import org.junit.runner.RunWith;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.test.context.ContextConfiguration;
|
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
|
|
import java.util.List;
|
|
|
|
@RunWith(SpringJUnit4ClassRunner.class)
|
|
@ContextConfiguration(locations = "classpath:applicationContext.xml")
|
|
public class EchartTest {
|
|
@Autowired
|
|
private DepartmentMapper departmentMapper;
|
|
@Autowired
|
|
private EmployeeMapper employeeMapper;
|
|
@Autowired
|
|
private SalaryMapper salaryMapper;
|
|
@Test
|
|
public void selectAll(){
|
|
List<Department> departmentList = departmentMapper.selectAll();
|
|
for (Department department:departmentList){
|
|
System.out.println(department);
|
|
}
|
|
}
|
|
@Test
|
|
public void countById(){
|
|
System.out.println(employeeMapper.countByDid(1)+"--------------");
|
|
}
|
|
@Test
|
|
public void selectSalaryByDepartment(){
|
|
EchSalary echSalary = salaryMapper.selectSalaryByDepartment(1,"2018-07");
|
|
System.out.println(echSalary);
|
|
System.out.println();
|
|
}
|
|
@Test
|
|
public void selectAllSalaryByDate(){
|
|
Double ymSalary = salaryMapper.selectAllSalaryByDate("2018-07");
|
|
System.out.println(ymSalary+"--------------------");
|
|
}
|
|
}
|