Browse Source

修改bug

yjp 11 months ago
parent
commit
bbf2369bf0
1 changed files with 11 additions and 0 deletions
  1. 11 0
      sql/sql_tpl/value.go

+ 11 - 0
sql/sql_tpl/value.go

@@ -6,6 +6,7 @@ import (
 	"git.sxidc.com/go-tools/utils/strutils"
 	"reflect"
 	"strconv"
+	"strings"
 	"time"
 )
 
@@ -126,6 +127,16 @@ func parseValue(value any, opts ...AfterParsedStrValueOption) (string, error) {
 		if opts == nil || len(opts) == 0 {
 			return parsedValue, nil
 		}
+	case []string:
+		if v == nil || len(v) == 0 {
+			parsedValue = ""
+		} else {
+			parsedValue = strings.Join(v, ",")
+		}
+
+		if opts == nil || len(opts) == 0 {
+			return "'" + parsedValue + "'", nil
+		}
 	default:
 		return "", errors.New("不支持的类型")
 	}