CREATE TABLE JCL_QUICKSEARCH_CONDITION (
   ID NUMBER NOT NULL,
   FIELDID NVARCHAR2(400) NULL,
   CUSTOMNAME NVARCHAR2(400) NULL,
   TYPE NUMBER NULL,
   ORDERID NUMBER NULL,
   BELONGTO NUMBER NULL,
   SHOWMODEL NUMBER NULL,
   MODELID NUMBER NULL,
   ENABLE NUMBER NULL,
   CONSTRAINT JCL_QUICKSEARCH_CONDITION_PK PRIMARY KEY (ID)
)
/

CREATE SEQUENCE JCL_QUICKSEARCH_CONDITION_ID INCREMENT BY 1 START WITH 1 nomaxvalue minvalue 1 NOCYCLE
/

CREATE
OR REPLACE TRIGGER JCL_CONDITION_ID_TIGGER BEFORE INSERT ON JCL_QUICKSEARCH_CONDITION FOR EACH ROW
BEGIN
SELECT
    JCL_QUICKSEARCH_CONDITION_ID.nextval INTO:new.ID
FROM
    dual;
END;
/

CREATE TABLE JCL_QUICKSEARCH_DETAIL (
   ID NUMBER NOT NULL,
   FIELDID NVARCHAR2(400) NULL,
   BELONGTO NUMBER NULL,
   CID NUMBER NULL,
   CUSTOMNAME NVARCHAR2(400) NULL,
   MINNUM NUMBER NULL,
   MAXNUM NUMBER NULL,
   TYPE NUMBER NULL,
   ORDERID NUMBER NULL,
   MODELID NUMBER NULL,
   CONSTRAINT JCL_QUICKSEARCH_DETAIL_PK PRIMARY KEY (ID)
)
/

CREATE SEQUENCE JCL_QUICKSEARCH_DETAIL_ID INCREMENT BY 1 START WITH 1 nomaxvalue minvalue 1 NOCYCLE
/

CREATE
OR REPLACE TRIGGER JCL_DETAIL_ID_TIGGER BEFORE INSERT ON JCL_QUICKSEARCH_DETAIL FOR EACH ROW
BEGIN
SELECT
    JCL_QUICKSEARCH_DETAIL_ID.nextval INTO:new.ID
FROM
    dual;
END;
/

CREATE TABLE JCL_QUICKSEARCH_SETTING (
   ID NUMBER NOT NULL,
   BELONGTO NUMBER NULL,
   ISQUICKSEARCH NUMBER NULL,
   UPDATETOR NUMBER NULL,
   UPDATEDATE NVARCHAR2(10) NULL,
   UPDATETIME NVARCHAR2(8) NULL,
   ISSHOWTYPE NUMBER NULL,
   ISHIDENAME NUMBER NULL,
   CONSTRAINT JCL_QUICKSEARCH_SETTING_PK PRIMARY KEY (ID)
)
/

CREATE SEQUENCE JCL_QUICKSEARCH_SETTING_ID INCREMENT BY 1 START WITH 1 nomaxvalue minvalue 1 NOCYCLE
/

CREATE
OR REPLACE TRIGGER JCL_SETTING_ID_TIGGER BEFORE INSERT ON JCL_QUICKSEARCH_SETTING FOR EACH ROW
BEGIN
SELECT
    JCL_QUICKSEARCH_SETTING_ID.nextval INTO:new.ID
FROM
    dual;
END;
/