升级sql构建, 支持or语句
This commit is contained in:
41
option_test.go
Normal file
41
option_test.go
Normal file
@ -0,0 +1,41 @@
|
||||
// Package database ...
|
||||
//
|
||||
// Description : database ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2024-08-09 18:19
|
||||
package database
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_optionToSql(t *testing.T) {
|
||||
type args struct {
|
||||
o *Option
|
||||
}
|
||||
o := &Option{
|
||||
In: nil,
|
||||
NotIn: nil,
|
||||
Where: map[string]any{
|
||||
"name": []string{"zhang", "baicha"},
|
||||
"age": 18,
|
||||
},
|
||||
Start: nil,
|
||||
End: nil,
|
||||
Like: map[string]string{
|
||||
"name": "de",
|
||||
},
|
||||
NotLike: map[string]string{
|
||||
"name": "zhang",
|
||||
},
|
||||
NotEqual: map[string]any{
|
||||
"a": 123,
|
||||
},
|
||||
Order: nil,
|
||||
OR: nil,
|
||||
}
|
||||
fmt.Println(optionToSql(o))
|
||||
}
|
Reference in New Issue
Block a user