github.com/jtzjtz/kit@v1.0.2/database/sqlcondition.go (about) 1 package database 2 3 type SqlPredicate string 4 5 var ( 6 SqlEqualPredicate = SqlPredicate("= ?") 7 SqlNotEqualPredicate = SqlPredicate("<> ?") 8 SqlGreaterThanPredicate = SqlPredicate("> ?") 9 SqlGreaterThanOrEqualPredicate = SqlPredicate(">= ?") 10 SqlSmallerThanPredicate = SqlPredicate("< ?") 11 SqlSmallerThanOrEqualPredicate = SqlPredicate("<= ?") 12 SqlIn = SqlPredicate("IN (?)") 13 SqlNotIn = SqlPredicate("Not IN (?)") 14 SqlBetweenAnd = SqlPredicate("BETWEEN ? AND ?") 15 SqlLikeAll = SqlPredicate("LIKE ?") 16 SqlLikeLeft = SqlPredicate("LIKE ?") 17 SqlLikeRight = SqlPredicate("LIKE ?") 18 ) 19 20 /* 21 数据库查询匹配 22 */ 23 type SqlCondition struct { 24 QueryName string 25 Predicate SqlPredicate 26 Value interface{} 27 } 28 29 //查询条件 30 type SqlOptions struct { 31 SelectField string 32 OrderBy map[string]string 33 }