首页>代码>基于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);
        }
    }


}
最近下载更多
shenghaer  LV1 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日
罗清晨  LV11 2022年9月28日
qwer123546  LV13 2022年9月20日
最近浏览更多
FFF112233  LV8 3月27日
阿凡达  LV9 1月29日
shenghaer  LV1 1月26日
WBelong  LV7 2023年12月27日
pangzhihui  LV12 2023年12月11日
limenghaoqwer  LV2 2023年11月27日
xiaomii  LV3 2023年11月13日
wwewww  LV4 2023年11月2日
13188866605  LV12 2023年10月21日
zhaozhiqi  LV5 2023年10月2日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友