|
|
@@ -444,6 +444,10 @@ func Update(executor Executor, executeParams *sql.UpdateExecuteParams) error {
|
|
|
return errors.New("没有传递执行参数")
|
|
|
}
|
|
|
|
|
|
+ if executeParams.Conditions == nil {
|
|
|
+ executeParams.Conditions = sql.NewConditions()
|
|
|
+ }
|
|
|
+
|
|
|
executeParamsMap, err := executeParams.Map()
|
|
|
if err != nil {
|
|
|
return err
|
|
|
@@ -478,6 +482,10 @@ func Query(executor Executor, executeParams *sql.QueryExecuteParams) ([]sql.Resu
|
|
|
return nil, 0, errors.New("没有传递执行参数")
|
|
|
}
|
|
|
|
|
|
+ if executeParams.Conditions == nil {
|
|
|
+ executeParams.Conditions = sql.NewConditions()
|
|
|
+ }
|
|
|
+
|
|
|
queryExecuteParamsMap, err := executeParams.Map()
|
|
|
if err != nil {
|
|
|
return nil, 0, err
|
|
|
@@ -527,6 +535,10 @@ func QueryOne(executor Executor, executeParams *sql.QueryOneExecuteParams) (sql.
|
|
|
return nil, errors.New("没有传递执行参数")
|
|
|
}
|
|
|
|
|
|
+ if executeParams.Conditions == nil {
|
|
|
+ executeParams.Conditions = sql.NewConditions()
|
|
|
+ }
|
|
|
+
|
|
|
executeParamsMap, err := executeParams.Map()
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
@@ -560,6 +572,10 @@ func Count(executor Executor, executeParams *sql.CountExecuteParams) (int64, err
|
|
|
return 0, errors.New("没有传递执行参数")
|
|
|
}
|
|
|
|
|
|
+ if executeParams.Conditions == nil {
|
|
|
+ executeParams.Conditions = sql.NewConditions()
|
|
|
+ }
|
|
|
+
|
|
|
executeParamsMap, err := executeParams.Map()
|
|
|
if err != nil {
|
|
|
return 0, err
|
|
|
@@ -589,6 +605,10 @@ func CheckExist(executor Executor, executeParams *sql.CheckExistExecuteParams) (
|
|
|
return false, errors.New("没有传递执行参数")
|
|
|
}
|
|
|
|
|
|
+ if executeParams.Conditions == nil {
|
|
|
+ executeParams.Conditions = sql.NewConditions()
|
|
|
+ }
|
|
|
+
|
|
|
executeParamsMap, err := executeParams.Map()
|
|
|
if err != nil {
|
|
|
return false, err
|
|
|
@@ -618,6 +638,10 @@ func CheckHasOnlyOne(executor Executor, executeParams *sql.CheckHasOnlyOneExecut
|
|
|
return false, errors.New("没有传递执行参数")
|
|
|
}
|
|
|
|
|
|
+ if executeParams.Conditions == nil {
|
|
|
+ executeParams.Conditions = sql.NewConditions()
|
|
|
+ }
|
|
|
+
|
|
|
executeParamsMap, err := executeParams.Map()
|
|
|
if err != nil {
|
|
|
return false, err
|