gorm的criteria查询

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

class User{
    String name
    Account account   
}

class Account{
    Double balance
}

查询::
User.withCriteria{
   account{
     gt('balance',1000000)
   }
}

User.createCriteria().count{
   account{
     between('balance',10,10000)
   }
}

User.createCriteria().list{
     like('name','%东%')
     account{
     between('balance',10,10000)
   }
}