We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
伪代码如下:
// 变量 user 为入参 query, u := gplus.NewQuery[User]() query.Eq(&u.Password, "12345678").Or(func(q *gplus.QueryCond[User]) { q.EqCond(user.Id > 0,&u.Id, user.Id). Or().EqCond(len(user.Account) > 0, &u.Account, user.Account). Or().EqCond(len(user.Email) > 0, &u.Email, user.Email). Or().EqCond(len(user.Phone) > 0, &u.Phone, user.Phone) }).OrderByAsc(&u.Id)
当条件为false时,EqCond的条件不会加入到sql中,但是因为前面用了一个Or()作为条件关系,会出现这种情况:
SELECT * FROM `user` WHERE password = '12345678' OR ( id = 0 OR account = 'admin' OR ) ORDER BY id ASC LIMIT 1
应该所有的*Cond条件函数,在使用Or()或者And()之后都会出现这种情况,需要做特殊的适配,AndCond()和OrCond()没办法用在这种条件分组的情况
The text was updated successfully, but these errors were encountered:
feat: Add AndCond/OrCond extensions condition method support. #72 fea…
0d39664
…t: Add streaming paginate support. #71 (#73)
No branches or pull requests
伪代码如下:
当条件为false时,EqCond的条件不会加入到sql中,但是因为前面用了一个Or()作为条件关系,会出现这种情况:
应该所有的*Cond条件函数,在使用Or()或者And()之后都会出现这种情况,需要做特殊的适配,AndCond()和OrCond()没办法用在这种条件分组的情况
The text was updated successfully, but these errors were encountered: