prader6

mybatis or的用法

@Test
    public void test3(){
        CaseSmallListExample caseSmallListExample = new CaseSmallListExample();
        caseSmallListExample.or().andDeptNumberEqualTo(1);
        caseSmallListExample.or().andDeptNumberEqualTo(2);
        List<CaseSmallList> smallLists = caseSmallListMapper.selectByExample(caseSmallListExample);
        for (CaseSmallList caseSmallList : smallLists){
            System.out.println(caseSmallList.getDeptNumber());
        }
    }

 上面查询出来的实体类的   DeptNumber  字段是既包含1 又包含2的。

posted on 2019-12-20 11:33  prader6  阅读(3834)  评论(0编辑  收藏  举报

导航