parent
9571b7c766
commit
6e8e98e27a
4 changed files with 527 additions and 259 deletions
@ -0,0 +1,157 @@ |
|||||||
|
package com.yipin.liuwanr; |
||||||
|
|
||||||
|
import com.yipin.liuwanr.entity.ExperimentalClass; |
||||||
|
import com.yipin.liuwanr.entity.Student; |
||||||
|
import com.yipin.liuwanr.service.ExperimentalClassService; |
||||||
|
import org.junit.Test; |
||||||
|
import org.junit.runner.RunWith; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.boot.test.context.SpringBootTest; |
||||||
|
import org.springframework.test.context.junit4.SpringRunner; |
||||||
|
import org.springframework.transaction.annotation.Transactional; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@RunWith(SpringRunner.class) |
||||||
|
@SpringBootTest |
||||||
|
public class ExperimentalClassServiceTest { |
||||||
|
@Autowired |
||||||
|
private ExperimentalClassService experimentalClassService; |
||||||
|
|
||||||
|
//添加客户
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void experimentClassAddStudent() { |
||||||
|
List<Student> studentList = new ArrayList<>(); |
||||||
|
Student stu = new Student(); |
||||||
|
stu.setStudentId(1); |
||||||
|
stu.setExperimentalClassId("123"); |
||||||
|
studentList.add(stu); |
||||||
|
HashMap<String, Object> map = experimentalClassService.experimentClassAddStudent(studentList); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//实验班级删除学生
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void experimentClassDeleteStudent() { |
||||||
|
List<Student> studentList = new ArrayList<>(); |
||||||
|
Student stu = new Student(); |
||||||
|
stu.setStudentId(1); |
||||||
|
stu.setExperimentalClassId("123"); |
||||||
|
studentList.add(stu); |
||||||
|
HashMap<String, Object> map = experimentalClassService.experimentClassDeleteStudent(studentList); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//创建实验班级
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void addExperimentalClass() { |
||||||
|
ExperimentalClass experimentalClass = new ExperimentalClass(); |
||||||
|
experimentalClass.setExperimentalClassName("测试"); |
||||||
|
experimentalClass.setClassSize(12); |
||||||
|
experimentalClass.setFounder("测试"); |
||||||
|
experimentalClass.setCourseId(2); |
||||||
|
experimentalClass.setUserId(2); |
||||||
|
experimentalClass.setSchoolId(2); |
||||||
|
HashMap<String, Object> map = experimentalClassService.addExperimentalClass(experimentalClass); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
public void queryExperimentalClass() { |
||||||
|
Integer schoolId = 1; |
||||||
|
Integer courseId = 2; |
||||||
|
HashMap<String, Object> map = experimentalClassService.queryExperimentalClass(schoolId, courseId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//查询实验班级专业
|
||||||
|
@Test |
||||||
|
public void queryExperimentalClassSP() { |
||||||
|
Integer experimentalClassId = 1; |
||||||
|
HashMap<String, Object> map = experimentalClassService.queryExperimentalClassSP(experimentalClassId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//查询学生行政班级
|
||||||
|
@Test |
||||||
|
public void queryStudentClass() { |
||||||
|
Integer experimentalClassId = 1; |
||||||
|
HashMap<String, Object> map = experimentalClassService.queryStudentClass(experimentalClassId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 班级详情 |
||||||
|
*/ |
||||||
|
@Test |
||||||
|
public void queryExperimentalClassDetails() { |
||||||
|
Student student = new Student(); |
||||||
|
Integer courseId = 1; |
||||||
|
HashMap<String, Object> map = experimentalClassService.queryExperimentalClassDetails(student, courseId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//新增学生显示数据
|
||||||
|
@Test |
||||||
|
public void queryexperimentalClass() { |
||||||
|
Integer experimentalClassId = 1; |
||||||
|
HashMap<String, Object> map = experimentalClassService.queryexperimentalClass(experimentalClassId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//专业下拉框
|
||||||
|
@Test |
||||||
|
public void getProfessionals() { |
||||||
|
Integer experimentalClassId = 1; |
||||||
|
HashMap<String, Object> map = experimentalClassService.getProfessionals(experimentalClassId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//班级下拉框
|
||||||
|
@Test |
||||||
|
public void getStudentClass() { |
||||||
|
Integer experimentalClassId = 1; |
||||||
|
HashMap<String, Object> map = experimentalClassService.getStudentClass(experimentalClassId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void deleteExperimentalClass() { |
||||||
|
Integer experimentalClassId = 1; |
||||||
|
HashMap<String, Object> map = experimentalClassService.deleteExperimentalClass(experimentalClassId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void updateExperimentalClass() { |
||||||
|
ExperimentalClass experimentalClass = new ExperimentalClass(); |
||||||
|
HashMap<String, Object> map = experimentalClassService.updateExperimentalClass(experimentalClass); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//修改实验班级名称
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void updateExperimentClassName() { |
||||||
|
ExperimentalClass experimentalClass = new ExperimentalClass(); |
||||||
|
HashMap<String, Object> map = experimentalClassService.updateExperimentalClass(experimentalClass); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//——————————————————————————————全承珠
|
||||||
|
@Test |
||||||
|
public void queryGetByExperimentalClassName() { |
||||||
|
String experimentalClassName = ""; |
||||||
|
HashMap<String, Object> map = experimentalClassService.queryGetByExperimentalClassName(experimentalClassName); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue