CREATE TABLE IF NOT EXISTS biz_client_quote (
  quote_id      BIGINT NOT NULL AUTO_INCREMENT,
  tenant_id     BIGINT NOT NULL DEFAULT 1,
  quote_no      VARCHAR(50) DEFAULT '',
  client_name   VARCHAR(200) DEFAULT '',
  rfq_id        BIGINT DEFAULT NULL,
  rfq_no        VARCHAR(50) DEFAULT '',
  rfq_title     VARCHAR(200) DEFAULT '',
  status        VARCHAR(20) DEFAULT 'draft',
  validity_date DATETIME DEFAULT NULL,
  total_amount  DECIMAL(15,4) DEFAULT 0,
  currency      VARCHAR(10) DEFAULT 'CNY',
  remark        TEXT,
  create_by     VARCHAR(64) DEFAULT '',
  create_time   DATETIME,
  update_time   DATETIME,
  PRIMARY KEY (quote_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='甲方报价单';

CREATE TABLE IF NOT EXISTS biz_client_quote_item (
  item_id       BIGINT NOT NULL AUTO_INCREMENT,
  quote_id      BIGINT NOT NULL,
  material_name VARCHAR(200) DEFAULT '',
  spec          VARCHAR(500) DEFAULT '',
  model_no      VARCHAR(200) DEFAULT '',
  unit          VARCHAR(50) DEFAULT '',
  quantity      DECIMAL(15,4) DEFAULT 0,
  cost_price    DECIMAL(15,4) DEFAULT 0,
  unit_price    DECIMAL(15,4) DEFAULT 0,
  total_price   DECIMAL(15,4) DEFAULT 0,
  delivery_days INT DEFAULT 0,
  remark        VARCHAR(500) DEFAULT '',
  PRIMARY KEY (item_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='甲方报价明细';
