1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 09:00:55 +00:00

Merge pull request #4114 from wangle201210/develop-2.0

Add the operator(>,>=,<,<=,=,!=) of orm
This commit is contained in:
Ming Deng 2020-07-30 16:51:02 +08:00 committed by GitHub
commit 71776e4bef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 0 deletions

View File

@ -49,6 +49,12 @@ var (
"eq": true, "eq": true,
"nq": true, "nq": true,
"ne": true, "ne": true,
">": true,
">=": true,
"<": true,
"<=": true,
"=": true,
"!=": true,
"startswith": true, "startswith": true,
"endswith": true, "endswith": true,
"istartswith": true, "istartswith": true,

View File

@ -29,11 +29,17 @@ var mysqlOperators = map[string]string{
// "regex": "REGEXP BINARY ?", // "regex": "REGEXP BINARY ?",
// "iregex": "REGEXP ?", // "iregex": "REGEXP ?",
"gt": "> ?", "gt": "> ?",
">": "> ?",
"gte": ">= ?", "gte": ">= ?",
">=": ">= ?",
"lt": "< ?", "lt": "< ?",
"<": "< ?",
"lte": "<= ?", "lte": "<= ?",
"<=": "<= ?",
"eq": "= ?", "eq": "= ?",
"=": "= ?",
"ne": "!= ?", "ne": "!= ?",
"!=": "!= ?",
"startswith": "LIKE BINARY ?", "startswith": "LIKE BINARY ?",
"endswith": "LIKE BINARY ?", "endswith": "LIKE BINARY ?",
"istartswith": "LIKE ?", "istartswith": "LIKE ?",

View File

@ -22,10 +22,15 @@ import (
// oracle operators. // oracle operators.
var oracleOperators = map[string]string{ var oracleOperators = map[string]string{
"exact": "= ?", "exact": "= ?",
"=": "= ?",
"gt": "> ?", "gt": "> ?",
">": "> ?",
"gte": ">= ?", "gte": ">= ?",
">=": ">= ?",
"lt": "< ?", "lt": "< ?",
"<": "< ?",
"lte": "<= ?", "lte": "<= ?",
"<=": "<= ?",
"//iendswith": "LIKE ?", "//iendswith": "LIKE ?",
} }

View File

@ -26,11 +26,17 @@ var postgresOperators = map[string]string{
"contains": "LIKE ?", "contains": "LIKE ?",
"icontains": "LIKE UPPER(?)", "icontains": "LIKE UPPER(?)",
"gt": "> ?", "gt": "> ?",
">": "> ?",
"gte": ">= ?", "gte": ">= ?",
">=": ">= ?",
"lt": "< ?", "lt": "< ?",
"<": "< ?",
"lte": "<= ?", "lte": "<= ?",
"<=": "<= ?",
"eq": "= ?", "eq": "= ?",
"=": "= ?",
"ne": "!= ?", "ne": "!= ?",
"!=": "!= ?",
"startswith": "LIKE ?", "startswith": "LIKE ?",
"endswith": "LIKE ?", "endswith": "LIKE ?",
"istartswith": "LIKE UPPER(?)", "istartswith": "LIKE UPPER(?)",

View File

@ -28,11 +28,17 @@ var sqliteOperators = map[string]string{
"contains": "LIKE ? ESCAPE '\\'", "contains": "LIKE ? ESCAPE '\\'",
"icontains": "LIKE ? ESCAPE '\\'", "icontains": "LIKE ? ESCAPE '\\'",
"gt": "> ?", "gt": "> ?",
">": "> ?",
"gte": ">= ?", "gte": ">= ?",
">=": ">= ?",
"lt": "< ?", "lt": "< ?",
"<": "< ?",
"lte": "<= ?", "lte": "<= ?",
"<=": "<= ?",
"eq": "= ?", "eq": "= ?",
"=": "= ?",
"ne": "!= ?", "ne": "!= ?",
"!=": "!= ?",
"startswith": "LIKE ? ESCAPE '\\'", "startswith": "LIKE ? ESCAPE '\\'",
"endswith": "LIKE ? ESCAPE '\\'", "endswith": "LIKE ? ESCAPE '\\'",
"istartswith": "LIKE ? ESCAPE '\\'", "istartswith": "LIKE ? ESCAPE '\\'",