1 Star 1 Fork 0

JNan-QQ/go-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 708 Bytes
一键复制 编辑 原始数据 按行查看 历史
package main
import (
"fmt"
simple_sql "gitee.com/jn-qq/go-tools/sql"
_ "github.com/go-sql-driver/mysql"
)
func main() {
client, _ := simple_sql.NewDbClient("mysql", "root:MYSQL1.t!@#@tcp(172.31.205.27:3306)/ngkm?charset=utf8mb4&parseTime=True&loc=Local")
defer client.Close()
a := client.QueryTable("t_km_tmplt_keys").
Select("atom_id", "para_nm", "para_type_cd").
Where(simple_sql.Eq{Filed: "para_type_cd", Value: 6}).OrderBy("-atom_id").Pox(3, 0).String()
fmt.Println(a)
type ss struct {
AtomId int `db:"atom_id"`
ParaNm string `db:"para_nm"`
ParaType string `db:"para_type_cd"`
}
var cc = new(ss)
err := client.First(cc)
if err != nil {
panic(err)
}
fmt.Println(cc)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/jn-qq/go-tools.git
git@gitee.com:jn-qq/go-tools.git
jn-qq
go-tools
go-tools
master

搜索帮助