美文网首页
Mybatis-plus QueryWrapper使用

Mybatis-plus QueryWrapper使用

作者: knock | 来源:发表于2020-09-07 18:20 被阅读0次
       QueryWrapper<UserEntity> userWrapper = new QueryWrapper<>();
            userWrapper.and(wrapper->wrapper.eq("username", "test2").or().eq("username", "test2"))
                    .or(wrapper -> wrapper.like("username", "test2").or().like("username", "test2"));
    
    # SELECT id,username,pwd,date_u,time_u,u_num,img FROM student WHERE ( username = ? OR username = ? ) OR ( username LIKE ? OR username LIKE ? )
    
      QueryWrapper<UserEntity> userWrapper = new QueryWrapper<>();
            userWrapper.and(wrapper->wrapper.eq("username", "test2").or().eq("username", "test2"))
                    .and(wrapper -> wrapper.like("username", "test2").or().like("username", "test2"));
    #SELECT id,username,pwd,date_u,time_u,u_num,img FROM student WHERE ( username = ? OR username = ? ) AND ( username LIKE ? OR username LIKE ? )
    
     QueryWrapper userWrapper = new QueryWrapper<>();
            userWrapper.apply("select stamp_u,username,name,age from student,rel_student where student.id=rel_student.id");
    
    #select stamp_u,username,name,age from student,rel_student where student.id=rel_student.id 
    
    
         QueryWrapper<UserEntity> userWrapper = new QueryWrapper<>();
            userWrapper.eq("username", "test").eq("username", "test");
    
    #select * from student WHERE username = ?  and  username = ? 
    

    相关文章

      网友评论

          本文标题:Mybatis-plus QueryWrapper使用

          本文链接:https://www.haomeiwen.com/subject/phulektx.html