|
|
|
1
|
+package models
|
|
|
|
2
|
+
|
|
|
|
3
|
+//MaterialK3cloud 采集自金蝶k3cloud物料数据
|
|
|
|
4
|
+type MaterialK3cloud struct {
|
|
|
|
5
|
+ tableName string `comment:"采集自金蝶k3cloud物料数据" pg:"manufacture.material_k3cloud,alias:material_k3cloud"`
|
|
|
|
6
|
+ MaterialId int64 `pg:",pk"`
|
|
|
|
7
|
+ Name string `comment:"物料名称" pg:"name"`
|
|
|
|
8
|
+ Number string `comment:"物料编码" pg:"number"`
|
|
|
|
9
|
+ Specification string `comment:"规格型号" pg:"specification"`
|
|
|
|
10
|
+ ForbidStatus string `comment:"禁用状态,"A":否,"B":是" pg:"forbid_status"`
|
|
|
|
11
|
+ ErpClsId int `comment:"物料属性" pg:"erp_cls_id"`
|
|
|
|
12
|
+ BaseUnitId int `comment:"基本单位" pg:"base_unit_id"`
|
|
|
|
13
|
+ BaseUnitName string `comment:"基本单位名称" pg:"base_unit_name"`
|
|
|
|
14
|
+ CreateDate string `comment:"创建时间" pg:"create_date"`
|
|
|
|
15
|
+ ModifyDate string `comment:"修改时间" pg:"modify_date"`
|
|
|
|
16
|
+ ForbidDate string `comment:"禁用时间" pg:"forbid_date"`
|
|
|
|
17
|
+ ApproveDate string `comment:"审核时间" pg:"approve_date"`
|
|
|
|
18
|
+ MaterialGroup int `comment:"物料分组" pg:"material_group"`
|
|
|
|
19
|
+ MaterialGroupNumber string `comment:"物料分组编码" pg:"material_group_number"`
|
|
|
|
20
|
+ MaterialGroupName string `comment:"物料分组名称" pg:"material_group_name"`
|
|
|
|
21
|
+ RefStatus int `comment:"是否使用" pg:"ref_status"`
|
|
|
|
22
|
+ JoinProductId int64 `comment:"关联的product表id" pg:"join_product_id"`
|
|
|
|
23
|
+ DataVersion int64 `comment:"数据版本" pg:"data_version"`
|
|
|
|
24
|
+}
|
|
|
|
25
|
+
|
|
|
|
26
|
+//批量处理sql脚本样例
|
|
|
|
27
|
+// -- 插入或则更新
|
|
|
|
28
|
+// INSERT INTO demo_test ("id","name","version") VALUES (9,'xx11','v1001'),(2,'xx22','v1001'),(3,'xx3','v1001'),(4,'x4','v1001')
|
|
|
|
29
|
+// ON conflict(id)
|
|
|
|
30
|
+// DO UPDATE SET ("id","name")=(EXCLUDED.id,EXCLUDED.name)
|
|
|
|
31
|
+// RETURNING "id","name","version"
|
|
|
|
32
|
+// --- 插入或则更新
|
|
|
|
33
|
+// insert into demo_test_copy1 ("id","name")
|
|
|
|
34
|
+// select "id","name"
|
|
|
|
35
|
+// from demo_test
|
|
|
|
36
|
+// on conflict("id")
|
|
|
|
37
|
+// do update set
|
|
|
|
38
|
+// ("id","name") = (EXCLUDED."id",EXCLUDED."name") |