package com.elephant.framework.galaxy.travel.mapper;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
@Slf4j
public class DepartmentMapperTests {
//
//    @Autowired
//    private DepartmentMapper departmentMapper;

//    @Test
//    public void testSelect() {
//        // 查询全部
////        List<Department> departments = deptMapper.selectList(null);
////        departments.forEach(System.out::println);
//        //id 查询要有@TableId标识主键
////        Department department = deptMapper.selectById(1);
////        System.out.println(department);
//        //多条件查询
////        Department department = new Department();
////        department.setDelFlag(Byte.valueOf("1"));
////        department.setName("租户2");
////        Department result = deptMapper.selectOne(new QueryWrapper<>(department));
////        System.out.println(result);
//        Page<Department> page = new Page<>(2, 2);
//        IPage<Department> departmentIPage = departmentMapper.selectPage(page, null);
//        List<Department> records = departmentIPage.getRecords();
//        System.out.println(records);
//    }
//
//    @Test
//    public void testInsert() {
//        Department department = new Department();
//        department.setName("品象软件");
//        department.setSort(1);
//        department.setCreateTime(new Date());
//        department.setDelFlag(Byte.parseByte("0"));
//        department.setParentId(1);
//        department.setTenantId(1);
//        departmentMapper.insert(department);
//    }

}


