material_k3cloud.go 2.2 KB
package models

import "time"

//MaterialK3cloud 采集自金蝶k3cloud物料数据
type MaterialK3cloud struct {
	tableName           string    `comment:"采集自金蝶k3cloud物料数据" pg:"manufacture.material_k3cloud,alias:material_k3cloud"`
	MaterialId          int       `pg:",pk"`
	Name                string    `comment:"物料名称" pg:"name"`
	Number              string    `comment:"物料编码" pg:"number"`
	Specification       string    `comment:"规格型号" pg:"specification"`
	ForbidStatus        string    `comment:"禁用状态,A:否,B:是" pg:"forbid_status"`
	ErpClsId            int       `comment:"物料属性" pg:"erp_cls_id"`
	BaseUnitId          int       `comment:"基本单位" pg:"base_unit_id"`
	BaseUnitName        string    `comment:"基本单位名称" pg:"base_unit_name"`
	CreateDate          time.Time `comment:"创建时间" pg:"create_date"`
	ModifyDate          time.Time `comment:"修改时间" pg:"modify_date"`
	ForbidDate          time.Time `comment:"禁用时间" pg:"forbid_date"`
	ApproveDate         time.Time `comment:"审核时间" pg:"approve_date"`
	MaterialGroup       int       `comment:"物料分组" pg:"material_group"`
	MaterialGroupNumber string    `comment:"物料分组编码" pg:"material_group_number"`
	MaterialGroupName   string    `comment:"物料分组名称" pg:"material_group_name"`
	RefStatus           int       `comment:"是否使用" pg:"ref_status"`
	UseOrgId            int       `comment:"使用组织" pg:"use_org_id"`
	UseOrgName          string    `comment:"使用组织" pg:"use_org_name"`
	JoinProductId       int64     `comment:"关联的product表id" pg:"join_product_id"`
	DataVersion         int64     `comment:"数据版本" pg:"data_version"`
	FCategoryID         string    `pg:"-"`
}

//批量处理sql脚本样例
// -- 插入或则更新
// INSERT INTO demo_test ("id","name","version") VALUES (9,'xx11','v1001'),(2,'xx22','v1001'),(3,'xx3','v1001'),(4,'x4','v1001')
// ON conflict(id)
// DO UPDATE SET ("id","name")=(EXCLUDED.id,EXCLUDED.name)
// RETURNING "id","name","version"
// --- 插入或则更新
// insert into demo_test_copy1 ("id","name")
// select "id","name"
// from demo_test
// on conflict("id")
// do update set
// ("id","name") = (EXCLUDED."id",EXCLUDED."name")