StorageInfo
Returns a list of purchase orders placed with suppliers.
テーブル固有の情報
SELECT
connector は Smaregi API を使用してWHERE 句条件を処理します。すべてのカラムは=、!=、>、<、>=、<= 演算子によるサーバー側フィルタリングをサポートし、文字列型のカラムはLIKE もサポートします。IN 演算子、およびdate/datetime 型のカラムに対するLIKE 演算子は、クライアント側で処理されます。
例えば、次のクエリはサーバー側で処理されます:
SELECT * FROM StorageInfo WHERE StorageInfoId = 8
SELECT OrderedDate FROM StorageInfo WHERE Status = 2
INSERT
StorageInfo を追加するには、Status、IdentificationNo、DeliveryAggregate およびDeliveryProductAggregate フィールドを指定します。
一時テーブルを使用する場合:
INSERT INTO StorageInfoDeliveries#TEMP (StorageStoreId, storageExpectedDateTo, StorageExpectedDateFrom) VALUES (2, '2019-10-11', '2019-10-1')
INSERT INTO StorageInfoDeliveryProducts#TEMP (StoreId, ProductId, Quantity) VALUES (2, 1, 12)
INSERT INTO StorageInfo (Status, IdentificationNo, DeliveryAggregate, DeliveryProductAggregate) VALUES (2, 'test1', 'StorageInfoDeliveries#TEMP', 'StorageInfoDeliveryProducts#TEMP')
集計を使用する場合:
INSERT INTO StorageInfo (Status, IdentificationNo, DeliveryAggregate, DeliveryProductAggregate, ProductAggregate) VALUES (2, '2111', ' {
"table_name": "StorageInfoDelivery",
"rows": [
{
"storageExpectedDateFrom": "2019-10-21",
"storageExpectedDateTo": "2019-12-21",
"storageStoreId": "1"
}
]
}
', ' {
"table_name": "StorageInfoDeliveryProduct",
"rows": [
{
"storeId": "1",
"productId": "1",
"quantity": "1"
}
]
}
', ' {
"table_name": "StorageInfoProduct",
"rows": [
{
"productId": "1",
"cost": "324"
}
]
}
')
Note: 同じキーを持つレコードが既に存在する場合、挿入は失敗し、ドライバーは影響を受けた行数として0 を返します。
UPSERT
このテーブルでは、UPSERT はサポートされていません。
UPDATE
Smaregi はRecipientOrderId、OrderedDate、Status およびIdentificationNo カラムの更新を許可します。
INSERT INTO StorageInfoDeliveries#TEMP (StorageInfoId, StorageStoreId, storageExpectedDateTo, StorageExpectedDateFrom) VALUES (22, 1, '2019-12-11', '2019-12-1')
UPDATE StorageInfo SET IdentificationNo = 'Updated', status = 2, DeliveryAggregate = 'StorageInfoDeliveries#TEMP' WHERE StorageInfoId = 22
DELETE
StorageInfo を削除するには、StorageInfoId を指定します。
DELETE FROM StorageInfo WHERE StorageInfoId = 7
Bulk DELETE
INSERT INTO StorageInfo#TEMP (StorageInfoId) VALUES (9);
INSERT INTO StorageInfo#TEMP (StorageInfoId) VALUES (6);
DELETE FROM StorageInfo WHERE EXISTS SELECT StorageInfoId FROM StorageInfo#TEMP
Columns
| Name | Type | ReadOnly | References | Description |
| StorageInfoId [KEY] | Integer | False | ||
| RecipientOrderId | Integer | False | ||
| OrderedDate | Date | False | ||
| Status | Integer | False | ||
| Memo | String | False | ||
| IdentificationNo | String | False | ||
| Modified | Datetime | True | ||
| Token | String | False | ||
| DeliveryAggregate | String | False |
A JSON aggregate of deliveries associated with the storage info. | |
| ProductAggregate | String | False |
A JSON aggregate of products associated with the storage info product. | |
| DeliveryProductAggregate | String | False |
A JSON aggregate of products associated with the storage info delivery. |