Mybatis 查询 or 语句

   

    public List test() {


        SystemUsersExample example = new SystemUsersExample();


        Criteria ariteria = example.createCriteria();


        Criteria ariteria2 = example.createCriteria();


        ariteria.andIdEqualTo(31);


        ariteria2.andIdEqualTo(33);


        example.or(ariteria);


        return usersMapper.selectByExample(example);

    }


打印结果:

Preparing: select id from system_users WHERE ( id = ? ) or( id = ? ) 

Parameters: 31(Integer), 31(Integer)

你可能感兴趣的:(数据库,mybatis)