|
@@ -124,15 +124,15 @@ func (d *PrdMoK3cloudDao) SyncDataProductPlan(version int64) error { |
|
@@ -124,15 +124,15 @@ func (d *PrdMoK3cloudDao) SyncDataProductPlan(version int64) error { |
124
|
)
|
124
|
)
|
125
|
SELECT prd_mo_k3cloud."join_product_plan_id",prd_mo_k3cloud."bill_no",
|
125
|
SELECT prd_mo_k3cloud."join_product_plan_id",prd_mo_k3cloud."bill_no",
|
126
|
prd_mo_k3cloud."plan_start_date",
|
126
|
prd_mo_k3cloud."plan_start_date",
|
127
|
- json_build_object('workshopId',"workshop"."workshop_id",'workshopName',prd_mo_k3cloud."work_shop_name"),
|
127
|
+ json_build_object('workshopId',COALESCE("workshop"."workshop_id",0),'workshopName',prd_mo_k3cloud."work_shop_name"),
|
128
|
prd_mo_k3cloud."material_name", json_build_object('unit',prd_mo_k3cloud."unit_name",'quantity',prd_mo_k3cloud."qty"),
|
128
|
prd_mo_k3cloud."material_name", json_build_object('unit',prd_mo_k3cloud."unit_name",'quantity',prd_mo_k3cloud."qty"),
|
129
|
2,prd_mo_k3cloud."description",
|
129
|
2,prd_mo_k3cloud."description",
|
130
|
json_build_object('productPlanExt',json_build_object('productId',prd_mo_k3cloud."join_product_plan_id",'productCode',prd_mo_k3cloud."material_number",'productName',prd_mo_k3cloud."material_name")),
|
130
|
json_build_object('productPlanExt',json_build_object('productId',prd_mo_k3cloud."join_product_plan_id",'productCode',prd_mo_k3cloud."material_number",'productName',prd_mo_k3cloud."material_name")),
|
131
|
now(),now()
|
131
|
now(),now()
|
132
|
FROM "manufacture"."prd_mo_k3cloud"
|
132
|
FROM "manufacture"."prd_mo_k3cloud"
|
133
|
- LEFT JOIN "material_k3cloud" ON "prd_mo_k3cloud"."material_number"="material_k3cloud"."number"
|
|
|
134
|
- LEFT JOIN "workshop" ON "workshop"."workshop_name" = "prd_mo_k3cloud"."work_shop_name"
|
|
|
135
|
- WHERE prd_mo_k3cloud."data_version"=?
|
133
|
+ LEFT JOIN "manufacture"."material_k3cloud" ON "prd_mo_k3cloud"."material_id"="material_k3cloud"."material_id"
|
|
|
134
|
+ LEFT JOIN "manufacture"."workshop" ON "workshop"."workshop_name" = "prd_mo_k3cloud"."work_shop_name"
|
|
|
135
|
+ WHERE prd_mo_k3cloud."data_version">=?
|
136
|
ON conflict ("product_plan_id") DO
|
136
|
ON conflict ("product_plan_id") DO
|
137
|
UPDATE
|
137
|
UPDATE
|
138
|
SET (
|
138
|
SET (
|