lj-wsdj 2024-05-15 15:05:28 +08:00
parent 80b80e01eb
commit 3c24765cac
1 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,10 @@ import (
"strings"
)
func (s *SqlBuilder[T]) SetSql(sql string) {
s.Sql = sql
}
// 如果添加的条件是in条件,则格式为"id in (?)",args参数为slice类型并且每次调用该方法只能有一个in条件
func (s *SqlBuilder[T]) Conditions(cond string, args ...interface{}) {
if strings.HasPrefix(cond, " and") {