list_resources query
001_select_resources.sql
SQL種別
SELECT
SQLの概要
資源一覧を返すため、名前とIDの固定順で継続位置より後の資源を取得する。
利用するテーブル
resources
引数
| DDLテーブル | DDL項目 | SQL項目 | 日本語名 | 型 | nullable |
|---|---|---|---|---|---|
- |
after_name |
after_name |
- | str | None |
yes |
- |
after_resource_id |
after_resource_id |
- | str | None |
yes |
- |
limit |
limit |
- | int |
no |
戻り値
| DDLテーブル | DDL項目 | SQL項目 | 日本語名 | 型 | nullable |
|---|---|---|---|---|---|
resources |
resource_id |
resource_id |
資源ID。 | VARCHAR(36) |
no |
resources |
name |
name |
資源名。空白除去後1〜100文字。 | VARCHAR(100) |
no |
resources |
description |
description |
資源の説明。0〜1,000文字。 | VARCHAR(1000) |
no |
resources |
kind |
kind |
資源種別。roomまたはequipment。 | VARCHAR(20) |
no |
resources |
active |
active |
新規予約を受け付けるかどうか。 | BOOLEAN |
no |
resources |
row_version |
row_version |
利用者に公開する楽観ロック用の行バージョン。 | INT |
no |
条件
WHERE(CAST(@after_name AS VARCHAR) IS NULLOR CAST(@after_resource_id AS VARCHAR) IS NULLOR (resources.name, resources.resource_id) > (CAST(@after_name AS VARCHAR), CAST(@after_resource_id AS VARCHAR)))