|
|
@ -20,5 +20,10 @@ list,err := new(Query).Db(dbname).Table(tablename).Where("id=?").Where("name=?") |
|
|
|
|
|
|
|
list,err := new(Query).Db(dbname).Table(tablename).Join([]string{jointable,tablename.id=jointable.cid,"LEFT"}).Where("id=?").Where("name=?").Value(1).Value("test").Select() |
|
|
|
|
|
|
|
更新 |
|
|
|
ret,err := new(Query).Db(dbname).Table(tablename).Data("name=?").Data("depart=?").Value("xxx").Value("test").Update() |
|
|
|
|
|
|
|
|
|
|
|
插入 |
|
|
|
ret,err := new(Query).Db(dbname).Table(tablename).Data("name=?").Data("depart=?").Value("xxx").Value("test").Create() |
|
|
|
``` |