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的。