首页>代码>基于SSM框架开发的CRM系统>/CRMProject/src/main/java/com/iarchie/crm_v1/App.java
package com.iarchie.crm_v1;


import com.iarchie.crm_v1.domain.Department;
import com.iarchie.crm_v1.domain.Employee;
import com.iarchie.crm_v1.domain.Position;
import com.iarchie.crm_v1.domain.User;
import com.iarchie.crm_v1.service.IDepartmentService;
import com.iarchie.crm_v1.service.IEmployeeService;
import com.iarchie.crm_v1.service.IPositionService;
import com.iarchie.crm_v1.service.IUserService;
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(value = "classpath:applicationContext.xml")
public class App {


    @Autowired
    private IUserService service;

    @Autowired
    private IEmployeeService employeeService;

    @Autowired
    private IPositionService positionService;
    @Autowired
    private IDepartmentService departmentService;

    @Test
    public void test() {
      List<User> users = service.selectAll("d",null);
        for (User user : users) {
            System.out.println("user = " + user);
        }
    }


    @Test
    public void testPage() {

        List<User> users = service.selectPageResult(1, 5);
        for (User user : users) {
            System.out.println("user = " + user);
        }
    }

    @Test
    public void testEmpList() {

        List<Employee> employees = employeeService.selectAll();
        for (Employee employee : employees) {
            System.out.println("employee = " + employee.getDeptId().getDeptname());
        }
    }

    @Test
    public void testPositionList() {
        List<Position> positions = positionService.selectAll("DBA");

        for (Position position : positions) {
            System.out.println("position = " + position);
        }
    }

    @Test
    public void deptList(){

        List<Department> list = departmentService.selectAll("技术");
        for (Department department : list) {
            System.out.println("department = " + department);
        }
    }


}
最近下载更多
heqian  LV17 2024年5月26日
李俊雄  LV3 2024年5月6日
shenghaer  LV1 2024年3月14日
zhaozhiqi  LV5 2023年10月2日
李亮  LV19 2023年8月28日
493240689  LV3 2022年11月25日
admin115  LV6 2022年11月22日
qiuqiu1  LV4 2022年11月18日
刘鹏yyds  LV10 2022年11月16日
xudong_y  LV4 2022年10月27日
最近浏览更多
Lyricify 2024年12月22日
暂无贡献等级
lxzlxzl  LV1 2024年6月21日
wangbh1234  LV1 2024年6月6日
heqian  LV17 2024年5月26日
sunlea  LV20 2024年5月22日
李俊雄  LV3 2024年4月30日
FFF112233  LV8 2024年3月27日
阿凡达  LV9 2024年1月29日
shenghaer  LV1 2024年1月26日
WBelong  LV8 2023年12月27日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友