mybatis-plus条件构造器如何写出这条SQL语句
课程设计
1
select * from table where
(a = 1 or a = 2)
and
(b = 1 or b = 2)
如何使用mybatis-plus条件构造器写出这条SQL语句。
-
public static void main(String[] args) throws InterruptedException { Thread thread = new Thread(() -> { for (int i = 0; i < 5; i++) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } System.out.println("//1//"); }); Thread.State state = thread.getState(); System.out.println(state); thread.start();//启动线程 state = thread.getState(); System.out.println(state); while (state != Thread.State.TERMINATED) { Thread.sleep(100); state = thread.getState(); System.out.println(state); } }
-
userMapper.selectList(new QueryWrapper() . nested(i -> i.eq("role_id", 1).or().eq("role_id", 2)) .and(i -> i.eq("b", 1).or().eq("b", 2))
发表回复