---
# System prepended metadata

title: 訂房table關連圖
tags: [訂房, table]

---

# 訂房table關連圖
###### tags: `table` `訂房`

```mermaid
graph TB;
subgraph 範例;
  id1[cust_idx #客戶索引#]---|1vs1|id2[ghist_mn #住客歷史#];
  id3[order_mn #訂房主檔#]-->|1vs多|id4[order_dt #訂房明細#];
  id5[cust_idx #客戶索引#]-.-|多vs多|id6[ghist_mn #住客歷史#];
end
```

### table名稱
|table      |說明                       |
|---------|-------------------------- |
|block_mn|鎖控主檔|
|blockinv_mn|鎖控庫存檔|
|block_tr|鎖控交易檔|
|cust_mn|客戶主檔|
|cust_idx|客戶索引檔|
|ghist_mn|住客歷史資料|
|ghist_visit_dt|來訪統計資料|
|guest_mn|住客資料|
|master_rf|公帳號|
|order_route_dt|訂房分帳規則|
|order_mn|訂房主檔|
|order_dt|訂房明細資料|
|order_appraise|訂房房價檔|
|rminv_tr|庫存控制檔|
|rminv_mn|庫存檔|
|service_tr|訂房服務項目|
|tmp_order_appraise|訂房房價暫存檔|
|hfd_pickup_dt|hfd_pickup_dt|


```mermaid
graph LR;

subgraph 訂房;
  master_rf[master_rf]---order_mn[order_mn];
  order_mn[order_mn]-->order_dt[order_dt];
  order_mn[order_mn]---deposit_mn[deposit_mn];
  ratecod_mn[ratecod_mn]-.-order_dt[order_dt];
  order_dt[order_dt]-->guest_mn[guest_mn];
  guest_mn[guest_mn]-->pickup_dt[pickup_dt];
   order_dt[order_dt]-->hfd_pickup_dt[hfd_pickup_dt]; 
end

subgraph 庫存;
  order_dt[order_dt]---rminv_tr[rminv_tr];
  rminv_tr[rminv_tr]-->rminv_mn[rminv_mn];
end

subgraph 帳;
  order_dt[order_dt]-->order_appraise[order_appraise]; 
  order_dt[order_dt]-->service_tr[service_tr]-->order_appraise[order_appraise]; 
  order_appraise[order_appraise]---tmp_order_appraise[tmp_order_appraise];
end

subgraph 訂房公司;
    cust_mn[cust_mn]---order_mn[order_mn];
  cust_mn[cust_mn]-->cust_mn_pers_dt[cust_mn_pers_dt];
end

subgraph 住客歷史;
  cust_idx[cust_idx]---ghist_mn[ghist_mn];
  ghist_mn[ghist_mn]---guest_mn[guest_mn];
  ghist_mn[ghist_mn]-->ghist_visit_dt[ghist_visit_dt];
end
```

```mermaid
graph LR;
subgraph 鎖控;
  block_mn[block_mn]-->blockinv_mn[blockinv_mn]-->block_tr[block_tr];
  subgraph 庫存;
    block_tr[block_tr]---rminv_tr[rminv_tr];
    rminv_tr[rminv_tr]-->rminv_mn[rminv_mn];
  end
end