lyh
3 天以前 3ce27b7faf8850d101a1511a685250fe562dca18
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.lxzn.ucenter.dao;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lxzn.framework.domain.ucenter.Menu;
import com.lxzn.framework.domain.ucenter.ext.MenuExt;
import com.lxzn.ucenter.dao.MenuMapper;
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 java.util.List;
 
@RunWith(SpringRunner.class)
@SpringBootTest
public class MenuMapperTest {
    @Autowired
    private MenuMapper menuMapper;
 
 
    @Test
    public void testFindByUserId() {
        QueryWrapper<Menu> ew = new QueryWrapper<>();
        ew.eq("u.user_id", "1250343734206377985l");
        List<Menu> list = menuMapper.findByUserId(ew);
        list.forEach(System.out::println);
    }
 
    @Test
    public void testFindByParentId() {
        List<MenuExt> list = menuMapper.findByParentId("123l");
        list.forEach(System.out::println);
    }
 
    @Test
    public void testFindExtAll() {
        List<MenuExt> list = menuMapper.findExtAll();
        list.forEach(System.out::println);
    }
 
    @Test
    public void testFindExtAllBySingleSelect() {
        List<MenuExt> list = menuMapper.findExtAllBySingleSelect();
        list.forEach(System.out::println);
    }
}