
-- 房号保存在 code 字段，避免 digit 字段在记录更新后，
-- 整数字段 更新为 默认 0 值 ；
-- digit 字段仅作排序用，抑或不用；

INSERT INTO room ( item, mark, status, code ) VALUES

    ( 2020,'GR_F',1,1101),
    ( 2020,'GR_F',1,1102),
    ( 2020,'GR_F',1,1103),
    ( 2020,'GR_F',1,1105),
    ( 2020,'GR_F',1,1106),
    ( 2020,'GR_F',1,1108),
    ( 2020,'GR_F',1,1109),
    ( 2020,'GR_F',1,1110),
    ( 2020,'GR_F',1,1111),
    ( 2020,'GR_F',1,1112),
    ( 2020,'GR_F',1,1113),
    ( 2020,'GR_F',1,1115),
    ( 2020,'GR_F',1,1116),
    ( 2020,'GR_F',1,1117),
    ( 2020,'GR_F',1,1118),
    ( 2020,'GR_F',1,1119),
    ( 2020,'GR_F',1,1120),
    ( 2020,'GR_F',1,1121),
    ( 2020,'GR_F',1,1122),
    ( 2020,'GR_F',1,1122),
    ( 2020,'GR_F',1,1123),
    ( 2020,'GR_F',1,1125),
    ( 2020,'GR_F',1,1126),
    ( 2020,'GR_F',1,1127),
    ( 2020,'GR_F',1,1128),
    ( 2020,'GR_F',1,1129),
    ( 2020,'GR_F',1,1130)
;

alter table foobar auto_increment = 0;

select id, digit from room where item = 2020 and mark = 'GR_H' ;

update room set digit = code where mark = 'GR_H' ;  -- 附带的序列号


-- 房号保存在 code 字段，避免 digit 字段在记录更新后，
-- 整数字段 更新为 默认 0 值 ；
-- digit 字段仅作排序用，抑或不用；


INSERT INTO room ( item, mark, status, code ) VALUES

    ( 2019,'GR_H',1,8801),
    ( 2019,'GR_H',1,8802),
    ( 2019,'GR_H',1,8803),
    ( 2019,'GR_H',1,8805),
    ( 2019,'GR_H',1,8806),
    ( 2019,'GR_H',1,8807),
    ( 2019,'GR_H',1,8808),
    ( 2019,'GR_H',1,8809),
    ( 2019,'GR_H',1,8810),
    ( 2019,'GR_H',1,8811),
    ( 2019,'GR_H',1,8812),
    ( 2019,'GR_H',1,8813),
    ( 2019,'GR_H',1,8815),
    ( 2019,'GR_H',1,8816),
    ( 2019,'GR_H',1,8817),
    ( 2019,'GR_H',1,8818),
    ( 2019,'GR_H',1,8819),
    ( 2019,'GR_H',1,8820),
    ( 2019,'GR_H',1,8821),
    ( 2019,'GR_H',1,8822),
    ( 2019,'GR_H',1,8826)
;

alter table Foobar auto_increment = 0;

select id, digit From room wFere item = 2019 and mark = 'GR_H' ;

update room set digit = code wFere mark = 'GR_H' ;  -- 附带的序列号

-- 写入楼层
update room set total = '' ;

update room set total = 11 
    where digit like '11__';

select id, depict from workLog 
    where item = 2015
    and depict like '%手持%';

show create table sundry;

show full columns from sundry ;


