backend/app/brahma/api/murder/internal/util/sql.go

20 lines
384 B
Go
Raw Permalink Normal View History

2022-01-12 14:34:31 +08:00
package util
import "strings"
type QueryMap map[string]string
// GetQueryMap 根据查询条件进行sql处理
func GetQueryMap(s string) QueryMap {
m := make(map[string]string)
if s != "" {
s = string([]byte(s)[1 : len([]byte(s))-1])
for _, v := range strings.Split(s, ",") {
split := strings.Split(v, "=")
m[split[0]] = split[1]
}
}
m["is_del"] = "0"
return m
}