{
    "upgrade1":{
        "version":"0.0.2.1",
        "description":"挂单",
        "scripts":{ 
                    "sql1":{
                            "line1":"DROP TABLE IF EXISTS hang_ticket;",
                            "line2":"CREATE TABLE hang_ticket (",
                            "line3":"hangNo  VARCHAR(32),",
                            "line4":"id  VARCHAR(32),",
                            "line5":"storeId  VARCHAR(32),",
                            "line6":"no  VARCHAR(32),",
                            "line7":"status  Integer,",
                            "line8":"handNo  VARCHAR(32),",
                            "line9":"workNo  VARCHAR(32),",
                            "line10":"saleDate  VARCHAR(32),",
                            "line11":"cancelNo  VARCHAR(32),",
                            "line12":"cancelDate  VARCHAR(32),",
                            "line13":"discountType  VARCHAR(32),",
                            "line14":"tableId  VARCHAR(32),",
                            "line15":"tableNo  VARCHAR(32),",
                            "line16":"people  Integer,",
                            "line17":"busMode  Integer,",
                            "line18":"busType  VARCHAR(16),",
                            "line19":"upflag  Integer,",
                            "line20":"dcpeople  VARCHAR(32),",
                            "line21":"scaddress  VARCHAR(32),",
                            "line22":"scpeople  VARCHAR(32),",
                            "line23":"scno  VARCHAR(32),",
                            "line24":"scphone  VARCHAR(32),",
                            "line25":"dcyuzhi  decimal(24,2),",
                            "line26":"dcbeiyong  decimal(24,2),",
                            "line27":"sctime  varchar(32),",
                            "line28":"amount  decimal(24,2),",
                            "line29":"paid  decimal(24,2),",
                            "line30":"discount  decimal(24,2),",
                            "line31":"give  decimal(24,2),",
                            "line32":"deviceName  VARCHAR(32),",
                            "line33":"noOrg  VARCHAR(32),",
                            "line34":"backCause  VARCHAR(128),",
                            "line35":"posNo  VARCHAR(16),",
                            "line36":"add_memo  VARCHAR(1024),",
                            "line37":"add_sequenceNo  INTEGER,",
                            "line38":"add_card_main  decimal(24,2),",
                            "line39":"member_card  VARCHAR(20),",
                            "line40":"member_password  VARCHAR(64),",
                            "line41":"member_name  VARCHAR(32),",
                            "line42":"member_klxno  VARCHAR(4),",
                            "line43":"member_klxname  VARCHAR(32),",
                            "line44":"member_kdjno  VARCHAR(4),",
                            "line45":"member_kdjname  VARCHAR(32),",
                            "line46":"member_status  VARCHAR(16),",
                            "line47":"member_money  decimal(24,2),",
                            "line48":"member_shopmoney  decimal(24,2),",
                            "line49":"member_jf  decimal(24,2),",
                            "line50":"member_shopjf  decimal(24,2),",
                            "line51":"member_maxconsume  decimal(24,2),",
                            "line52":"add_freemoney  decimal(24,2)",
                            "line53":");"
                            },
                    "sql2":{
                            "line1":"DROP TABLE IF EXISTS hang_dish;",
                            "line2":"CREATE TABLE hang_dish (",
                            "line3":"hangNo  VARCHAR(32),",
                            "line4":"add_suitSame  VARCHAR(32),",
                            "line5":"add_suitSubId  VARCHAR(32),",
                            "line6":"add_mount  decimal(24,2),",
                            "line7":"add_buygift_num  decimal(24,2),",
                            "line8":"pic  VARCHAR(256),",
                            "line9":"chudano  VARCHAR(32),",
                            "line10":"chudaname  VARCHAR(32),",
                            "line11":"typename  VARCHAR(32),",
                            "line12":"labelprintflag  INTEGER,",
                            "line13":"chudaflag  INTEGER,",
                            "line14":"id  VARCHAR(32),",
                            "line15":"storeId  VARCHAR(32),",
                            "line16":"busNo  VARCHAR(32),",
                            "line17":"tableNo  VARCHAR(32),",
                            "line18":"sequenceNo  INTEGER,",
                            "line19":"dishId  VARCHAR(32),",
                            "line20":"dishNo  VARCHAR(32),",
                            "line21":"dishName  VARCHAR(32),",
                            "line22":"specId  VARCHAR(32),",
                            "line23":"specName  VARCHAR(32),",
                            "line24":"count  decimal(24,2),",
                            "line25":"rcount  decimal(24,2),",
                            "line26":"price  decimal(24,2),",
                            "line27":"priceOrg  decimal(24,2),",
                            "line28":"addPrice  decimal(24,2),",
                            "line29":"discount  decimal(24,2),",
                            "line30":"memberno  VARCHAR(32),",
                            "line31":"dzType  INTEGER,",
                            "line32":"isSuit  Integer,",
                            "line33":"suitId  VARCHAR(32),",
                            "line34":"isSpecial  Integer,",
                            "line35":"isCoupon  Integer,",
                            "line36":"isGive  Integer,",
                            "line37":"workerNo  VARCHAR(32),",
                            "line38":"saleDate  VARCHAR(32),",
                            "line39":"deviceName  VARCHAR(32),",
                            "line40":"saveFlag  INTEGER,",
                            "line41":"parentSequenceNo  INTEGER,",
                            "line42":"upflag  Integer,",
                            "line43":"payStatus  Integer,",
                            "line44":"suitItemNo  VARCHAR(16),",
                            "line45":"priceAddSuit  decimal(24,2),",
                            "line46":"money  decimal(24,2),",
                            "line47":"hand  INTEGER,",
                            "line48":"ownerDishId  VARCHAR(32),",
                            "line49":"ownerSpecId  VARCHAR(32),",
                            "line50":"isSpecialMember  INTEGER DEFAULT 0,",
                            "line51":"moneyActual  decimal(24,2)",
                            "line52":");"
                            },
                    "sql3":{
                            "line1":"DROP TABLE IF EXISTS hang_dish_make;",
                            "line2":"CREATE TABLE hang_dish_make (",
                            "line3":"hangNo  VARCHAR(32),",
                            "line4":"id  VARCHAR(32),",
                            "line5":"storeId  VARCHAR(32),",
                            "line6":"busNo  VARCHAR(32),",
                            "line7":"orderSequenceNo  INTEGER,",
                            "line8":"sequenceNo  INTEGER,",
                            "line9":"makeId  VARCHAR(32),",
                            "line10":"makeName  VARCHAR(64),",
                            "line11":"addPrice  decimal(24,2),",
                            "line12":"count  decimal(24,2),",
                            "line13":"rcount  decimal(24,2),",
                            "line14":"hand  INTEGER,",
                            "line15":"qtyFlag  INTEGER,",
                            "line16":"upFlag  INTEGER",
                            "line17":");"
                            },
                    "sql4":{
                            "line1":"DROP TABLE IF EXISTS hang_pay;",
                            "line2":"CREATE TABLE hang_pay (",
                            "line3":"hangNo  VARCHAR(32),",
                            "line4":"add_password  VARCHAR(64),",
                            "line5":"id  VARCHAR(32),",
                            "line6":"storeId  VARCHAR(32),",
                            "line7":"payNo  VARCHAR(32),",
                            "line8":"busNo  VARCHAR(32),",
                            "line9":"tableId  VARCHAR(32),",
                            "line10":"tableNo  VARCHAR(32),",
                            "line11":"payTypeId  VARCHAR(32),",
                            "line12":"payType  VARCHAR(32),",
                            "line13":"money  decimal(24,2),",
                            "line14":"paid  decimal(24,2),",
                            "line15":"change  decimal(24,2),",
                            "line16":"virtual  decimal(24,2),",
                            "line17":"workNo  VARCHAR(32),",
                            "line18":"deviceName  VARCHAR(32),",
                            "line19":"voucherNo  VARCHAR(32),",
                            "line20":"payDate  VARCHAR(32),",
                            "line21":"face  decimal(24,2),",
                            "line22":"cardno  VARCHAR(32),",
                            "line23":"cardYe  decimal(24,2),",
                            "line24":"cardJf  decimal(24,2),",
                            "line25":"upflag  Integer,",
                            "line26":"memo  VARCHAR(256),",
                            "line27":"moneyDiscount  decimal(24,2)",
                            "line28":");"
                            },
                    "sql5":{
                            "line1":"DROP TABLE IF EXISTS hang_pay_mode;",
                            "line2":"CREATE TABLE hang_pay_mode (",
                            "line3":"hangNo  VARCHAR(32),",
                            "line4":"id  VARCHAR(32),",
                            "line5":"no  VARCHAR(32),",
                            "line6":"name  VARCHAR(64),",
                            "line7":"typeId  VARCHAR(32),",
                            "line8":"frontFlag  INTEGER,",
                            "line9":"typeNo  VARCHAR(32),",
                            "line10":"typeName  VARCHAR(64),",
                            "line11":"typeSign  VARCHAR(32),",
                            "line12":"amount  decimal(24,2)",
                            "line13":");"
                            }
        }
    },
    "upgrade2":{
        "version":"0.0.2.4",
        "description":"上传做法后本地状态未更新",
        "scripts":{ 
                    "sql1":{
                            "line1":"update food_order_dish_make ",
                            "line2":"set upFlag = 1 ",
                            "line3":"where upFlag = 0 ",
                            "line4":"and exists(select 1 from food_business_ticket ",
                            "line5":"where food_business_ticket.no = food_order_dish_make.busNo ",
                            "line6":"and food_business_ticket.upFlag = 1);"
                            }
        }
    },
    "upgrade3":{
        "version":"0.0.2.4",
        "description":"支付方式视图",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_food_pay_mode_tmp;",
                            "line2":"CREATE VIEW v_food_pay_mode_tmp AS ",
                            "line3":"select a.id, a.no, a.name, a.typeId, a.frontFlag,",
                            "line4":"b.no as typeNo, b.name as typeName, b.sign as typeSign,",
                            "line5":"a.incomeFlag,",
                            "line6":"0.00 as amount ",
                            "line7":"from food_pay_mode a inner join food_pay_type b ",
                            "line8":"on a.typeId = b.id;"
                            }
        }
    },
    "upgrade4":{
        "version":"0.0.2.4",
        "description":"挂单表添加字段",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_pay_mode' and sql like '%incomeFlag%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_pay_mode add column incomeFlag INTEGER;"
                            },
                    "sql2":{
                            "line1":"update hang_pay_mode ",
                            "line2":"set incomeFlag =(select incomeFlag from food_pay_mode where food_pay_mode.no = hang_pay_mode.no) ",
                            "line3":"where exists(select 1 from food_pay_mode where food_pay_mode.no = hang_pay_mode.no);"
                            }
        }
    },
    "upgrade5":{
        "version":"0.0.2.5",
        "description":"菜品表添加字段 istaple 是否主食 0否1是",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_dish' and sql like '%istaple%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_dish add column istaple INTEGER default 0;"
                            }
        }
    },
    "upgrade6":{
        "version":"0.0.2.5",
        "description":"菜品表添加字段 isweigh 是否称重 0否1是",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_dish' and sql like '%isweigh%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_dish add column isweigh INTEGER default 0;"
                            }
        }
    },
    "upgrade7":{
        "version":"0.0.2.5",
        "description":"添加操作员权限表",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='cy_worker_right';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE cy_worker_right (",
                            "line2":"workerId  VARCHAR(32) NOT NULL,",
                            "line3":"moduleNo  VARCHAR(16) NOT NULL,",
                            "line4":"PRIMARY KEY (workerId, moduleNo)",
                            "line5":");"
                            }
        }
    },
    "upgrade8":{
        "version":"0.0.2.5",
        "description":"添加数据下载表 cy_worker_right",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='store.getWorkerPower';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values('27','store.getWorkerPower','cy_worker_right','workerpower');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values('27','storeId',null);"
                            }
        }
    },
    "upgrade9":{
        "version":"0.0.2.5",
        "description":"添加操作员日志表 local_operation_log",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_operation_log';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE local_operation_log (",
                            "line2":"storeNo  VARCHAR(32),",
                            "line3":"storeName  VARCHAR(32),",
                            "line4":"posNo  VARCHAR(16),",
                            "line5":"moduleNo  VARCHAR(16),",
                            "line6":"workNo  VARCHAR(32),",
                            "line7":"workName  VARCHAR(64),",
                            "line8":"authNo  VARCHAR(32),",
                            "line9":"authName  VARCHAR(64),",
                            "line10":"authTime  VARCHAR(32)",
                            "line11":");"
                            }
        }
    },
    "upgrade10":{
        "version":"0.0.2.6",
        "description":"操作员日志表添加字段 moduleName 权限名称",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_operation_log' and sql like '%moduleName%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_operation_log add column moduleName VARCHAR(64);"
                            }
        }
    },
    "upgrade11":{
        "version":"0.0.2.6",
        "description":"添加当前门店信息表 cy_store_current",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='cy_store_current';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE cy_store_current (",
                            "line2":"id  VARCHAR(32),",
                            "line3":"no  VARCHAR(16),",
                            "line4":"name  VARCHAR(32),",
                            "line5":"stapleFlag  INTEGER",
                            "line6":");"
                            }
        }
    },
    "upgrade12":{
        "version":"0.0.2.7",
        "description":"挂单表添加字段 istaple",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%istaple%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_dish add column istaple  INTEGER DEFAULT 0;"
                            }
        }
    },
    "upgrade13":{
        "version":"0.0.2.7",
        "description":"挂单表添加字段 isweigh",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%isweigh%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_dish add column isweigh  INTEGER DEFAULT 0;"
                            }
        }
    },
    "upgrade14":{
        "version":"0.0.2.9",
        "description":"挂单表添加字段 dishMake",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%dishMake%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_dish add column dishMake VARCHAR(512);"
                            }
        }
    },
    "upgrade15":{
        "version":"0.0.2.11",
        "description":"添加参数设置 点菜自动转到私有做法",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='orderDish_autoGotoPrivateMake';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('orderDish_autoGotoPrivateMake','0','点菜自动转到私有做法','0 不转 1 转，普通菜且有私有做法时有效');"
                            }
        }
    },
    "upgrade16":{
        "version":"0.0.2.11",
        "description":"添加轮播字幕表 cy_advert_caption",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='cy_advert_caption';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE cy_advert_caption(",
                            "line2":"id VARCHAR(32),",
                            "line3":"name VARCHAR(32),",
                            "line4":"content VARCHAR(512)",
                            "line5":");"
                            }
        }
    },
    "upgrade17":{
        "version":"0.0.2.11",
        "description":"添加数据下载表 cy_advert_caption",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='store.getAdvertCaptions';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values(28,'store.getAdvertCaptions','cy_advert_caption','captions');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values(28,'storeId',null);"
                            }
        }
    },
    "upgrade18":{
        "version":"0.0.2.12",
        "description":"添加参数设置 称重模式",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='orderDish_weighMode';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('orderDish_weighMode','0','称重模式','0非称重模式 1称重模式');"
                            }
        }
    },
    "upgrade19":{
        "version":"0.0.2.12",
        "description":"挂单表添加字段 countMode",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%countMode%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_dish add column countMode INTEGER DEFAULT 0;"
                            }
        }
    },
    "upgrade20":{
        "version":"0.0.2.13",
        "description":"营业单据支付视图 v_yydj_query_dish",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_yydj_query_dish;",
                            "line2":"CREATE VIEW v_yydj_query_dish AS ",
                            "line3":"select id,storeId,busNo,tableNo,sequenceNo,dishId,dishNo,dishName,specId,specName,count,",
                            "line4":"rcount,price,priceOrg,addPrice,discount,memberno,dzType,",
                            "line5":"isSuit,case when isSuit = 2 then 1 else 0 end as suitFlag,",
                            "line6":"suitId,isSpecial,",
                            "line7":"isCoupon,isGive,workerNo,saleDate,deviceName,saveFlag,parentSequenceNo,upflag,",
                            "line8":"payStatus,suitItemNo,priceAddSuit,money,hand,ownerDishId,ownerSpecId,isSpecialMember,",
                            "line9":"moneyActual",
                            "line10":"from food_order_dish;"
                            }
        }
    },
    "upgrade21":{
        "version":"0.0.2.15",
        "description":"添加卡金变动表 card_moneychange",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='card_moneychange';",
        "scripts":{
                    "sql1":{
                            "line1": "CREATE TABLE card_moneychange (",
                            "line2": "NO  VARCHAR(32),",
                            "line3": "CARD  VARCHAR(32),",
                            "line4": "DATE  VARCHAR(32),",
                            "line5": "CHANGE_TYPE  VARCHAR(16),",
                            "line6": "FANO  VARCHAR(16),",
                            "line7": "CHANGE_MONEY  DECIMAL(24,2),",
                            "line8": "payTypeId  VARCHAR(32),",
                            "line9": "payType  VARCHAR(32),",
                            "line10":"storeId  VARCHAR(32),",
                            "line11":"SHOP  VARCHAR(16),",
                            "line12":"posNo  VARCHAR(16),",
                            "line13":"WORKER  VARCHAR(16),",
                            "line14":"CARDTYPE  VARCHAR(32),",
                            "line15":"CARDGRADE  VARCHAR(32),",
                            "line16":"NAME  VARCHAR(16),",
                            "line17":"TEL  VARCHAR(32),",
                            "line18":"PREMONEY  DECIMAL(24,2),",
                            "line19":"GIVEMONEY  DECIMAL(24,2),",
                            "line20":"AFTMONEY  DECIMAL(24,2),",
                            "line21":"PREJF  DECIMAL(24,2),",
                            "line22":"GIVEJF  DECIMAL(24,2),",
                            "line23":"AFTJF  DECIMAL(24,2),",
                            "line24":"MEMO  VARCHAR(128)",
                            "line25":");"
                            }
        }
    },
    "upgrade22":{
        "version":"0.0.2.15",
        "description":"卡金变动视图 v_card_moneychange",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_card_moneychange;",
                            "line2":"CREATE VIEW v_card_moneychange AS ",
                            "line3":"select * from card_moneychange;"                            
                            }
        }
    },
    "upgrade23":{
        "version":"0.0.2.15",
        "description":"交班主表添加字段 card_realMoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover' and sql like '%card_realMoney%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover add column card_realMoney decimal(24,2) DEFAULT 0;"
                            }
        }
    },
    "upgrade24":{
        "version":"0.0.2.15",
        "description":"交班主表添加字段 sum_realMoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover' and sql like '%sum_realMoney%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover add column sum_realMoney decimal(24,2) DEFAULT 0;"
                            }
        }
    },
    "upgrade25":{
        "version":"0.0.2.15",
        "description":"交班明细表添加字段 card_count",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover' and sql like '%card_count%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover add column card_count INTEGER DEFAULT 0;"
                            }
        }
    },
    "upgrade26":{
        "version":"0.0.2.15",
        "description":"交班明细表添加字段 card_count",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover_detail' and sql like '%card_count%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover_detail add column card_count INTEGER DEFAULT 0;"
                            }
        }
    },
    "upgrade27":{
        "version":"0.0.2.15",
        "description":"交班明细表添加字段 card_money",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover_detail' and sql like '%card_money%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover_detail add column card_money decimal(24,2) DEFAULT 0;"
                            }
        }
    },
    "upgrade28":{
        "version":"0.0.2.15",
        "description":"交班明细表添加字段 sum_money",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover_detail' and sql like '%sum_money%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover_detail add column sum_money decimal(24,2) DEFAULT 0;"
                            }
        }
    },
    "upgrade29":{
        "version":"0.0.2.15",
        "description":"卡金变动统计视图 v_card_moneychange_forStatistics",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_card_moneychange_forStatistics;",
                            "line2":"CREATE VIEW v_card_moneychange_forStatistics AS ",
                            "line3":"select a.*,b.no as payTypeNo,b.name as payTypeName ",
                            "line4":"from card_moneychange a ",
                            "line5":"inner join (select * from food_pay_mode where no <> '06' and no <> '10' and no <> '11')b ",
                            "line6":"on a.payTypeId = b.id;"
                            }
        }
    },
    "upgrade30":{
        "version":"0.0.2.18",
        "description":"添加快捷键说明表 local_shortcut",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_shortcut';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE local_shortcut (",
                            "line2":"keyword  VARCHAR(32),",
                            "line3":"sequence INTEGER,",
                            "line4":"function VARCHAR(64),",
                            "line5":"shortcutKey  VARCHAR(32),",
                            "line6":"shortcutName  VARCHAR(128),",
                            "line7":"memo  VARCHAR(128)",
                            "line8":");"
                            },
                    "sql2":{
                            "line1":"delete from local_shortcut;"                            
                            },
                    "sql3":{
                            "line1":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',1,'做法','F2');",
                            "line2":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',2,'删菜','F3');",
                            "line3":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',3,'套菜','F4');",
                            "line4":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',4,'换菜','Ctrl+C');",
                            "line5":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',5,'赠送','F5');",
                            "line6":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',6,'优惠券','F11');",
                            "line7":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',7,'数量(+)','小键盘上的+键');",
                            "line8":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',8,'数量(-)','小键盘上的-键');",
                            "line9":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',9,'数量','小键盘上的*键');",
                            "line10":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',10,'高级功能','Ctrl+Q');",
                            "line11":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',11,'消单','Ctrl+X');",
                            "line12":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',12,'外卖电话','Ctrl+W');",
                            "line13":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',13,'点菜/已点菜切换','F12');",
                            "line14":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',14,'会员刷卡','F8');",
                            "line15":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',15,'代金券','F7');",
                            "line16":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',16,'其它付款','F6');",
                            "line17":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',17,'结账/收银','F9');",
                            "line18":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',18,'餐桌','Ctrl+T');",
                            "line19":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',19,'外卖','Ctrl+R');",
                            "line20":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',20,'外卖送餐','Ctrl+S');",
                            "line21":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',21,'外卖交单','Ctrl+D');",
                            "line22":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',22,'营业单据','Ctrl+F');",
                            "line23":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',23,'经理管理','Ctrl+A');",
                            "line24":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',24,'转到点菜框','Insert');",
                            "line25":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0001',25,'注销','ESC');",
                            "line26":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0002',1,'做法数量加','小键盘上的+键');",
                            "line27":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0002',2,'做法删除','小键盘上的-键');",
                            "line28":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0002',3,'做法确认','小键盘上的/键');",
                            "line29":"INSERT INTO local_shortcut(keyword,sequence,function,shortcutName)values('0002',4,'返回','ESC');"
                            }
        }
    },
    "upgrade31":{
        "version":"0.0.2.19",
        "description":"整单退菜没有上传，更新标识，重新上传",
        "scripts":{ 
                    "sql1":{
                            "line1":"update food_business_ticket set upflag = 0 where status = 1 and amount < 0 and upflag = 1;"
                            }
        }
    },
    "upgrade32":{
        "version":"0.0.2.30",
        "description":"菜品表添加字段 unitId",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_dish' and sql like '%unitId%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_dish add column unitId VARCHAR(32);"
                            }
        }
    },
    "upgrade33":{
        "version":"0.0.2.30",
        "description":"菜品规格表添加字段 dishUnitId",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_dish_spec' and sql like '%dishUnitId%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_dish_spec add column dishUnitId VARCHAR(32);"
                            }
        }
    },
    "upgrade34":{
        "version":"0.0.2.31",
        "description":"套菜明细表添加字段 unitId",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_dish_suit_detail' and sql like '%unitId%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_dish_suit_detail add column unitId VARCHAR(32);"
                            }
        }
    },    
    "upgrade35":{
        "version":"0.0.2.31",
        "description":"销售明细表添加字段 dishUnitId",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_order_dish' and sql like '%dishUnitId%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_order_dish add column dishUnitId VARCHAR(32);"
                            }
        }
    },
    "upgrade36":{
        "version":"0.0.2.31",
        "description":"挂单明细表添加字段 dishUnitId",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%dishUnitId%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_dish add column dishUnitId VARCHAR(32);"
                            }
        }
    },
    "upgrade37":{
        "version":"0.0.2.32",
        "description":"添加供应商信息表 cy_supplier",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='cy_supplier';",
        "scripts":{
                    "sql1":{
                            "line1": "CREATE TABLE cy_supplier",
                            "line2":"(",
                            "line3":"id                   varchar(32) not null,",
                            "line4":"no                   varchar(16) not null,",
                            "line5":"name                 varchar(32) not null,",
                            "line6":"shortName            varchar(32),",
                            "line7":"enterpriseNature     varchar(128),",
                            "line8":"address              varchar(128),",
                            "line9":"linkMan              varchar(32) not null,",
                            "line10":"mobile               varchar(16) not null,",
                            "line11":"fax                  varchar(16),",
                            "line12":"code                 varchar(16),",
                            "line13":"email                varchar(16),",
                            "line14":"depositBank          varchar(32),",
                            "line15":"reputationLevel      varchar(32),",
                            "line16":"bankAccount          varchar(32),",
                            "line17":"registerDate         datetime,",
                            "line18":"description          varchar(128),",
                            "line19":"primary key (id)",
                            "line20":");"
                            }
        }
    },
    "upgrade38":{
        "version":"0.0.2.32",
        "description":"添加原料大类信息表 cy_material_series",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='cy_material_series';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE cy_material_series",
                            "line2":"(",
                            "line3":"id                   varchar(32) not null,",
                            "line4":"no                   varchar(16) not null,",
                            "line5":"name                 varchar(32) not null,",
                            "line6":"primary key (id)",
                            "line7":");"
                            }
        }
    },
    "upgrade39":{
        "version":"0.0.2.32",
        "description":"添加原料分类信息表 cy_material_type",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='cy_material_type';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE cy_material_type",
                            "line2":"(",
                            "line3":"id                   varchar(32) not null,",
                            "line4":"no                   varchar(16) not null,",
                            "line5":"parentId             varchar(32) not null,",
                            "line6":"name                 varchar(32) not null,",
                            "line7":"primary key (id)",
                            "line8":");"
                            }
        }
    },
    "upgrade40":{
        "version":"0.0.2.32",
        "description":"添加原料基本信息表 cy_material_detail",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='cy_material_detail';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE cy_material_detail",
                            "line2":"(",
                            "line3":"id                   varchar(32) not null,",
                            "line4":"seriesId             varchar(32) not null,",
                            "line5":"typeId               varchar(32) not null,",
                            "line6":"no                   varchar(16) not null,",
                            "line7":"name                 varchar(32) not null,",
                            "line8":"spell                varchar(64),",
                            "line9":"spec                 varchar(32),",
                            "line10":"stockUnit            varchar(32) not null,",
                            "line11":"stockUnitName        varchar(32),",
                            "line12":"purchaseUnit         varchar(32),",
                            "line13":"purchaseUnitName     varchar(32),",
                            "line14":"spScale              decimal(24,2) not null,",
                            "line15":"recipeUnit           varchar(32) not null,",
                            "line16":"recipeUnitName       varchar(32),",
                            "line17":"srScale              decimal(24,2) not null,",
                            "line18":"stopFlag             integer comment '0是停用、1是启用',",
                            "line19":"storeDownFlag        integer comment '0是不下传、1是下传',",
                            "line20":"storePurchFlag       integer comment '0是不能自采、1是可以自采',",
                            "line21":"purchDirectFlag      integer comment '0是不能采购直拨、1是可以',",
                            "line22":"processedGoodFlag    integer comment '0不是加工品、1是加工品',",
                            "line23":"plannedProductionFlag integer comment '0不勾选、1勾选',",
                            "line24":"amountFlag           integer comment '0不勾选、1勾选',",
                            "line25":"estimatedGoodFlag    integer comment '0不勾选、1勾选',",
                            "line26":"stockUpper           decimal(24,2),",
                            "line27":"stockLower           decimal(24,2),",
                            "line28":"storeOffsetFlag      integer comment '0不冲减、1冲减',",
                            "line29":"primary key (id)",
                            "line30":");"
                            }
        }
    },
    "upgrade41":{
        "version":"0.0.2.32",
        "description":"添加数据下载表 cy_supplier",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='storestock.getSupplierList';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values('29','storestock.getSupplierList','cy_supplier','supplierlist');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values('29','storeId',null);"
                            }
        }
    },
    "upgrade42":{
        "version":"0.0.2.32",
        "description":"添加数据下载表 cy_material_series",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='storestock.getMaterialSeries';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values('30','storestock.getMaterialSeries','cy_material_series','serieslist');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values('30','storeId',null);"
                            }
        }
    },
    "upgrade43":{
        "version":"0.0.2.32",
        "description":"添加数据下载表 cy_material_type",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='storestock.getMaterialType';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values('31','storestock.getMaterialType','cy_material_type','typelist');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values('31','storeId',null);"
                            }
        }
    },
    "upgrade44":{
        "version":"0.0.2.32",
        "description":"添加数据下载表 cy_material_detail",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='storestock.getMaterialDetail';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values('32','storestock.getMaterialDetail','cy_material_detail','detaillist');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values('32','storeId',null);"
                            }
        }
    },
    "upgrade45":{
        "version":"0.0.2.33",
        "description":"厨打方案表添加字段 produeceDepId",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='cy_kit_printer_plan' and sql like '%produeceDepId%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table cy_kit_printer_plan add column produeceDepId VARCHAR(32);"
                            }
        }
    },
    "upgrade46":{
        "version":"0.0.2.33",
        "description":"销售明细表添加字段 produeceDepId",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_order_dish' and sql like '%produeceDepId%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_order_dish add column produeceDepId VARCHAR(32);"
                            }
        }
    },
    "upgrade47":{
        "version":"0.0.2.33",
        "description":"挂单明细表添加字段 produeceDepId",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%produeceDepId%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_dish add column produeceDepId VARCHAR(32);"
                            }
        }
    },
    "upgrade48":{
        "version":"0.0.2.33",
        "description":"修改点菜时用于取基本信息的菜品视图 v_food_dish_forlocate",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_food_dish_forlocate;",
                            "line2":"CREATE VIEW v_food_dish_forlocate AS ",
                            "line3":"select a.*,b.[name] typename,c.[no] chudano,c.[name] chudaname, c.[produeceDepId] produeceDepId ",
                            "line4":"from food_dish a ",
                            "line5":"inner join  food_dish_type b on a.[typeId] = b.[id] ",
                            "line6":"left join cy_kit_printer_plan c on a.[chuda] = c.[id]  ",
                            "line7":"where a.[seriesId] <> '0';"
                            }
        }
    },
    "upgrade49":{
        "version":"0.0.2.35",
        "description":"系统设置 14小时限制改为20小时",
        "scripts":{ 
                    "sql1":{
                            "line1":"update local_sys_parameter set parameterValue = 20 where parameterKey = 'dayAccount_hoursMax';"
                            }
        }
    },
    "upgrade50":{
        "version":"0.0.2.36",
        "description":"供应商表添加字段 cy_supplier",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='cy_supplier' and sql like '%status%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table cy_supplier add column status Integer;"
                            }
        }
    },
    "upgrade51":{
        "version":"0.0.2.37",
        "description":"添加门店部门信息表 cy_store_department",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='cy_store_department';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE cy_store_department",
                            "line2":"(",
                            "line3":"id                   varchar(32) not null,",
                            "line4":"storeId              varchar(32) not null,",
                            "line5":"no                   varchar(16) not null,",
                            "line6":"name                 varchar(32) not null,",
                            "line7":"parentId             varchar(32),",
                            "line8":"enabled              integer,",
                            "line9":"description          varchar(256),",
                            "line10":"primary key (id)",
                            "line11":");"
                            }
        }
    },
    "upgrade52":{
        "version":"0.0.2.37",
        "description":"添加数据下载表 cy_store_department",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='storestock.getStoreDepartment';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values('33','storestock.getStoreDepartment','cy_store_department','list');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values('33','storeId',null);"
                            }
        }
    },
    "upgrade53":{
        "version":"0.0.2.40",
        "description":"添加视图 v_cy_store_department",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_cy_store_department;",
                            "line2":"CREATE VIEW v_cy_store_department AS ",
                            "line3":"select * from ",
                            "line4":"(",
                            "line5":"select '0' as id,'0' as storeId,'0' as no,'大库' as name,'' as parentId,1 as enabled, '门店大库' as description ",
                            "line6":"union all ",
                            "line7":"select id,storeId,no,name,parentId,enabled,description from cy_store_department",
                            "line8":");"
                            }
        }
    },
    "upgrade54":{
        "version":"0.0.2.40",
        "description":"添加参数设置 录入设备类型",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='common_inputDevice_Type';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('common_inputDevice_Type','1','录入设备类型','1 触屏 2 鼠标键盘');"
                            }
        }
    },
    "upgrade55":{
        "version":"0.0.2.41",
        "description":"添加参数设置 是否展示菜牌(重启生效)",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='common_caipai_visible';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('common_caipai_visible','1','是否展示菜牌(重启生效)','0 不展示 1 展示');"
                            }
        }
    },
    "upgrade56":{
        "version":"0.0.2.41",
        "description":"添加参数设置 菜品排序方式设置",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='common_dish_displayOrder';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('common_dish_displayOrder','菜品编码','菜品排序方式设置(重启生效)','3种:菜品价格/菜品编码/菜品名称');"
                            }
        }
    },
    "upgrade57":{
        "version":"0.0.2.42",
        "description":"添加参数设置 称重顺序",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='orderDish_weighMode_order';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('orderDish_weighMode_order','1','称重顺序(重启生效)','1 先称重 2 先点菜');"
                            }
        }
    },
    "upgrade58":{
        "version":"0.0.2.47",
        "description":"销售明细表添加字段 sameNo",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_order_dish' and sql like '%sameNo%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_order_dish add column sameNo VARCHAR(32);"
                            }
        }
    },
    "upgrade59":{
        "version":"0.0.2.47",
        "description":"销售明细表添加字段 isRback",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_order_dish' and sql like '%isRback%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_order_dish add column isRback INTEGER DEFAULT 0;"
                            }
        }
    },
    "upgrade60":{
        "version":"0.0.2.47",
        "description":"添加外送表 food_store_take_out",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_store_take_out';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE food_store_take_out",
                            "line2":"(",
                            "line3":"id VARCHAR(32),",
                            "line4":"storeId VARCHAR(32),",
                            "line5":"no VARCHAR(64),",
                            "line6":"status INTEGER,",
                            "line7":"dPeople VARCHAR(32),",
                            "line8":"dPhone VARCHAR(32),",
                            "line9":"dAddress VARCHAR(64),",
                            "line10":"saleTime VARCHAR(32),",
                            "line11":"sendTime VARCHAR(32),",
                            "line12":"returnTime VARCHAR(32),",
                            "line13":"sWorkerNo VARCHAR(32),",
                            "line14":"yMoney decimal(24,2) DEFAULT 0,",
                            "line15":"yCost decimal(24,2) DEFAULT 0,",
                            "line16":"upflag INTEGER,",
                            "line17":"content VARCHAR(64)",
                            "line18":");"
                            }
        }
    },
    "upgrade61":{
        "version":"0.0.2.47",
        "description":"交班明细表添加字段 handsMoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover_detail' and sql like '%handsMoney%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover_detail add column handsMoney decimal(24,2) DEFAULT 0;",
                            "line2":"update local_handover_detail set handsMoney = sum_money;"
                            }
        }
    },
    "upgrade62":{
        "version":"0.0.2.47",
        "description":"添加视图 v_food_store_take_out",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_food_store_take_out;",
                            "line2" :"CREATE VIEW v_food_store_take_out AS ",
                            "line3" :"select a.id,a.storeId,a.no,a.status,a.dPeople,a.dPhone,a.dAddress,",
                            "line4" :"a.saleTime,a.sendTime,a.returnTime,a.sWorkerNo,a.yMoney,a.yCost,",
                            "line5" :"a.upflag,a.content,",
                            "line6" :"b.posNo,b.paid,b.status as ticketStatus,",
                            "line7" :"c.name as sWorkerNoName ",
                            "line8" :"from food_store_take_out a ",
                            "line9" :"inner join food_business_ticket b on a.storeId = b.storeId and a.no = b.no ",
                            "line10":"left join food_store_worker c on a.storeId = c.storeId and a.sWorkerNo = c.no;"
                            }
        }
    },
    "upgrade63":{
        "version":"0.0.2.47",
        "description":"添加视图 v_food_order_dish",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_food_order_dish;",
                            "line2" :"CREATE VIEW v_food_order_dish AS ",
                            "line3" :"select a.id,a.storeId,a.busNo,a.tableNo,a.sequenceNo,a.dishId,a.dishNo,a.dishName,a.specId,a.specName,a.count,",
                            "line4" :"a.rcount,a.price,a.priceOrg,a.addPrice,a.discount,a.memberno,a.dzType,",
                            "line5" :"a.isSuit,case when a.isSuit = 2 then 1 else 0 end as suitFlag,",
                            "line6" :"a.suitId,a.isSpecial,",
                            "line7" :"a.isCoupon,a.isGive,a.workerNo,a.saleDate,a.deviceName,a.saveFlag,a.parentSequenceNo,a.upflag,",
                            "line8" :"a.payStatus,a.suitItemNo,a.priceAddSuit,a.money,a.hand,a.ownerDishId,a.ownerSpecId,a.isSpecialMember,",
                            "line9" :"a.moneyActual,a.sameNo,a.isRback,",
                            "line10":"b.name as workerName ",
                            "line11":"from food_order_dish a ",
                            "line12":"left join food_store_worker b on a.storeId = b.storeId and a.workerNo = b.no;"
                            }
        }
    },
    "upgrade64":{
        "version":"0.0.2.48",
        "description":"修改视图 v_yydj_query_dish",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_yydj_query_dish;",
                            "line2" :"CREATE VIEW v_yydj_query_dish AS ",
                            "line3" :"select id,storeId,busNo,tableNo,sequenceNo,dishId,dishNo,dishName,specId,specName,count,",
                            "line4" :"rcount,price,priceOrg,addPrice,discount,memberno,dzType,",
                            "line5" :"isSuit,case when isSuit = 2 then 1 else 0 end as suitFlag,",
                            "line6" :"suitId,isSpecial,",
                            "line7" :"isCoupon,isGive,workerNo,saleDate,deviceName,saveFlag,parentSequenceNo,upflag,",
                            "line8" :"payStatus,suitItemNo,priceAddSuit,money,hand,ownerDishId,ownerSpecId,isSpecialMember,",
                            "line9" :"moneyActual,sameNo,isRback ",
                            "line10":"from food_order_dish;"
                            }
        }
    },
    "upgrade65":{
        "version":"0.0.2.48",
        "description":"添加参数设置 交班模式",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='settleAccount_handover_mode';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('settleAccount_handover_mode','1','交班模式','1 正常 2 扩展');"
                            }
        }
    },
    "upgrade66":{
        "version":"0.0.2.50",
        "description":"添加门店员工折扣权限表 cy_worker_discount",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='cy_worker_discount';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE cy_worker_discount (",
                            "line2":"workerId  VARCHAR(32) NOT NULL,",
                            "line3":"discount  decimal(24,2)",
                            "line4":");"
                            }
        }
    },
    "upgrade67":{
        "version":"0.0.2.50",
        "description":"添加数据下载表 cy_worker_discount",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='store.getWorkerDiscount';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values('34','store.getWorkerDiscount','cy_worker_discount','workerdiscount');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values('34','storeId',null);"
                            }
        }
    },
    "upgrade68":{
        "version":"0.0.2.51",
        "description":"添加参数设置 会员卡默认密码",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='card_default_password';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('card_default_password','','会员卡默认密码','');"
                            }
        }
    },
    "upgrade69":{
        "version":"0.0.2.52",
        "description":"修改视图 v_food_business_ticket_pay",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_food_business_ticket_pay;",
                            "line2" :"CREATE VIEW v_food_business_ticket_pay AS ",
                            "line3" :"select a.storeId,",
                            "line4" :"a.busNo,",
                            "line5" :"a.payNo,",
                            "line6" :"sum(case when b.no = '10' then a.money else 0 end) free,",
                            "line7" :"sum(case when b.no = '01' then a.money else 0 end) cash,",
                            "line8" :"sum(case when b.no = '06' then a.money else 0 end) ignoreDecimals,",
                            "line9" :"sum(case when b.no = '02' then a.money else 0 end) credit,",
                            "line10":"sum(case when b.no = '03' then a.money else 0 end) card,",
                            "line11":"sum(case when b.no not in ('10','01','06','02','03') then a.money else 0 end) other,",
                            "line12":"sum(case when b.incomeFlag = 1 then a.money else 0 end) realMoney,",
                            "line13":"sum(case when b.incomeFlag = 0 then a.money else 0 end) virtualMoney,",
                            "line14":"sum(case when b.typeNo = '01' then a.change else 0 end) oddChange,",
                            "line15":"sum(a.moneyDiscount) pay_discount,",
                            "line16":"sum(case when b.no = '11' then a.money else 0 end) run,",
                            "line17":"sum(case when b.incomeFlag = 1 and b.no <> '06' then a.money else 0 end) jbRealMoney ",
                            "line18":"from food_store_pay a inner join v_food_pay_mode_type b ",
                            "line19":"on a.payTypeId = b.id ",
                            "line20":"group by a.storeId,a.busNo,a.payNo;"
                            }
        }
    },
    "upgrade70":{
        "version":"0.0.2.52",
        "description":"修改视图 v_yydj_query_ticket",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_yydj_query_ticket;",
                            "line2" :"CREATE VIEW v_yydj_query_ticket AS ",
                            "line3" :"SELECT a.storeId,",
                            "line4" :"b.payNo,",
                            "line5" :"a.no,",
                            "line6" :"a.tableId,",
                            "line7" :"a.tableNo,",
                            "line8" :"a.handNo,",
                            "line9" :"case when a.status in (0,1,5) then a.amount else 0 end amount,",
                            "line10":"case when a.status in (0,1,5) then b.free else 0 end free,",
                            "line11":"case when a.status in (0,1,5) then a.discount else 0 end discount,",
                            "line12":"case when a.status in (0,1,5) then a.give else 0 end give,",
                            "line13":"a.status,",
                            "line14":"a.workNo,",
                            "line15":"a.cancelNo,",
                            "line16":"a.cancelDate,",
                            "line17":"a.deviceName,",
                            "line18":"a.busMode,",
                            "line19":"a.busType,",
                            "line20":"b.pay_discount,",
                            "line21":"case when a.status in (0,1,5) then b.cash else 0 end cash,",
                            "line22":"case when a.status in (0,1,5) then b.ignoreDecimals else 0 end ignoreDecimals,",
                            "line23":"case when a.status in (0,1,5) then b.credit else 0 end credit,",
                            "line24":"case when a.status in (0,1,5) then b.card else 0 end card,",
                            "line25":"case when a.status in (0,1,5) then b.other else 0 end other,",
                            "line26":"case when a.status in (0,1,5) then saleDate else '' end as operdate,",
                            "line27":"a.people,",
                            "line28":"a.saleDate as kdDate,",
                            "line29":"0 as duration,",
                            "line30":"case when a.status in (0,1,5) then a.amount - a.discount - a.give else 0 end ys,",
                            "line31":"b.realMoney,",
                            "line32":"b.virtualMoney,",
                            "line33":"b.oddChange,",
                            "line34":"a.posNo,",
                            "line35":"case when a.status in (0,1,5) then b.run else 0 end run,",
                            "line36":"a.saleDate,",
                            "line37":"b.jbRealMoney ",
                            "line38":"FROM food_business_ticket a inner join v_food_business_ticket_pay b ",
                            "line39":"on a.storeId = b.storeId and a.no = b.busNo;"
                            }
        }
    },
    "upgrade71":{
        "version":"0.0.2.53",
        "description":"挂单明细表添加字段 isEvenOriginal",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%isEvenOriginal%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_dish add column isEvenOriginal INTEGER default 0;"
                            }
        }
    },
    "upgrade72":{
        "version":"0.0.2.53",
        "description":"销售主表添加字段 duplicate",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_business_ticket' and sql like '%duplicate%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_business_ticket add column duplicate INTEGER DEFAULT 0;"},
                    "sql2":{"line1":"update food_business_ticket set duplicate = upflag;"}
        }
    },
    "upgrade73":{
        "version":"0.0.2.56",
        "description":"菜品表添加字段 english 英文名称",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_dish' and sql like '%english%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_dish add column english VARCHAR(64);"
                            }
        }
    },
    "upgrade74":{
        "version":"0.0.2.56",
        "description":"挂单明细表添加字段 english 英文名称",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%english%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_dish add column english VARCHAR(64);"
                            }
        }
    },
    "upgrade75":{
        "version":"0.0.2.56",
        "description":"营业单据支付视图_扩展 v_yydj_query_dish_ex",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_yydj_query_dish_ex;",
                            "line2":"CREATE VIEW v_yydj_query_dish_ex AS ",
                            "line3":"select a.id,a.storeId,a.busNo,a.tableNo,a.sequenceNo,a.dishId,a.dishNo,a.dishName,a.specId,a.specName,a.count,",
                            "line4":"a.rcount,a.price,a.priceOrg,a.addPrice,a.discount,a.memberno,a.dzType,",
                            "line5":"a.isSuit,case when a.isSuit = 2 then 1 else 0 end as suitFlag,",
                            "line6":"a.suitId,a.isSpecial,",
                            "line7":"a.isCoupon,a.isGive,a.workerNo,a.saleDate,a.deviceName,a.saveFlag,a.parentSequenceNo,a.upflag,",
                            "line8":"a.payStatus,a.suitItemNo,a.priceAddSuit,a.money,a.hand,a.ownerDishId,a.ownerSpecId,a.isSpecialMember,",
                            "line9":"a.moneyActual,a.sameNo,a.isRback,",
                            "line10":"coalesce(b.istaple,0) istaple,coalesce(b.english,'') english ",
                            "line11":"from food_order_dish a left join food_dish b ",
                            "line12":"on a.dishId = b.id;"
                            }
        }
    },
    "upgrade76":{
        "version":"0.0.2.57",
        "description":"维护变动的快捷方式信息",
        "scripts":{
                    "sql1":{
                            "line1":"update local_shortcut set function = '库存管理' where keyword = '0001' and sequence = '12';",
                            "line2":"update local_shortcut set function = '挂单' where keyword = '0001' and sequence = '19';",
                            "line3":"update local_shortcut set function = '交班' where keyword = '0001' and sequence = '20';",
                            "line4":"update local_shortcut set function = '卡务' where keyword = '0001' and sequence = '21';",
                            "line5":"update local_shortcut set function = '外送' where keyword = '0001' and sequence = '22';"
                            }
        }
    },
    "upgrade77":{
        "version":"0.0.2.57",
        "description":"清除无法上传的问题销售数据",
        "precondition":"select case when count(1) > 0 then 1 else 0 end from food_order_dish where (dishId is null or dishId = '') and upflag = 0;",
        "scripts":{
                    "sql1":{"line1":"delete from food_business_ticket ",
                            "line2":"where upflag = 0 and exists(",
                            "line3":"select 1 ",
                            "line4":"from food_order_dish ",
                            "line5":"where (food_order_dish.dishId is null or food_order_dish.dishId = '') ",
                            "line6":"and food_order_dish.upflag = 0 ",
                            "line7":"and food_business_ticket.storeId = food_order_dish.storeId ",
                            "line8":"and food_business_ticket.no = food_order_dish.busNo",
                            "line9":");"
                            },
                    "sql2":{"line1":"delete from food_store_pay ",
                            "line2":"where upflag = 0 and exists(",
                            "line3":"select 1 ",
                            "line4":"from food_order_dish ",
                            "line5":"where (food_order_dish.dishId is null or food_order_dish.dishId = '') ",
                            "line6":"and food_order_dish.upflag = 0 ",
                            "line7":"and food_store_pay.storeId = food_order_dish.storeId ",
                            "line8":"and food_store_pay.busNo = food_order_dish.busNo",
                            "line9":");"
                            },
                    "sql3":{"line1":"delete from food_order_dish_make ",
                            "line2":"where upflag = 0 and exists(",
                            "line3":"select 1 ",
                            "line4":"from food_order_dish ",
                            "line5":"where (food_order_dish.dishId is null or food_order_dish.dishId = '') ",
                            "line6":"and food_order_dish.upflag = 0 ",
                            "line7":"and food_order_dish_make.storeId = food_order_dish.storeId ",
                            "line8":"and food_order_dish_make.busNo = food_order_dish.busNo",
                            "line9":");"
                            },
                    "sql4":{"line1":"delete from food_store_take_out ",
                            "line2":"where upflag = 0 and exists(",
                            "line3":"select 1 ",
                            "line4":"from food_order_dish ",
                            "line5":"where (food_order_dish.dishId is null or food_order_dish.dishId = '') ",
                            "line6":"and food_order_dish.upflag = 0 ",
                            "line7":"and food_store_take_out.storeId = food_order_dish.storeId ",
                            "line8":"and food_store_take_out.no = food_order_dish.busNo",
                            "line9":");"
                            },
                    "sql5":{"line1":"delete from food_order_dish where (dishId is null or dishId = '') and upflag = 0;"}
        }
    },
    "upgrade78":{
        "version":"0.0.2.58",
        "description":"菜品表添加字段 chupinFlag 是否出品打印 0否1是",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_dish' and sql like '%chupinFlag%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_dish add column chupinFlag INTEGER default 0;"
                            }
        }
    },
    "upgrade79":{
        "version":"0.0.2.58",
        "description":"菜品表添加字段 chupin 出品打印方案",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_dish' and sql like '%chupin%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_dish add column chupin VARCHAR(32);"
                            }
        }
    },
    "upgrade80":{
        "version":"0.0.2.58",
        "description":"修改点菜时用于取基本信息的菜品视图 v_food_dish_forlocate",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_food_dish_forlocate;",
                            "line2" :"CREATE VIEW v_food_dish_forlocate AS ",
                            "line3" :"select a.*,",
                            "line4" :"b.[name] typename,",
                            "line5" :"c.[no] chudano,c.[name] chudaname, c.[produeceDepId] produeceDepId,",
                            "line6" :"d.[no] chupinno,d.[name] chupinname ",
                            "line7" :"from food_dish a ",
                            "line8" :"inner join food_dish_type b on a.[typeId] = b.[id] ",
                            "line9" :"left join cy_kit_printer_plan c on a.[chuda] = c.[id] ",
                            "line10":"left join cy_kit_printer_plan d on a.[chupin] = d.[id] ",
                            "line11":"where a.[seriesId] <> '0';"
                            }
        }
    },
    "upgrade81":{
        "version":"0.0.2.58",
        "description":"挂单表添加字段 chupinFlag",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%chupinFlag%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_dish add column chupinFlag INTEGER DEFAULT 0;"
                            }
        }
    },
    "upgrade82":{
        "version":"0.0.2.58",
        "description":"挂单表添加字段 chupinno",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%chupinno%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_dish add column chupinno VARCHAR(32);"
                            }
        }
    },
    "upgrade83":{
        "version":"0.0.2.58",
        "description":"挂单表添加字段 chupinname",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%chupinname%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_dish add column chupinname VARCHAR(32);"
                            }
        }
    },
    "upgrade84":{
        "version":"0.0.2.58",
        "description":"修改视图 v_food_order_dish_forStatistics",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_food_order_dish_forStatistics;",
                            "line2" :"CREATE VIEW v_food_order_dish_forStatistics AS ",
                            "line3" :"select a.storeId, a.posNo, a.status, a.saleDate,",
                            "line4" :"b.count, b.rcount, b.moneyActual, b.isSuit, b.isGive,",
                            "line5" :"c.no as dishNo, c.name as dishName,",
                            "line6" :"d.no as typeNo, d.name as typeName,",
                            "line7" :"e.no as seriesNo, e.name as seriesName,",
                            "line8" :"case when coalesce(c.isweigh,0) = 1 then 1 else (count-rcount) end as count2 ",
                            "line9" :"from food_business_ticket a ",
                            "line10":"inner join food_order_dish b on a.storeid = b.storeid and a.no = b.busNo ",
                            "line11":"left join (select * from food_dish where seriesId <> '0')c on b.dishId = c.id ",
                            "line12":"left join (select * from food_dish_type where seriesId <> '0')d on c.typeId = d.id ",
                            "line13":"left join (select * from food_dish_series where id <> '0')e on c.seriesId = e.id ",
                            "line14":"where a.status in (0,1,5);"
                            }
        }
    },
    "upgrade85":{
        "version":"0.0.2.60",
        "description":"添加参数设置 开卡是否打印",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='cardbusiness_sale_print_flag';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('cardbusiness_sale_print_flag','1','开卡是否打印','0 不打印 1 打印');"
                            }
        }
    },
    "upgrade86":{
        "version":"0.0.2.60",
        "description":"添加参数设置 开卡打印份数",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='cardbusiness_sale_print_count';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('cardbusiness_sale_print_count','1','开卡打印份数','');"
                            }
        }
    },
    "upgrade87":{
        "version":"0.0.2.60",
        "description":"添加参数设置 充值是否打印",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='cardbusiness_recharge_print_flag';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('cardbusiness_recharge_print_flag','1','充值是否打印','0 不打印 1 打印');"
                            }
        }
    },
    "upgrade88":{
        "version":"0.0.2.60",
        "description":"添加参数设置 充值打印份数",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='cardbusiness_recharge_print_count';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('cardbusiness_recharge_print_count','1','充值打印份数','');"
                            }
        }
    },
    "upgrade89":{
        "version":"0.0.2.60",
        "description":"添加参数设置 会员信息修改是否打印",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='cardbusiness_update_print_flag';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('cardbusiness_update_print_flag','1','会员信息修改是否打印','0 不打印 1 打印');"
                            }
        }
    },
    "upgrade90":{
        "version":"0.0.2.60",
        "description":"添加参数设置 会员信息修改打印份数",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='cardbusiness_update_print_count';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('cardbusiness_update_print_count','1','会员信息修改打印份数','');"
                            }
        }
    },
    "upgrade91":{
        "version":"0.0.2.60",
        "description":"卡金变动表添加字段 PAYVOUCHERNO 支付凭证号",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='card_moneychange' and sql like '%PAYVOUCHERNO%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table card_moneychange add column PAYVOUCHERNO VARCHAR(64);"
                            }
        }
    },
    "upgrade92":{
        "version":"0.0.2.63",
        "description":"外送表food_store_take_out添加主键",
        "precondition":"select case when count(1)=1 then 1 else 0 end from sqlite_master where type='table' and name='food_store_take_out';",
        "scripts":{
                    "sql1":{"line1":"ALTER TABLE food_store_take_out RENAME TO _food_store_take_out_old_20160115;"},
                    "sql2":{"line1" :"CREATE TABLE food_store_take_out (",
                            "line2" :"id  VARCHAR(32),",
                            "line3" :"storeId  VARCHAR(32) NOT NULL,",
                            "line4" :"no  VARCHAR(64) NOT NULL,",
                            "line5" :"status  INTEGER,",
                            "line6" :"dPeople  VARCHAR(32),",
                            "line7" :"dPhone  VARCHAR(32),",
                            "line8" :"dAddress  VARCHAR(64),",
                            "line9" :"saleTime  VARCHAR(32),",
                            "line10":"sendTime  VARCHAR(32),",
                            "line11":"returnTime  VARCHAR(32),",
                            "line12":"sWorkerNo  VARCHAR(32),",
                            "line13":"yMoney  decimal(24,2) DEFAULT 0,",
                            "line14":"yCost  decimal(24,2) DEFAULT 0,",
                            "line15":"upflag  INTEGER,",
                            "line16":"content  VARCHAR(64),",
                            "line17":"PRIMARY KEY (storeId, no)",
                            "line18":");"
                            },
                    "sql3":{"line1":"INSERT INTO food_store_take_out ",
                            "line2":"(id, storeId, no, status, dPeople, dPhone, dAddress, saleTime, sendTime, returnTime, ",
                            "line3":"sWorkerNo, yMoney, yCost, upflag, content) ",
                            "line4":"SELECT id, storeId, no, status, dPeople, dPhone, dAddress, saleTime, sendTime, returnTime, ",
                            "line5":"sWorkerNo, yMoney, yCost, upflag, content ",
                            "line6":"FROM _food_store_take_out_old_20160115;"
                            },
                    "sql4":{"line1":"DROP TABLE _food_store_take_out_old_20160115;"}
        }
    },
    "upgrade93":{
        "version":"0.0.2.65",
        "description":"交班主表添加字段 card_giveMoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover' and sql like '%card_giveMoney%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover add column card_giveMoney decimal(24,2) DEFAULT 0;"
                            }
        }
    },
    "upgrade94":{
        "version":"0.0.2.65",
        "description":"交班主表添加字段 sum_virtualMoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover' and sql like '%sum_virtualMoney%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover add column sum_virtualMoney decimal(24,2) DEFAULT 0;"
                            }
        }
    },
    "upgrade95":{
        "version":"0.0.2.65",
        "description":"修改视图 v_food_business_ticket_pay",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_food_business_ticket_pay;",
                            "line2" :"CREATE VIEW v_food_business_ticket_pay AS ",
                            "line3" :"select a.storeId,",
                            "line4" :"a.busNo,",
                            "line5" :"a.payNo,",
                            "line6" :"sum(case when b.no = '10' then a.money else 0 end) free,",
                            "line7" :"sum(case when b.no = '01' then a.money else 0 end) cash,",
                            "line8" :"sum(case when b.no = '06' then a.money else 0 end) ignoreDecimals,",
                            "line9" :"sum(case when b.no = '02' then a.money else 0 end) credit,",
                            "line10":"sum(case when b.no = '03' then a.money else 0 end) card,",
                            "line11":"sum(case when b.no not in ('10','01','06','02','03') then a.money else 0 end) other,",
                            "line12":"sum(case when b.incomeFlag = 1 then a.money else 0 end) realMoney,",
                            "line13":"sum(case when b.incomeFlag = 0 then a.money else 0 end) virtualMoney,",
                            "line14":"sum(case when b.typeNo = '01' then a.change else 0 end) oddChange,",
                            "line15":"sum(a.moneyDiscount) pay_discount,",
                            "line16":"sum(case when b.no = '11' then a.money else 0 end) run,",
                            "line17":"sum(case when b.incomeFlag = 1 and b.no <> '06' then a.money else 0 end) jbRealMoney,",
                            "line18":"sum(case when b.incomeFlag = 0 and b.no <> '06' then a.money else 0 end) jbVirtualMoney ",
                            "line19":"from food_store_pay a inner join v_food_pay_mode_type b ",
                            "line20":"on a.payTypeId = b.id ",
                            "line21":"group by a.storeId,a.busNo,a.payNo;"
                            }
        }
    },
    "upgrade96":{
        "version":"0.0.2.65",
        "description":"修改视图 v_yydj_query_ticket",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_yydj_query_ticket;",
                            "line2" :"CREATE VIEW v_yydj_query_ticket AS ",
                            "line3" :"SELECT a.storeId,",
                            "line4" :"b.payNo,",
                            "line5" :"a.no,",
                            "line6" :"a.tableId,",
                            "line7" :"a.tableNo,",
                            "line8" :"a.handNo,",
                            "line9" :"case when a.status in (0,1,5) then a.amount else 0 end amount,",
                            "line10":"case when a.status in (0,1,5) then b.free else 0 end free,",
                            "line11":"case when a.status in (0,1,5) then a.discount else 0 end discount,",
                            "line12":"case when a.status in (0,1,5) then a.give else 0 end give,",
                            "line13":"a.status,",
                            "line14":"a.workNo,",
                            "line15":"a.cancelNo,",
                            "line16":"a.cancelDate,",
                            "line17":"a.deviceName,",
                            "line18":"a.busMode,",
                            "line19":"a.busType,",
                            "line20":"b.pay_discount,",
                            "line21":"case when a.status in (0,1,5) then b.cash else 0 end cash,",
                            "line22":"case when a.status in (0,1,5) then b.ignoreDecimals else 0 end ignoreDecimals,",
                            "line23":"case when a.status in (0,1,5) then b.credit else 0 end credit,",
                            "line24":"case when a.status in (0,1,5) then b.card else 0 end card,",
                            "line25":"case when a.status in (0,1,5) then b.other else 0 end other,",
                            "line26":"case when a.status in (0,1,5) then saleDate else '' end as operdate,",
                            "line27":"a.people,",
                            "line28":"a.saleDate as kdDate,",
                            "line29":"0 as duration,",
                            "line30":"case when a.status in (0,1,5) then a.amount - a.discount - a.give else 0 end ys,",
                            "line31":"b.realMoney,",
                            "line32":"b.virtualMoney,",
                            "line33":"b.oddChange,",
                            "line34":"a.posNo,",
                            "line35":"case when a.status in (0,1,5) then b.run else 0 end run,",
                            "line36":"a.saleDate,",
                            "line37":"b.jbRealMoney,",
                            "line38":"b.jbVirtualMoney ",
                            "line39":"FROM food_business_ticket a inner join v_food_business_ticket_pay b ",
                            "line40":"on a.storeId = b.storeId and a.no = b.busNo;"
                            }
        }
    },
    "upgrade97":{
        "version":"0.0.2.67",
        "description":"添加参数设置 不弹出密码输入窗口直接使用默认密码",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='card_default_password_withoutInput';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('card_default_password_withoutInput','0','不弹出密码输入窗口直接使用默认密码','0弹出密码窗口 1不弹出密码窗口');"
                            }
        }
    },
    "upgrade98":{
        "version":"0.0.2.69",
        "description":"修改视图 v_food_pay_mode_tmp",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_food_pay_mode_tmp;",
                            "line2":"CREATE VIEW v_food_pay_mode_tmp AS ",
                            "line3":"select a.id, a.no, a.name, a.typeId, a.frontFlag,",
                            "line4":"b.no as typeNo, b.name as typeName, b.sign as typeSign,",
                            "line5":"a.incomeFlag,a.pointFlag,",
                            "line6":"0.00 as amount ",
                            "line7":"from food_pay_mode a inner join food_pay_type b ",
                            "line8":"on a.typeId = b.id;"
                            }
        }
    },
    "upgrade99":{
        "version":"0.0.2.69",
        "description":"销售主表添加字段 memberCard",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_business_ticket' and sql like '%memberCard%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_business_ticket add column memberCard VARCHAR(32) default '';"}
        }
    },
    "upgrade100":{
        "version":"0.0.2.69",
        "description":"销售主表添加字段 memberJifen",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_business_ticket' and sql like '%memberJifen%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_business_ticket add column memberJifen decimal(24,2) default 0;"}
        }
    },
    "upgrade101":{
        "version":"0.0.2.69",
        "description":"销售主表添加字段 memberJfVoucherNo",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_business_ticket' and sql like '%memberJfVoucherNo%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_business_ticket add column memberJfVoucherNo VARCHAR(32) default '';"}
        }
    },
    "upgrade102":{
        "version":"0.0.2.69",
        "description":"修改视图 v_yydj_query_ticket",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_yydj_query_ticket;",
                            "line2" :"CREATE VIEW v_yydj_query_ticket AS ",
                            "line3" :"SELECT a.storeId,",
                            "line4" :"b.payNo,",
                            "line5" :"a.no,",
                            "line6" :"a.tableId,",
                            "line7" :"a.tableNo,",
                            "line8" :"a.handNo,",
                            "line9" :"case when a.status in (0,1,5) then a.amount else 0 end amount,",
                            "line10":"case when a.status in (0,1,5) then b.free else 0 end free,",
                            "line11":"case when a.status in (0,1,5) then a.discount else 0 end discount,",
                            "line12":"case when a.status in (0,1,5) then a.give else 0 end give,",
                            "line13":"a.status,",
                            "line14":"a.workNo,",
                            "line15":"a.cancelNo,",
                            "line16":"a.cancelDate,",
                            "line17":"a.deviceName,",
                            "line18":"a.busMode,",
                            "line19":"a.busType,",
                            "line20":"b.pay_discount,",
                            "line21":"case when a.status in (0,1,5) then b.cash else 0 end cash,",
                            "line22":"case when a.status in (0,1,5) then b.ignoreDecimals else 0 end ignoreDecimals,",
                            "line23":"case when a.status in (0,1,5) then b.credit else 0 end credit,",
                            "line24":"case when a.status in (0,1,5) then b.card else 0 end card,",
                            "line25":"case when a.status in (0,1,5) then b.other else 0 end other,",
                            "line26":"case when a.status in (0,1,5) then saleDate else '' end as operdate,",
                            "line27":"a.people,",
                            "line28":"a.saleDate as kdDate,",
                            "line29":"0 as duration,",
                            "line30":"case when a.status in (0,1,5) then a.amount - a.discount - a.give else 0 end ys,",
                            "line31":"b.realMoney,",
                            "line32":"b.virtualMoney,",
                            "line33":"b.oddChange,",
                            "line34":"a.posNo,",
                            "line35":"case when a.status in (0,1,5) then b.run else 0 end run,",
                            "line36":"a.saleDate,",
                            "line37":"b.jbRealMoney,",
                            "line38":"b.jbVirtualMoney,",
                            "line39":"a.memberCard,",
                            "line40":"a.memberJifen,",
                            "line41":"a.memberJfVoucherNo,",
                            "line42":"a.id ",
                            "line43":"FROM food_business_ticket a inner join v_food_business_ticket_pay b ",
                            "line44":"on a.storeId = b.storeId and a.no = b.busNo;"
                            }
        }
    },
    "upgrade103":{
        "version":"0.0.2.69",
        "description":"支付明细表添加字段 pointFlag",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_store_pay' and sql like '%pointFlag%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_store_pay add column pointFlag INTEGER DEFAULT 0;"},
                    "sql2":{
                            "line1":"update food_store_pay ",
                            "line2":"set pointFlag =(select pointFlag from food_pay_mode where food_pay_mode.id = food_store_pay.payTypeId) ",
                            "line3":"where exists(select 1 from food_pay_mode where food_pay_mode.id = food_store_pay.payTypeId);"
                            }
        }
    },
    "upgrade104":{
        "version":"0.0.2.69",
        "description":"修改视图 v_food_business_ticket_pay",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_food_business_ticket_pay;",
                            "line2" :"CREATE VIEW v_food_business_ticket_pay AS ",
                            "line3" :"select a.storeId,",
                            "line4" :"a.busNo,",
                            "line5" :"a.payNo,",
                            "line6" :"sum(case when b.no = '10' then a.money else 0 end) free,",
                            "line7" :"sum(case when b.no = '01' then a.money else 0 end) cash,",
                            "line8" :"sum(case when b.no = '06' then a.money else 0 end) ignoreDecimals,",
                            "line9" :"sum(case when b.no = '02' then a.money else 0 end) credit,",
                            "line10":"sum(case when b.no = '03' then a.money else 0 end) card,",
                            "line11":"sum(case when b.no not in ('10','01','06','02','03') then a.money else 0 end) other,",
                            "line12":"sum(case when a.virtual = 1 then a.money else 0 end) realMoney,",
                            "line13":"sum(case when a.virtual = 0 then a.money else 0 end) virtualMoney,",
                            "line14":"sum(case when b.typeNo = '01' then a.change else 0 end) oddChange,",
                            "line15":"sum(a.moneyDiscount) pay_discount,",
                            "line16":"sum(case when b.no = '11' then a.money else 0 end) run,",
                            "line17":"sum(case when a.virtual = 1 and b.no <> '06' then a.money else 0 end) jbRealMoney,",
                            "line18":"sum(case when a.virtual = 0 and b.no <> '06' then a.money else 0 end) jbVirtualMoney ",
                            "line19":"from food_store_pay a inner join v_food_pay_mode_type b ",
                            "line20":"on a.payTypeId = b.id ",
                            "line21":"group by a.storeId,a.busNo,a.payNo;"
                            }
        }
    },
    "upgrade105":{
        "version":"0.0.2.69",
        "description":"修改视图 v_yydj_query_pay",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_yydj_query_pay;",
                            "line2":"CREATE VIEW v_yydj_query_pay AS ",
                            "line3":"select id,storeId,payNo,busNo,tableId,tableNo,payTypeId,payType,money,paid,change,virtual,",
                            "line4":"workNo,deviceName,voucherNo,payDate,face,cardno,cardYe,cardJf,upflag,memo,",
                            "line5":"moneyDiscount,pointFlag ",
                            "line6":"from food_store_pay;"
                            }
        }
    },
    "upgrade106":{
        "version":"0.0.2.69",
        "description":"挂单表hang_pay添加字段 pointFlag",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_pay' and sql like '%pointFlag%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_pay add column pointFlag INTEGER DEFAULT 0;"
                            },
                    "sql2":{
                            "line1":"update hang_pay ",
                            "line2":"set pointFlag =(select pointFlag from food_pay_mode where food_pay_mode.id = hang_pay.payTypeId) ",
                            "line3":"where exists(select 1 from food_pay_mode where food_pay_mode.id = hang_pay.payTypeId);"
                            }
        }
    },
    "upgrade107":{
        "version":"0.0.2.69",
        "description":"挂单表 hang_pay_mode 添加字段 pointFlag",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_pay_mode' and sql like '%pointFlag%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table hang_pay_mode add column pointFlag INTEGER DEFAULT 0;"
                            },
                    "sql2":{
                            "line1":"update hang_pay_mode ",
                            "line2":"set pointFlag =(select pointFlag from food_pay_mode where food_pay_mode.no = hang_pay_mode.no) ",
                            "line3":"where exists(select 1 from food_pay_mode where food_pay_mode.no = hang_pay_mode.no);"
                            }
        }
    },
    "upgrade108":{
        "version":"0.0.2.69",
        "description":"添加卡务临时表 local_temp_card_pay",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_temp_card_pay';",
        "scripts":{
                    "sql1":{
                            "line1" :"CREATE TABLE local_temp_card_pay (",
                            "line2" :"id  VARCHAR(32) NOT NULL,",
                            "line3" :"tradeType  VARCHAR(32) NOT NULL,",
                            "line4" :"status  Integer NOT NULL,",
                            "line5" :"insertTime  VARCHAR(32) NOT NULL,",
                            "line6" :"batch  VARCHAR(32),",
                            "line7" :"serial  VARCHAR(32),",
                            "line8" :"unique_r  VARCHAR(64),",
                            "line9" :"money_r  decimal(24,2) DEFAULT 0,",
                            "line10":"money_bef  decimal(24,2) DEFAULT 0,",
                            "line11":"money_aft  decimal(24,2) DEFAULT 0,",
                            "line12":"jf_r  decimal(24,2) DEFAULT 0,",
                            "line13":"jf_bef  decimal(24,2) DEFAULT 0,",
                            "line14":"jf_aft  decimal(24,2) DEFAULT 0,",
                            "line15":"cardNo  VARCHAR(32),",
                            "line16":"PRIMARY KEY (id ASC)",
                            "line17":");"
                            }
        }
    },
    "upgrade109":{
        "version":"0.0.2.70",
        "description":"添加积分变动表 card_jfchange",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='card_jfchange';",
        "scripts":{
                    "sql1":{
                            "line1" :"create table card_jfchange (",
                            "line2" :"storeid  varchar(32),",
                            "line3" :"no  varchar(32),",
                            "line4" :"card  varchar(32),",
                            "line5" :"change_type  varchar(16),",
                            "line6" :"date  varchar(32),",
                            "line7" :"shop  varchar(16),",
                            "line8" :"posno  varchar(16),",
                            "line9" :"worker  varchar(16),",
                            "line10":"cardtype  varchar(32),",
                            "line11":"cardgrade  varchar(32),",
                            "line12":"name  varchar(16),",
                            "line13":"tel  varchar(32),",
                            "line14":"prejf  decimal(24,2),",
                            "line15":"change_jf  decimal(24,2),",
                            "line16":"aftjf  decimal(24,2),",
                            "line17":"memo  varchar(256)",
                            "line18":");"
                            }
        }
    },
    "upgrade110":{
        "version":"0.0.2.70",
        "description":"添加视图 v_card_jfchange",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_card_jfchange;",
                            "line2":"CREATE VIEW v_card_jfchange AS ",
                            "line3":"select storeid,no,",
                            "line4":"card,change_type,",
                            "line5":"date,shop,posno,worker,",
                            "line6":"cardtype,cardgrade,",
                            "line7":"name,tel,prejf,",
                            "line8":"case when change_type = '减分' then -1 * change_jf ",
                            "line9":"     when change_type = '加分' then change_jf ",
                            "line10":"end change_jf,",
                            "line11":"aftjf,memo",
                            "line12":"from card_jfchange;"
                            }
        }
    },
    "upgrade111":{
        "version":"0.0.2.73",
        "description":"交班主表添加字段 imprest",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover' and sql like '%imprest%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover add column imprest decimal(24,2) DEFAULT 0;"
                            }
        }
    },
    "upgrade112":{
        "version":"0.0.2.73",
        "description":"添加操作员日志表 local_imprest",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_imprest';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE local_imprest (",
                            "line2":"storeId  VARCHAR(32),",
                            "line3":"workId  VARCHAR(32) NOT NULL,",
                            "line4":"imprest  decimal(24,2),",
                            "line5":"inputDate  VARCHAR(32),",
                            "line6":"memo  VARCHAR(128),",
                            "line7":"PRIMARY KEY (workId)",
                            "line8":");"
                            }
        }
    },
    "upgrade113":{
        "version":"0.0.2.76",
        "description":"在消费相关表的单号字段上添加索引",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type = 'index' and tbl_name = 'food_business_ticket' and name = 'food_business_ticket_no';",
        "scripts":{
                    "sql1":{"line1":"CREATE INDEX food_business_ticket_no ON food_business_ticket (no ASC);"},
                    "sql2":{"line1":"CREATE INDEX food_order_dish_no ON food_order_dish (busNo ASC);"},
                    "sql3":{"line1":"CREATE INDEX food_order_dish_make_no ON food_order_dish_make (busNo ASC);"},
                    "sql4":{"line1":"CREATE INDEX food_store_pay_no ON food_store_pay (busNo ASC);"},
                    "sql5":{"line1":"CREATE INDEX food_store_take_out_no ON food_store_take_out (no ASC);"}
        }
    },
    "upgrade114":{
        "version":"0.0.2.79",
        "description":"添加参数设置 会员版本",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='card_version';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('card_version','1','会员版本','1-V1稳定版 2-V2稳定版');"
                            }
        }
    },
    "upgrade115":{
        "version":"0.0.2.79",
        "description":"添加参数设置 读卡类型",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='card_inputMode';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('card_inputMode','1','读卡类型','1-射频读卡(M1) 2-电子卡 3-磁条读卡(磁条)');"
                            }
        }
    },
    "upgrade116":{
        "version":"0.0.2.79",
        "description":"添加参数设置 做法选择模式",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='orderDish_makeChooseMode';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('orderDish_makeChooseMode','1','做法选择模式','1 正常 2 扩展');"
                            }
        }
    },
    "upgrade117":{
        "version":"0.0.2.81",
        "description":"销售主表添加字段 kdsUpFlag",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_business_ticket' and sql like '%kdsUpFlag%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_business_ticket add column kdsUpFlag INTEGER DEFAULT 0;"},
                    "sql2":{"line1":"update food_business_ticket set kdsUpFlag = 1;"}
        }
    },
    "upgrade118":{
        "version":"0.0.2.81",
        "description":"销售主表添加字段 kdsGlobalOrder",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_business_ticket' and sql like '%kdsGlobalOrder%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_business_ticket add column kdsGlobalOrder INTEGER DEFAULT 0;"}
        }
    },
    "upgrade119":{
        "version":"0.0.2.82",
        "description":"添加参数设置 pos名称",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='common_posName';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('common_posName','','pos名称','本地设置的用于打印、显示的pos名称');"
                            }
        }
    },
    "upgrade120":{
        "version":"0.0.2.84",
        "description":"添加非营业收入支出登记表 food_store_cost_revenue",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_store_cost_revenue';",
        "scripts":{
                    "sql1":{
                            "line1" :"CREATE TABLE food_store_cost_revenue (",
                            "line2" :"id VARCHAR(64) NOT NULL,",
                            "line3" :"storeId VARCHAR(32),",
                            "line4" :"name VARCHAR(64),",
                            "line5" :"money decimal(24,2),",
                            "line6" :"type INTEGER,",
                            "line7" :"description varchar(64),",
                            "line8" :"workerNo varchar(32),",
                            "line9" :"duplicate INTEGER DEFAULT 0,",
                            "line10":"upflag Integer,",
                            "line11":"createDate VARCHAR(64),",
                            "line12":"PRIMARY KEY (id)",
                            "line13":");"
                            }
        }
    },
    "upgrade121":{
        "version":"0.0.2.84",
        "description":"交班主表添加字段 inmoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover' and sql like '%inmoney%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover add column inmoney decimal(24,2) DEFAULT 0;"
                            }
        }
    },
    "upgrade122":{
        "version":"0.0.2.84",
        "description":"交班主表添加字段 outmoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover' and sql like '%outmoney%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover add column outmoney decimal(24,2) DEFAULT 0;"
                            }
        }
    },
    "upgrade123":{
        "version":"0.0.2.85",
        "description":"销售主表 food_business_ticket 添加主键",
        "precondition":"select case when count(1)=1 then 1 else 0 end from sqlite_master where type='table' and name='food_business_ticket';",
        "scripts":{
                    "sql1":{"line1":"ALTER TABLE food_business_ticket RENAME TO _food_business_ticket_old_20160704;",
                            "line2":"DROP INDEX food_business_ticket_no;"
                            },
                    "sql2":{"line1" :"CREATE TABLE food_business_ticket (",
                            "line2" :"id  VARCHAR(32) NOT NULL,",
                            "line3" :"storeId  VARCHAR(32),",
                            "line4" :"no  VARCHAR(32),",
                            "line5" :"status  Integer,",
                            "line6" :"handNo  VARCHAR(32),",
                            "line7" :"workNo  VARCHAR(32),",
                            "line8" :"saleDate  VARCHAR(32),",
                            "line9" :"cancelNo  VARCHAR(32),",
                            "line10":"cancelDate  VARCHAR(32),",
                            "line11":"discountType  VARCHAR(32),",
                            "line12":"tableId  VARCHAR(32),",
                            "line13":"tableNo  VARCHAR(32),",
                            "line14":"people  Integer,",
                            "line15":"busMode  Integer,",
                            "line16":"busType  VARCHAR(16),",
                            "line17":"upflag  Integer,",
                            "line18":"dcpeople  VARCHAR(32),",
                            "line19":"scaddress  VARCHAR(32),",
                            "line20":"scpeople  VARCHAR(32),",
                            "line21":"scno  VARCHAR(32),",
                            "line22":"scphone  VARCHAR(32),",
                            "line23":"dcyuzhi  decimal(24,2),",
                            "line24":"dcbeiyong  decimal(24,2),",
                            "line25":"sctime  varchar(32),",
                            "line26":"amount  decimal(24,2),",
                            "line27":"paid  decimal(24,2),",
                            "line28":"discount  decimal(24,2),",
                            "line29":"give  decimal(24,2),",
                            "line30":"deviceName  VARCHAR(32),",
                            "line31":"noOrg  VARCHAR(32),",
                            "line32":"backCause  VARCHAR(128),",
                            "line33":"posNo  VARCHAR(16),",
                            "line34":"duplicate  INTEGER DEFAULT 0,",
                            "line35":"memberCard  VARCHAR(32) DEFAULT '',",
                            "line36":"memberJifen  decimal(24,2) DEFAULT 0,",
                            "line37":"memberJfVoucherNo  VARCHAR(32) DEFAULT '',",
                            "line38":"kdsUpFlag  INTEGER DEFAULT 0,",
                            "line39":"kdsGlobalOrder  INTEGER DEFAULT 0,",
                            "line40":"PRIMARY KEY (id)",
                            "line41":");"
                            },
                    "sql3":{"line1" :"INSERT INTO food_business_ticket",
                            "line2" :"(id, storeId, no, status, handNo, workNo, saleDate, cancelNo, cancelDate, discountType, tableId, tableNo, people,",
                            "line3" :"busMode, busType, upflag, dcpeople, scaddress, scpeople, scno, scphone, dcyuzhi, dcbeiyong, sctime, amount,",
                            "line4" :"paid, discount, give, deviceName, noOrg, backCause, posNo, duplicate, memberCard, memberJifen, memberJfVoucherNo,",
                            "line5" :"kdsUpFlag, kdsGlobalOrder) ",
                            "line6" :"SELECT id, storeId, no, status, handNo, workNo, saleDate, cancelNo, cancelDate, discountType, tableId, tableNo, people,",
                            "line7" :"busMode, busType, upflag, dcpeople, scaddress, scpeople, scno, scphone, dcyuzhi, dcbeiyong, sctime, amount,",
                            "line8" :"paid, discount, give, deviceName, noOrg, backCause, posNo, duplicate, memberCard, memberJifen, memberJfVoucherNo,",
                            "line9" :"kdsUpFlag, kdsGlobalOrder ",
                            "line10":"FROM _food_business_ticket_old_20160704;"
                            },
                    "sql4":{"line1":"CREATE INDEX food_business_ticket_no ON food_business_ticket (no ASC);",
                            "line2":"DROP TABLE _food_business_ticket_old_20160704;"
                            }
        }
    },
    "upgrade124":{
        "version":"0.0.2.85",
        "description":"销售菜品表 food_order_dish 添加主键",
        "precondition":"select case when count(1)=1 then 1 else 0 end from sqlite_master where type='table' and name='food_order_dish';",
        "scripts":{
                    "sql1":{"line1":"ALTER TABLE food_order_dish RENAME TO _food_order_dish_old_20160704;",
                            "line2":"DROP INDEX food_order_dish_no;"
                            },
                    "sql2":{"line1" :"CREATE TABLE food_order_dish (",
                            "line2" :"id  VARCHAR(32) NOT NULL,",
                            "line3" :"storeId  VARCHAR(32),",
                            "line4" :"busNo  VARCHAR(32),",
                            "line5" :"tableNo  VARCHAR(32),",
                            "line6" :"sequenceNo  INTEGER,",
                            "line7" :"dishId  VARCHAR(32),",
                            "line8" :"dishNo  VARCHAR(32),",
                            "line9" :"dishName  VARCHAR(32),",
                            "line10":"specId  VARCHAR(32),",
                            "line11":"specName  VARCHAR(32),",
                            "line12":"count  decimal(24,2),",
                            "line13":"rcount  decimal(24,2),",
                            "line14":"price  decimal(24,2),",
                            "line15":"priceOrg  decimal(24,2),",
                            "line16":"addPrice  decimal(24,2),",
                            "line17":"discount  decimal(24,2),",
                            "line18":"memberno  VARCHAR(32),",
                            "line19":"dzType  INTEGER,",
                            "line20":"isSuit  Integer,",
                            "line21":"suitId  VARCHAR(32),",
                            "line22":"isSpecial  Integer,",
                            "line23":"isCoupon  Integer,",
                            "line24":"isGive  Integer,",
                            "line25":"workerNo  VARCHAR(32),",
                            "line26":"saleDate  VARCHAR(32),",
                            "line27":"deviceName  VARCHAR(32),",
                            "line28":"saveFlag  INTEGER,",
                            "line29":"parentSequenceNo  INTEGER,",
                            "line30":"upflag  Integer,",
                            "line31":"payStatus  Integer,",
                            "line32":"suitItemNo  VARCHAR(16),",
                            "line33":"priceAddSuit  decimal(24,2),",
                            "line34":"money  decimal(24,2),",
                            "line35":"hand  INTEGER,",
                            "line36":"ownerDishId  VARCHAR(32),",
                            "line37":"ownerSpecId  VARCHAR(32),",
                            "line38":"isSpecialMember  INTEGER DEFAULT 0,",
                            "line39":"moneyActual  decimal(24,2),",
                            "line40":"dishUnitId  VARCHAR(32),",
                            "line41":"produeceDepId  VARCHAR(32),",
                            "line42":"sameNo  VARCHAR(32),",
                            "line43":"isRback  INTEGER DEFAULT 0,",
                            "line44":"PRIMARY KEY (id)",
                            "line45":");"
                            },
                    "sql3":{"line1" :"INSERT INTO food_order_dish",
                            "line2" :"(id, storeId, busNo, tableNo, sequenceNo, dishId, dishNo, dishName, specId, specName, count, rcount,",
                            "line3" :"price, priceOrg, addPrice, discount, memberno, dzType, isSuit, suitId, isSpecial, isCoupon, isGive,",
                            "line4" :"workerNo, saleDate, deviceName, saveFlag, parentSequenceNo, upflag, payStatus, suitItemNo, priceAddSuit,",
                            "line5" :"money, hand, ownerDishId, ownerSpecId, isSpecialMember, moneyActual, dishUnitId, produeceDepId, sameNo,",
                            "line6" :"isRback) ",
                            "line7" :"SELECT id, storeId, busNo, tableNo, sequenceNo, dishId, dishNo, dishName, specId, specName, count, rcount,",
                            "line8" :"price, priceOrg, addPrice, discount, memberno, dzType, isSuit, suitId, isSpecial, isCoupon, isGive,",
                            "line9" :"workerNo, saleDate, deviceName, saveFlag, parentSequenceNo, upflag, payStatus, suitItemNo, priceAddSuit,",
                            "line10":"money, hand, ownerDishId, ownerSpecId, isSpecialMember, moneyActual, dishUnitId, produeceDepId, sameNo,",
                            "line11":"isRback ",
                            "line12":"FROM _food_order_dish_old_20160704;"
                            },
                    "sql4":{"line1":"CREATE INDEX food_order_dish_no ON food_order_dish (busNo ASC);",
                            "line2":"DROP TABLE _food_order_dish_old_20160704;"
                            }
        }
    },
    "upgrade125":{
        "version":"0.0.2.85",
        "description":"销售菜品做法表 food_order_dish_make 添加主键",
        "precondition":"select case when count(1)=1 then 1 else 0 end from sqlite_master where type='table' and name='food_order_dish_make';",
        "scripts":{
                    "sql1":{"line1":"ALTER TABLE food_order_dish_make RENAME TO _food_order_dish_make_old_20160704;",
                            "line2":"DROP INDEX food_order_dish_make_no;"
                            },
                    "sql2":{"line1" :"CREATE TABLE food_order_dish_make (",
                            "line2" :"id  VARCHAR(32) NOT NULL,",
                            "line3" :"storeId  VARCHAR(32),",
                            "line4" :"busNo  VARCHAR(32),",
                            "line5" :"orderSequenceNo  INTEGER,",
                            "line6" :"sequenceNo  INTEGER,",
                            "line7" :"makeId  VARCHAR(32),",
                            "line8" :"makeName  VARCHAR(64),",
                            "line9" :"addPrice  decimal(24,2),",
                            "line10":"count  decimal(24,2),",
                            "line11":"rcount  decimal(24,2),",
                            "line12":"hand  INTEGER,",
                            "line13":"qtyFlag  INTEGER,",
                            "line14":"upFlag  INTEGER,",
                            "line15":"PRIMARY KEY (id)",
                            "line16":");"
                            },
                    "sql3":{"line1" :"INSERT INTO food_order_dish_make",
                            "line2" :"(id, storeId, busNo, orderSequenceNo, sequenceNo, makeId, makeName, addPrice, count, rcount, hand, qtyFlag, upFlag) ",
                            "line3" :"SELECT id, storeId, busNo, orderSequenceNo, sequenceNo, makeId, makeName, addPrice, count, rcount, hand, qtyFlag, upFlag ",
                            "line4" :"FROM _food_order_dish_make_old_20160704;"
                            },
                    "sql4":{"line1":"CREATE INDEX food_order_dish_make_no ON food_order_dish_make (busNo ASC);",
                            "line2":"DROP TABLE _food_order_dish_make_old_20160704;"
                            }
        }
    },
    "upgrade126":{
        "version":"0.0.2.85",
        "description":"销售付款表 food_store_pay 添加主键",
        "precondition":"select case when count(1)=1 then 1 else 0 end from sqlite_master where type='table' and name='food_store_pay';",
        "scripts":{
                    "sql1":{"line1":"ALTER TABLE food_store_pay RENAME TO _food_store_pay_old_20160705;",
                            "line2":"DROP INDEX food_store_pay_no;"
                            },
                    "sql2":{"line1" :"CREATE TABLE food_store_pay (",
                            "line2" :"id  VARCHAR(32) NOT NULL,",
                            "line3" :"storeId  VARCHAR(32),",
                            "line4" :"payNo  VARCHAR(32),",
                            "line5" :"busNo  VARCHAR(32),",
                            "line6" :"tableId  VARCHAR(32),",
                            "line7" :"tableNo  VARCHAR(32),",
                            "line8" :"payTypeId  VARCHAR(32),",
                            "line9" :"payType  VARCHAR(32),",
                            "line10":"money  decimal(24,2),",
                            "line11":"paid  decimal(24,2),",
                            "line12":"change  decimal(24,2),",
                            "line13":"virtual  decimal(24,2),",
                            "line14":"workNo  VARCHAR(32),",
                            "line15":"deviceName  VARCHAR(32),",
                            "line16":"voucherNo  VARCHAR(32),",
                            "line17":"payDate  VARCHAR(32),",
                            "line18":"face  decimal(24,2),",
                            "line19":"cardno  VARCHAR(32),",
                            "line20":"cardYe  decimal(24,2),",
                            "line21":"cardJf  decimal(24,2),",
                            "line22":"upflag  Integer,",
                            "line23":"memo  VARCHAR(256),",
                            "line24":"moneyDiscount  decimal(24,2),",
                            "line25":"pointFlag  INTEGER DEFAULT 0,",
                            "line26":"PRIMARY KEY (id)",
                            "line27":");"
                            },
                    "sql3":{"line1" :"INSERT INTO food_store_pay",
                            "line2" :"(id, storeId, payNo, busNo, tableId, tableNo, payTypeId, payType, money, paid, change, virtual,",
                            "line3" :"workNo, deviceName, voucherNo, payDate, face, cardno, cardYe, cardJf, upflag, memo, moneyDiscount,",
                            "line4" :"pointFlag) ",
                            "line5" :"SELECT id, storeId, payNo, busNo, tableId, tableNo, payTypeId, payType, money, paid, change, virtual,",
                            "line6" :"workNo, deviceName, voucherNo, payDate, face, cardno, cardYe, cardJf, upflag, memo, moneyDiscount,",
                            "line7" :"pointFlag ",
                            "line8" :"FROM _food_store_pay_old_20160705;"
                            },
                    "sql4":{"line1":"CREATE INDEX food_store_pay_no ON food_store_pay (busNo ASC);",
                            "line2":"DROP TABLE _food_store_pay_old_20160705;"
                            }
        }
    },
    "upgrade127":{
        "version":"0.0.2.85",
        "description":"销售明细表添加字段 evenOriginalFlag",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_order_dish' and sql like '%evenOriginalFlag%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_order_dish add column evenOriginalFlag INTEGER DEFAULT 0;"
                            }
        }
    },
    "upgrade128":{
        "version":"0.0.2.86",
        "description":"菜品表添加字段 kvsFlag 是否厨显 0否1是",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_dish' and sql like '%kvsFlag%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_dish add column kvsFlag INTEGER default 1;"
                            }
        }
    },
    "upgrade129":{
        "version":"0.0.2.87",
        "description":"在消费主表的日期字段上添加索引",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type = 'index' and tbl_name = 'food_business_ticket' and name = 'food_business_ticket_saleDate';",
        "scripts":{
                    "sql1":{"line1":"CREATE INDEX food_business_ticket_saleDate ON food_business_ticket (saleDate ASC);"}
        }
    },
	"upgrade130":{
        "version":"0.0.2.87",
        "description":"在卡金变动表的日期字段上添加索引",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type = 'index' and tbl_name = 'card_moneychange' and name = 'card_moneychange_date';",
        "scripts":{
                    "sql1":{"line1":"CREATE INDEX card_moneychange_date ON card_moneychange (DATE ASC);"}
        }
    },
    "upgrade131":{
        "version":"0.0.2.90",
        "description":"销售主表添加字段 memberJifenOld",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_business_ticket' and sql like '%memberJifenOld%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_business_ticket add column memberJifenOld decimal(24,2) DEFAULT 0;"}
        }
    },
    "upgrade132":{
        "version":"0.0.2.90",
        "description":"销售主表添加字段 memberMoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_business_ticket' and sql like '%memberMoney%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_business_ticket add column memberMoney decimal(24,2) DEFAULT 0;"}
        }
    },
    "upgrade133":{
        "version":"0.0.2.90",
        "description":"销售主表添加字段 memberMoneyOld",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_business_ticket' and sql like '%memberMoneyOld%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_business_ticket add column memberMoneyOld decimal(24,2) DEFAULT 0;"}
        }
    },
    "upgrade134":{
        "version":"0.0.2.91",
        "description":"修改视图 v_yydj_query_ticket",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_yydj_query_ticket;",
                            "line2" :"CREATE VIEW v_yydj_query_ticket AS ",
                            "line3" :"SELECT a.storeId,",
                            "line4" :"b.payNo,",
                            "line5" :"a.no,",
                            "line6" :"a.tableId,",
                            "line7" :"a.tableNo,",
                            "line8" :"a.handNo,",
                            "line9" :"case when a.status in (0,1,5) then a.amount else 0 end amount,",
                            "line10":"case when a.status in (0,1,5) then b.free else 0 end free,",
                            "line11":"case when a.status in (0,1,5) then a.discount else 0 end discount,",
                            "line12":"case when a.status in (0,1,5) then a.give else 0 end give,",
                            "line13":"a.status,",
                            "line14":"a.workNo,",
                            "line15":"a.cancelNo,",
                            "line16":"a.cancelDate,",
                            "line17":"a.deviceName,",
                            "line18":"a.busMode,",
                            "line19":"a.busType,",
                            "line20":"b.pay_discount,",
                            "line21":"case when a.status in (0,1,5) then b.cash else 0 end cash,",
                            "line22":"case when a.status in (0,1,5) then b.ignoreDecimals else 0 end ignoreDecimals,",
                            "line23":"case when a.status in (0,1,5) then b.credit else 0 end credit,",
                            "line24":"case when a.status in (0,1,5) then b.card else 0 end card,",
                            "line25":"case when a.status in (0,1,5) then b.other else 0 end other,",
                            "line26":"case when a.status in (0,1,5) then saleDate else '' end as operdate,",
                            "line27":"a.people,",
                            "line28":"a.saleDate as kdDate,",
                            "line29":"0 as duration,",
                            "line30":"case when a.status in (0,1,5) then a.amount - a.discount - a.give else 0 end ys,",
                            "line31":"b.realMoney,",
                            "line32":"b.virtualMoney,",
                            "line33":"b.oddChange,",
                            "line34":"a.posNo,",
                            "line35":"case when a.status in (0,1,5) then b.run else 0 end run,",
                            "line36":"a.saleDate,",
                            "line37":"b.jbRealMoney,",
                            "line38":"b.jbVirtualMoney,",
                            "line39":"a.memberCard,",
                            "line40":"a.memberJifen,",
                            "line41":"a.memberJfVoucherNo,",
                            "line42":"a.id,",
                            "line43":"a.kdsUpFlag,",
                            "line44":"a.kdsGlobalOrder,",
                            "line45":"a.memberJifenOld,",
                            "line46":"a.memberMoney,",
                            "line47":"a.memberMoneyOld ",
                            "line48":"FROM food_business_ticket a inner join v_food_business_ticket_pay b ",
                            "line49":"on a.storeId = b.storeId and a.no = b.busNo;"
                            }
        }
    },
    "upgrade135":{
        "version":"0.0.2.92",
        "description":"菜品表添加字段 currentFlag 菜品是否时价 0否1是",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_dish' and sql like '%currentFlag%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table food_dish add column currentFlag INTEGER default 0;"
                            }
        }
    },
    "upgrade136":{
        "version":"0.0.2.92",
        "description":"修改单据明细扩展视图 v_yydj_query_dish_ex",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_yydj_query_dish_ex;",
                            "line2" :"CREATE VIEW v_yydj_query_dish_ex AS ",
                            "line3" :"select a.id,a.storeId,a.busNo,a.tableNo,a.sequenceNo,a.dishId,a.dishNo,a.dishName,a.specId,a.specName,a.count,",
                            "line4" :"a.rcount,a.price,a.priceOrg,a.addPrice,a.discount,a.memberno,a.dzType,",
                            "line5" :"a.isSuit,case when a.isSuit = 2 then 1 else 0 end as suitFlag,",
                            "line6" :"a.suitId,a.isSpecial,",
                            "line7" :"a.isCoupon,a.isGive,a.workerNo,a.saleDate,a.deviceName,a.saveFlag,a.parentSequenceNo,a.upflag,",
                            "line8" :"a.payStatus,a.suitItemNo,a.priceAddSuit,a.money,a.hand,a.ownerDishId,a.ownerSpecId,a.isSpecialMember,",
                            "line9" :"a.moneyActual,a.dishUnitId,a.produeceDepId,a.sameNo,a.isRback,a.evenOriginalFlag,",
                            "line10":"coalesce(b.istaple,0) istaple,coalesce(b.english,'') english,",
                            "line11":"coalesce(b.kvsFlag,1) kvsFlag,coalesce(b.currentFlag,0) currentFlag ",
                            "line12":"from food_order_dish a left join food_dish b ",
                            "line13":"on a.dishId = b.id;"
                            }
        }
    },
    "upgrade137":{
        "version":"0.0.2.92",
        "description":"在菜品表的ID字段上添加索引 food_dish",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type = 'index' and tbl_name = 'food_dish' and name = 'food_dish_id';",
        "scripts":{
                    "sql1":{"line1":"CREATE INDEX food_dish_id ON food_dish (id ASC);"}
        }
    },
    "upgrade138":{
        "version":"0.0.2.92",
        "description":"在销售明细表的菜品ID字段上添加索引",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type = 'index' and tbl_name = 'food_order_dish' and name = 'food_order_dish_dishId';",
        "scripts":{
                    "sql1":{"line1":"CREATE INDEX food_order_dish_dishId ON food_order_dish (dishId ASC);"}
        }
    },
    "upgrade139":{
        "version":"0.0.2.95",
        "description":"新建菜品基础视图 v_food_dish",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_food_dish;",
                            "line2":"CREATE VIEW v_food_dish AS ",
                            "line3":"select id,no,name,seriesId,typeId,suitFlag,price,memberPrice,discountFlag,",
                            "line4":"spell,assistNo,pic,labelPrintFlag,chudaFlag,chuda,istaple,isweigh,",
                            "line5":"unitId,english,chupinFlag,chupin,kvsFlag,currentFlag ",
                            "line6":"from food_dish ",
                            "line7":"where seriesId <> '0';"
                            }
        }
    },
    "upgrade140":{
        "version":"0.0.2.95",
        "description":"修改单据明细扩展视图 v_yydj_query_dish_ex",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_yydj_query_dish_ex;",
                            "line2" :"CREATE VIEW v_yydj_query_dish_ex AS ",
                            "line3" :"select a.id,a.storeId,a.busNo,a.tableNo,a.sequenceNo,a.dishId,a.dishNo,a.dishName,a.specId,a.specName,a.count,",
                            "line4" :"a.rcount,a.price,a.priceOrg,a.addPrice,a.discount,a.memberno,a.dzType,",
                            "line5" :"a.isSuit,case when a.isSuit = 2 then 1 else 0 end as suitFlag,",
                            "line6" :"a.suitId,a.isSpecial,",
                            "line7" :"a.isCoupon,a.isGive,a.workerNo,a.saleDate,a.deviceName,a.saveFlag,a.parentSequenceNo,a.upflag,",
                            "line8" :"a.payStatus,a.suitItemNo,a.priceAddSuit,a.money,a.hand,a.ownerDishId,a.ownerSpecId,a.isSpecialMember,",
                            "line9" :"a.moneyActual,a.dishUnitId,a.produeceDepId,a.sameNo,a.isRback,a.evenOriginalFlag,",
                            "line10":"coalesce(b.istaple,0) istaple,coalesce(b.english,'') english,",
                            "line11":"coalesce(b.kvsFlag,1) kvsFlag,coalesce(b.currentFlag,0) currentFlag ",
                            "line12":"from food_order_dish a left join v_food_dish b ",
                            "line13":"on a.dishId = b.id;"
                            }
        }
    },
    "upgrade141":{
        "version":"0.0.2.97",
        "description":"添加员工工作时间表 local_worktime",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_worktime';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE local_worktime (",
                            "line2":"storeId  VARCHAR(32),",
                            "line3":"workId  VARCHAR(32) NOT NULL,",
                            "line4":"loginTime  VARCHAR(32),",
                            "line5":"PRIMARY KEY (workId)",
                            "line6":");"
                            }
        }
    },
    "upgrade142":{
        "version":"0.0.2.99",
        "description":"添加视图 v_food_store_cost_revenue",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_food_store_cost_revenue;",
                            "line2" :"CREATE VIEW v_food_store_cost_revenue AS ",
                            "line3" :"select a.id,",
                            "line4" :"a.storeId,",
                            "line5" :"a.name,",
                            "line6" :"a.money,",
                            "line7" :"a.type,",
                            "line8" :"case when a.type = 0 then '收入' when a.type = 1 then '支出' else '其它' end typeName,",
                            "line9" :"a.description,",
                            "line10":"a.workerNo,",
                            "line11":"a.duplicate,",
                            "line12":"a.upflag,",
                            "line13":"a.createDate,",
                            "line14":"b.name as workerName ",
                            "line15":"from food_store_cost_revenue a left join food_store_worker b on a.workerNo = b.no;"
                            }
        }
    },
    "upgrade143":{
        "version":"0.0.2.100",
        "description":"添加视图 v_food_dish_series",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_food_dish_series;",
                            "line2":"CREATE VIEW v_food_dish_series AS ",
                            "line3":"select id,no,name ",
                            "line4":"from food_dish_series ",
                            "line5":"where id <> '0';"
                            }
        }
    },
    "upgrade144":{
        "version":"0.0.2.100",
        "description":"修改视图 v_cy_store_department",
        "scripts":{
                    "sql1":{
                            "line1":"DROP VIEW IF EXISTS v_cy_store_department;",
                            "line2":"CREATE VIEW v_cy_store_department AS ",
                            "line3":"select id,storeId,no,name,parentId,enabled,description from cy_store_department;"
                            }
        }
    },
    "upgrade145":{
        "version":"0.0.2.107",
        "description":"添加参数设置 读卡器型号_v2",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='cardReader_readerMode_v2';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('cardReader_readerMode_v2','0','读卡器型号_v2','存储读卡器在程序中定义的数字代码_v2');"
                            }
        }
    },
    "upgrade146":{
        "version":"0.0.2.107",
        "description":"添加参数设置 卡介质类型_v2",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='cardReader_cardMedia_v2';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('cardReader_cardMedia_v2','0','卡介质类型_v2','存储卡片在程序中定义的数字代码_v2');"
                            }
        }
    },
    "upgrade147":{
        "version":"0.0.2.110",
        "description":"交班主表添加字段 posNo",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover' and sql like '%posNo%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover add column posNo VARCHAR(16);"
                            }
        }
    },
    "upgrade148":{
        "version":"0.0.2.111",
        "description":"修改视图 v_food_order_dish_forStatistics",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_food_order_dish_forStatistics;",
                            "line2" :"CREATE VIEW v_food_order_dish_forStatistics AS ",
                            "line3" :"select a.storeId, a.posNo, a.status, a.saleDate,",
                            "line4" :"b.count, b.rcount, b.moneyActual, b.isSuit, b.isGive,",
                            "line5" :"c.no as dishNo, c.name as dishName,",
                            "line6" :"d.no as typeNo, d.name as typeName,",
                            "line7" :"e.no as seriesNo, e.name as seriesName,",
                            "line8" :"case when coalesce(c.isweigh,0) = 1 then 1 else (count-rcount) end as count2,",
                            "line9" :"b.money ",
                            "line10":"from food_business_ticket a ",
                            "line11":"inner join food_order_dish b on a.storeid = b.storeid and a.no = b.busNo ",
                            "line12":"left join (select * from food_dish where seriesId <> '0')c on b.dishId = c.id ",
                            "line13":"left join (select * from food_dish_type where seriesId <> '0')d on c.typeId = d.id ",
                            "line14":"left join (select * from food_dish_series where id <> '0')e on c.seriesId = e.id ",
                            "line15":"where a.status in (0,1,5)"
                            }
        }
    },
    "upgrade149":{
        "version":"0.0.2.114",
        "description":"添加厨显方案表 kvs_plan",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='kvs_plan';",
        "scripts":{
                    "sql1":{
                            "line1" :"CREATE TABLE kvs_plan (",
                            "line2" :"id  VARCHAR(32) NOT NULL,",
                            "line3" :"no  VARCHAR(16),",
                            "line4" :"name  VARCHAR(32),",
                            "line5" :"description  VARCHAR(128),",
                            "line6" :"ip  VARCHAR(32) DEFAULT '',",
                            "line7" :"port  INTEGER DEFAULT 0,",
                            "line8" :"PRIMARY KEY (id ASC),",
                            "line9" :"CONSTRAINT kvs_plan_no UNIQUE (no ASC)",
                            "line10":");"
                            }
        }
    },
    "upgrade150":{
        "version":"0.0.2.114",
        "description":"添加厨显方案表 kvs_dish_plan",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='kvs_dish_plan';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE kvs_dish_plan (",
                            "line2":"id  VARCHAR(32) NOT NULL,",
                            "line3":"dishId  VARCHAR(32),",
                            "line4":"kvsFlag  Integer,",
                            "line5":"kvsplan  VARCHAR(32),",
                            "line6":"PRIMARY KEY (id ASC),",
                            "line7":"CONSTRAINT kvs_dish_plan_dishId UNIQUE (dishId)",
                            "line8":");"
                            }
        }
    },
    "upgrade151":{
        "version":"0.0.2.114",
        "description":"添加数据下载表 kvs_plan",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='chuxian.getKvsPlans';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values('35','chuxian.getKvsPlans','kvs_plan','plans');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values('35','storeId',null);"
                            }
        }
    },
    "upgrade152":{
        "version":"0.0.2.114",
        "description":"添加数据下载表 kvs_dish_plan",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='chuxian.getDishKvsPlans';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values('36','chuxian.getDishKvsPlans','kvs_dish_plan','list');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values('36','storeId',null);"
                            }
        }
    },
    "upgrade153":{
        "version":"0.0.2.114",
        "description":"添加视图 v_kvs_dish_plan",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_kvs_dish_plan;",
                            "line2" :"CREATE VIEW v_kvs_dish_plan AS ",
                            "line3" :"select a.id,a.dishId,a.kvsFlag,a.kvsplan,",
                            "line4" :"b.no,b.name,b.description,b.ip,b.port,",
                            "line5" :"b.no || '  ' || b.name as kvsConfigKey ",
                            "line6" :"from kvs_dish_plan a inner join kvs_plan b on a.kvsplan = b.id;"
                            }
        }
    },
    "upgrade154":{
        "version":"0.0.2.114",
        "description":"销售菜品表添加字段 kvsUpFlag",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_order_dish' and sql like '%kvsUpFlag%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_order_dish add column kvsUpFlag INTEGER DEFAULT 0;"},
                    "sql2":{"line1":"update food_order_dish set kvsUpFlag = 1;"}
        }
    },
    "upgrade155":{
        "version":"0.0.2.114",
        "description":"修改单据明细扩展视图 v_yydj_query_dish_ex",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_yydj_query_dish_ex;",
                            "line2" :"CREATE VIEW v_yydj_query_dish_ex AS ",
                            "line3" :"select a.id,a.storeId,a.busNo,a.tableNo,a.sequenceNo,a.dishId,a.dishNo,a.dishName,a.specId,a.specName,a.count,",
                            "line4" :"a.rcount,a.price,a.priceOrg,a.addPrice,a.discount,a.memberno,a.dzType,",
                            "line5" :"a.isSuit,case when a.isSuit = 2 then 1 else 0 end as suitFlag,",
                            "line6" :"a.suitId,a.isSpecial,",
                            "line7" :"a.isCoupon,a.isGive,a.workerNo,a.saleDate,a.deviceName,a.saveFlag,a.parentSequenceNo,a.upflag,",
                            "line8" :"a.payStatus,a.suitItemNo,a.priceAddSuit,a.money,a.hand,a.ownerDishId,a.ownerSpecId,a.isSpecialMember,",
                            "line9" :"a.moneyActual,a.dishUnitId,a.produeceDepId,a.sameNo,a.isRback,a.evenOriginalFlag,a.kvsUpFlag,",
                            "line10":"coalesce(b.istaple,0) istaple,coalesce(b.english,'') english,",
                            "line11":"coalesce(b.kvsFlag,1) kvsFlag,coalesce(b.currentFlag,0) currentFlag,",
                            "line12":"coalesce(c.kvsFlag,0) kvsFlag_Fa,coalesce(c.ip,'') ip, coalesce(c.port,0) port ",
                            "line13":"from food_order_dish a left join v_food_dish b ",
                            "line14":"on a.dishId = b.id ",
                            "line15":"left join v_kvs_dish_plan c ",
                            "line16":"on a.dishId = c.dishId;"
                            }
        }
    },
    "upgrade156":{
        "version":"0.0.2.117",
        "description":"销售菜品表添加字段 couponId",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_order_dish' and sql like '%couponId%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_order_dish add column couponId VARCHAR(32);"}
        }
    },
    "upgrade157":{
        "version":"0.0.2.117",
        "description":"挂单表添加字段 couponId",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%couponId%';",
        "scripts":{
                    "sql1":{"line1":"alter table hang_dish add column couponId VARCHAR(32);"}
        }
    },
    "upgrade158":{
        "version":"0.0.2.117",
        "description":"修改单据明细扩展视图 v_yydj_query_dish_ex",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_yydj_query_dish_ex;",
                            "line2" :"CREATE VIEW v_yydj_query_dish_ex AS ",
                            "line3" :"select a.id,a.storeId,a.busNo,a.tableNo,a.sequenceNo,a.dishId,a.dishNo,a.dishName,a.specId,a.specName,a.count,",
                            "line4" :"a.rcount,a.price,a.priceOrg,a.addPrice,a.discount,a.memberno,a.dzType,",
                            "line5" :"a.isSuit,case when a.isSuit = 2 then 1 else 0 end as suitFlag,",
                            "line6" :"a.suitId,a.isSpecial,",
                            "line7" :"a.isCoupon,a.isGive,a.workerNo,a.saleDate,a.deviceName,a.saveFlag,a.parentSequenceNo,a.upflag,",
                            "line8" :"a.payStatus,a.suitItemNo,a.priceAddSuit,a.money,a.hand,a.ownerDishId,a.ownerSpecId,a.isSpecialMember,",
                            "line9" :"a.moneyActual,a.dishUnitId,a.produeceDepId,a.sameNo,a.isRback,a.evenOriginalFlag,a.kvsUpFlag,",
                            "line10":"coalesce(b.istaple,0) istaple,coalesce(b.english,'') english,",
                            "line11":"coalesce(b.kvsFlag,1) kvsFlag,coalesce(b.currentFlag,0) currentFlag,",
                            "line12":"coalesce(c.kvsFlag,0) kvsFlag_Fa,coalesce(c.ip,'') ip, coalesce(c.port,0) port,",
                            "line13":"a.couponId ",
                            "line14":"from food_order_dish a left join v_food_dish b ",
                            "line15":"on a.dishId = b.id ",
                            "line16":"left join v_kvs_dish_plan c ",
                            "line17":"on a.dishId = c.dishId;"
                            }
        }
    },
    "upgrade159":{
        "version":"0.0.2.118",
        "description":"交班主表添加字段 couponMoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='local_handover' and sql like '%couponMoney%';",
        "scripts":{
                    "sql1":{
                            "line1":"alter table local_handover add column couponMoney decimal(24,2) DEFAULT 0;"
                            }
        }
    },
    "upgrade160":{
        "version":"0.0.2.118",
        "description":"修改视图 v_food_order_dish_forStatistics",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_food_order_dish_forStatistics;",
                            "line2" :"CREATE VIEW v_food_order_dish_forStatistics AS ",
                            "line3" :"select a.storeId, a.posNo, a.status, a.saleDate,",
                            "line4" :"b.count, b.rcount, b.moneyActual, b.isSuit, b.isGive,",
                            "line5" :"c.no as dishNo, c.name as dishName,",
                            "line6" :"d.no as typeNo, d.name as typeName,",
                            "line7" :"e.no as seriesNo, e.name as seriesName,",
                            "line8" :"case when coalesce(c.isweigh,0) = 1 then 1 else (count-rcount) end as count2,",
                            "line9" :"b.money,",
                            "line10":"a.workNo,",
                            "line11":"(b.priceOrg-b.price)*(b.count-b.rcount)*b.isCoupon as couponMoney ",
                            "line12":"from food_business_ticket a ",
                            "line13":"inner join food_order_dish b on a.storeid = b.storeid and a.no = b.busNo ",
                            "line14":"left join (select * from food_dish where seriesId <> '0')c on b.dishId = c.id ",
                            "line15":"left join (select * from food_dish_type where seriesId <> '0')d on c.typeId = d.id ",
                            "line16":"left join (select * from food_dish_series where id <> '0')e on c.seriesId = e.id ",
                            "line17":"where a.status in (0,1,5)"
                            }
        }
    },
    "upgrade161":{
        "version":"0.0.2.118",
        "description":"添加参数设置 会员卡优先扣款时余额不足的提示方式",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='settleAccount_memberCard_cashHint';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('settleAccount_memberCard_cashHint','1','会员卡优先扣款时余额不足的提示方式','1 提示应收取的现金金额并要求确认 2 重新录入应收取的现金金额');"
                            }
        }
    },
    "upgrade162":{
        "version":"0.0.2.119",
        "description":"销售菜品表添加字段 chudaAlready",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_order_dish' and sql like '%chudaAlready%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_order_dish add column chudaAlready INTEGER DEFAULT 0;"},
                    "sql2":{"line1":"update food_order_dish set chudaAlready = 1;"}
        }
    },
    "upgrade163":{
        "version":"0.0.2.119",
        "description":"挂单菜品表添加字段 chudaAlready",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%chudaAlready%';",
        "scripts":{
                    "sql1":{"line1":"alter table hang_dish add column chudaAlready INTEGER DEFAULT 0;"},
                    "sql2":{"line1":"update hang_dish set chudaAlready = 1;"}
        }
    },
    "upgrade164":{
        "version":"0.0.2.120",
        "description":"挂单主表添加字段 tableName",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_ticket' and sql like '%tableName%';",
        "scripts":{
                    "sql1":{"line1":"alter table hang_ticket add column tableName VARCHAR(64);"}
        }
    },
    "upgrade165":{
        "version":"0.0.2.121",
        "description":"添加参数设置 盘点单显示系统数量、系统金额、差异数量、差异金额",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='stock_stockCheck_sysinfoVisible';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('stock_stockCheck_sysinfoVisible','1','盘点单显示系统数量、系统金额、差异数量、差异金额','0 不显示 1 显示');"
                            }
        }
    },
    "upgrade166":{
        "version":"0.0.2.122",
        "description":"挂单主表添加字段 add_payNo",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_ticket' and sql like '%add_payNo%';",
        "scripts":{
                    "sql1":{"line1":"alter table hang_ticket add column add_payNo VARCHAR(32);"}
        }
    },
    "upgrade167":{
        "version":"0.0.2.123",
        "description":"添加会员每日优惠方案表 ecd_member_day_discount",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='ecd_member_day_discount';",
        "scripts":{
                    "sql1":{
                            "line1" :"CREATE TABLE ecd_member_day_discount (",
                            "line2" :"id  VARCHAR(32) NOT NULL,",
                            "line3" :"startDate  VARCHAR(32),",
                            "line4" :"endDate  VARCHAR(32),",
                            "line5" :"startTime  VARCHAR(32),",
                            "line6" :"endTime  VARCHAR(32),",
                            "line7" :"weekDays  VARCHAR(32),",
                            "line8" :"type  INTEGER,",
                            "line9" :"dayCount  INTEGER,",
                            "line10":"discountScale  decimal(24,2),",
                            "line11":"description  VARCHAR(128),",
                            "line12":"enable  INTEGER,",
                            "line13":"PRIMARY KEY (id ASC)",
                            "line14":");"
                            }
        }
    },
    "upgrade168":{
        "version":"0.0.2.123",
        "description":"添加不参与每日优惠菜品表 ecd_member_day_discount_outdish",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='ecd_member_day_discount_outdish';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE ecd_member_day_discount_outdish (",
                            "line2":"id  VARCHAR(32) NOT NULL,",
                            "line3":"discountId  VARCHAR(32),",
                            "line4":"dishId  VARCHAR(32),",
                            "line5":"specId  VARCHAR(32),",
                            "line6":"PRIMARY KEY (id)",
                            "line7":");"
                            },
                    "sql2":{"line1":"CREATE INDEX ecd_member_day_discount_outdish_discountId",
                            "line2":"ON ecd_member_day_discount_outdish (discountId ASC);"
                            }
        }
    },
    "upgrade169":{
        "version":"0.0.2.123",
        "description":"添加数据下载表 ecd_member_day_discount",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='ecmemberplan.getMemberDayDiscount';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values('37','ecmemberplan.getMemberDayDiscount','ecd_member_day_discount','list');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values('37','storeId',null);"
                            }
        }
    },
    "upgrade170":{
        "version":"0.0.2.123",
        "description":"添加数据下载表 ecd_member_day_discount_outdish",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='ecmemberplan.getMemberDayDiscountOutdish';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values('38','ecmemberplan.getMemberDayDiscountOutdish','ecd_member_day_discount_outdish','list');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values('38','storeId',null);"
                            }
        }
    },
    "upgrade171":{
        "version":"0.0.2.124",
        "description":"添加参数设置 自动补现金",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='settleAccount_autoFillCash';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('settleAccount_autoFillCash','1','自动补现金','0 不补 1 自动补');"
                            }
        }
    },
    "upgrade172":{
        "version":"0.0.2.125",
        "description":"添加参数设置 优惠券可以和其它促销同时使用",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='promotion_couponUseWithOtherPromotion';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('promotion_couponUseWithOtherPromotion','0','优惠券可以和其它促销同时使用','0 不可以 1 可以');"
                            }
        }
    },
    "upgrade173":{
        "version":"0.0.2.125",
        "description":"原料表添加字段 price",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='cy_material_detail' and sql like '%price%';",
        "scripts":{
                    "sql1":{"line1":"alter table cy_material_detail add column price decimal(24,2) default 0;"}
        }
    },
    "upgrade174":{
        "version":"0.0.2.125",
        "description":"添加参数设置 要货单显示配送价格",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='stock_askgoods_priceVisible';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('stock_askgoods_priceVisible','0','要货单显示配送价格','0 不显示 1 显示');"
                            }
        }
    },
    "upgrade175":{
        "version":"0.0.2.126",
        "description":"添加参数设置 交班打印模板",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='settleAccount_handover_printTemplet';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('settleAccount_handover_printTemplet','A模板','交班打印模板','A模板 B模板');"
                            }
        }
    },
    "upgrade176":{
        "version":"0.0.2.127",
        "description":"销售主表添加字段 couponMoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_business_ticket' and sql like '%couponMoney%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_business_ticket add column couponMoney decimal(24,2) default 0;"}
        }
    },
    "upgrade177":{
        "version":"0.0.2.127",
        "description":"销售菜品表添加字段 couponMoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='food_order_dish' and sql like '%couponMoney%';",
        "scripts":{
                    "sql1":{"line1":"alter table food_order_dish add column couponMoney decimal(24,2) default 0;"}
        }
    },
    "upgrade178":{
        "version":"0.0.2.127",
        "description":"修改视图 v_yydj_query_ticket",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_yydj_query_ticket;",
                            "line2" :"CREATE VIEW v_yydj_query_ticket AS ",
                            "line3" :"SELECT a.storeId,",
                            "line4" :"b.payNo,",
                            "line5" :"a.no,",
                            "line6" :"a.tableId,",
                            "line7" :"a.tableNo,",
                            "line8" :"a.handNo,",
                            "line9" :"case when a.status in (0,1,5) then a.amount else 0 end amount,",
                            "line10":"case when a.status in (0,1,5) then b.free else 0 end free,",
                            "line11":"case when a.status in (0,1,5) then a.discount else 0 end discount,",
                            "line12":"case when a.status in (0,1,5) then a.couponMoney else 0 end couponMoney,",
                            "line13":"case when a.status in (0,1,5) then a.give else 0 end give,",
                            "line14":"a.status,",
                            "line15":"a.workNo,",
                            "line16":"a.cancelNo,",
                            "line17":"a.cancelDate,",
                            "line18":"a.deviceName,",
                            "line19":"a.busMode,",
                            "line20":"a.busType,",
                            "line21":"b.pay_discount,",
                            "line22":"case when a.status in (0,1,5) then b.cash else 0 end cash,",
                            "line23":"case when a.status in (0,1,5) then b.ignoreDecimals else 0 end ignoreDecimals,",
                            "line24":"case when a.status in (0,1,5) then b.credit else 0 end credit,",
                            "line25":"case when a.status in (0,1,5) then b.card else 0 end card,",
                            "line26":"case when a.status in (0,1,5) then b.other else 0 end other,",
                            "line27":"case when a.status in (0,1,5) then saleDate else '' end as operdate,",
                            "line28":"a.people,",
                            "line29":"a.saleDate as kdDate,",
                            "line30":"0 as duration,",
                            "line31":"case when a.status in (0,1,5) then a.amount - a.discount - a.give else 0 end ys,",
                            "line32":"b.realMoney,",
                            "line33":"b.virtualMoney,",
                            "line34":"b.oddChange,",
                            "line35":"a.posNo,",
                            "line36":"case when a.status in (0,1,5) then b.run else 0 end run,",
                            "line37":"a.saleDate,",
                            "line38":"b.jbRealMoney,",
                            "line39":"b.jbVirtualMoney,",
                            "line40":"a.memberCard,",
                            "line41":"a.memberJifen,",
                            "line42":"a.memberJfVoucherNo,",
                            "line43":"a.id,",
                            "line44":"a.kdsUpFlag,",
                            "line45":"a.kdsGlobalOrder,",
                            "line46":"a.memberJifenOld,",
                            "line47":"a.memberMoney,",
                            "line48":"a.memberMoneyOld ",
                            "line49":"FROM food_business_ticket a inner join v_food_business_ticket_pay b ",
                            "line50":"on a.storeId = b.storeId and a.no = b.busNo;"
                            }
        }
    },
    "upgrade179":{
        "version":"0.0.2.127",
        "description":"修改视图 v_food_order_dish_forStatistics",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_food_order_dish_forStatistics;",
                            "line2" :"CREATE VIEW v_food_order_dish_forStatistics AS ",
                            "line3" :"select a.storeId, a.posNo, a.status, a.saleDate,",
                            "line4" :"b.count, b.rcount, b.moneyActual, b.isSuit, b.isGive,",
                            "line5" :"c.no as dishNo, c.name as dishName,",
                            "line6" :"d.no as typeNo, d.name as typeName,",
                            "line7" :"e.no as seriesNo, e.name as seriesName,",
                            "line8" :"case when coalesce(c.isweigh,0) = 1 then 1 else (count-rcount) end as count2,",
                            "line9" :"b.money,",
                            "line10":"a.workNo,",
                            "line11":"b.couponMoney ",
                            "line12":"from food_business_ticket a ",
                            "line13":"inner join food_order_dish b on a.storeid = b.storeid and a.no = b.busNo ",
                            "line14":"left join (select * from food_dish where seriesId <> '0')c on b.dishId = c.id ",
                            "line15":"left join (select * from food_dish_type where seriesId <> '0')d on c.typeId = d.id ",
                            "line16":"left join (select * from food_dish_series where id <> '0')e on c.seriesId = e.id ",
                            "line17":"where a.status in (0,1,5)"
                            }
        }
    },
    "upgrade180":{
        "version":"0.0.2.127",
        "description":"挂单主表添加字段 couponMoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_ticket' and sql like '%couponMoney%';",
        "scripts":{
                    "sql1":{"line1":"alter table hang_ticket add column couponMoney decimal(24,2) default 0;"}
        }
    },
    "upgrade181":{
        "version":"0.0.2.127",
        "description":"挂单菜品表添加字段 couponMoney",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='hang_dish' and sql like '%couponMoney%';",
        "scripts":{
                    "sql1":{"line1":"alter table hang_dish add column couponMoney decimal(24,2) default 0;"}
        }
    },
    "upgrade182":{
        "version":"0.0.2.127",
        "description":"修改视图 v_yydj_query_dish",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_yydj_query_dish;",
                            "line2" :"CREATE VIEW v_yydj_query_dish AS ",
                            "line3" :"select id,storeId,busNo,tableNo,sequenceNo,dishId,dishNo,dishName,specId,specName,count,",
                            "line4" :"rcount,price,priceOrg,addPrice,discount,memberno,dzType,",
                            "line5" :"isSuit,case when isSuit = 2 then 1 else 0 end as suitFlag,",
                            "line6" :"suitId,isSpecial,",
                            "line7" :"isCoupon,isGive,workerNo,saleDate,deviceName,saveFlag,parentSequenceNo,upflag,",
                            "line8" :"payStatus,suitItemNo,priceAddSuit,money,hand,ownerDishId,ownerSpecId,isSpecialMember,",
                            "line9" :"moneyActual,sameNo,isRback,couponMoney ",
                            "line10":"from food_order_dish;"
                            }
        }
    },
    "upgrade183":{
        "version":"0.0.2.127",
        "description":"修改单据明细扩展视图 v_yydj_query_dish_ex",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_yydj_query_dish_ex;",
                            "line2" :"CREATE VIEW v_yydj_query_dish_ex AS ",
                            "line3" :"select a.id,a.storeId,a.busNo,a.tableNo,a.sequenceNo,a.dishId,a.dishNo,a.dishName,a.specId,a.specName,a.count,",
                            "line4" :"a.rcount,a.price,a.priceOrg,a.addPrice,a.discount,a.memberno,a.dzType,",
                            "line5" :"a.isSuit,case when a.isSuit = 2 then 1 else 0 end as suitFlag,",
                            "line6" :"a.suitId,a.isSpecial,",
                            "line7" :"a.isCoupon,a.isGive,a.workerNo,a.saleDate,a.deviceName,a.saveFlag,a.parentSequenceNo,a.upflag,",
                            "line8" :"a.payStatus,a.suitItemNo,a.priceAddSuit,a.money,a.hand,a.ownerDishId,a.ownerSpecId,a.isSpecialMember,",
                            "line9" :"a.moneyActual,a.dishUnitId,a.produeceDepId,a.sameNo,a.isRback,a.evenOriginalFlag,a.kvsUpFlag,",
                            "line10":"coalesce(b.istaple,0) istaple,coalesce(b.english,'') english,",
                            "line11":"coalesce(b.kvsFlag,1) kvsFlag,coalesce(b.currentFlag,0) currentFlag,",
                            "line12":"coalesce(c.kvsFlag,0) kvsFlag_Fa,coalesce(c.ip,'') ip, coalesce(c.port,0) port,",
                            "line13":"a.couponId,a.couponMoney ",
                            "line14":"from food_order_dish a left join v_food_dish b ",
                            "line15":"on a.dishId = b.id ",
                            "line16":"left join v_kvs_dish_plan c ",
                            "line17":"on a.dishId = c.dishId;"
                            }
        }
    },
    "upgrade184":{
        "version":"0.0.2.128",
        "description":"修改视图 v_food_order_dish_forStatistics",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_food_order_dish_forStatistics;",
                            "line2" :"CREATE VIEW v_food_order_dish_forStatistics AS ",
                            "line3" :"select a.storeId, a.posNo, a.status, a.saleDate,",
                            "line4" :"b.count, b.rcount, b.moneyActual, b.isSuit, b.isGive,",
                            "line5" :"b.dishId, c.no as dishNo, c.name as dishName,",
                            "line6" :"d.id as typeId, d.no as typeNo, d.name as typeName,",
                            "line7" :"e.id as seriesId, e.no as seriesNo, e.name as seriesName,",
                            "line8" :"case when coalesce(c.isweigh,0) = 1 then 1 else (count-rcount) end as count2,",
                            "line9" :"b.money,",
                            "line10":"a.workNo,",
                            "line11":"b.couponMoney,",
                            "line12":"b.workerNo as dishWorkerNo,",
                            "line13":"b.price,b.addPrice ",
                            "line14":"from food_business_ticket a ",
                            "line15":"inner join food_order_dish b on a.storeid = b.storeid and a.no = b.busNo ",
                            "line16":"left join (select * from food_dish where seriesId <> '0')c on b.dishId = c.id ",
                            "line17":"left join (select * from food_dish_type where seriesId <> '0')d on c.typeId = d.id ",
                            "line18":"left join (select * from food_dish_series where id <> '0')e on c.seriesId = e.id ",
                            "line19":"where a.status in (0,1,5)"
                            }
        }
    },
    "upgrade185":{
        "version":"0.0.2.128",
        "description":"添加查询临时表 temp_cpxsmx_query",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='temp_cpxsmx_query';",
        "scripts":{
                    "sql1":{
                            "line1" :"CREATE TABLE temp_cpxsmx_query (",
                            "line2" :"id VARCHAR(32),",
                            "line3" :"no VARCHAR(32),",
                            "line4" :"name VARCHAR(64),",
                            "line5" :"seriesId VARCHAR(32),",
                            "line6" :"seriesNo VARCHAR(32),",
                            "line7" :"seriesName VARCHAR(64),",
                            "line8" :"type INTEGER,",
                            "line9" :"count decimal(24,2) DEFAULT 0,",
                            "line10":"money decimal(24,2) DEFAULT 0",
                            "line11":");"
                            }
        }
    },
    "upgrade186":{
        "version":"0.0.2.129",
        "description":"查询临时表添加字段 displayOrder",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='temp_cpxsmx_query' and sql like '%displayOrder%';",
        "scripts":{
                    "sql1":{"line1":"alter table temp_cpxsmx_query add column displayOrder INTEGER DEFAULT 0;"}
        }
    },
    "upgrade187":{
        "version":"0.0.2.129",
        "description":"添加查询临时表 temp_cpxsmx_series",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='temp_cpxsmx_series';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE temp_cpxsmx_series (",
                            "line2":"id VARCHAR(32)",
                            "line3":");"
                            }
        }
    },
    "upgrade188":{
        "version":"0.0.2.131",
        "description":"添加充值功能可用支付方式表 recharge_pay_mode",
        "precondition":"select case when count(1)=1 then 0 else 1 end from sqlite_master where type='table' and name='recharge_pay_mode';",
        "scripts":{
                    "sql1":{
                            "line1":"CREATE TABLE recharge_pay_mode (",
                            "line2":"no  VARCHAR(32),",
                            "line3":"name  VARCHAR(64)",
                            "line4":");"
                            }
        }
    },
    "upgrade189":{
        "version":"0.0.2.131",
        "description":"添加数据下载表 recharge_pay_mode",
        "precondition":"select case when count(1)=1 then 0 else 1 end from food_base_update where Method='ecard.rechargePaytype';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into food_base_update(id,Method,LocalTable,JsonKey)values('39','ecard.rechargePaytype','recharge_pay_mode','list');",
                            "line2":"insert into food_base_params(MethodId,Params,ParamsValue)values('39','storeId',null);"
                            }
        }
    },
    "upgrade190":{
        "version":"0.0.2.131",
        "description":"添加视图 v_recharge_pay_mode",
        "scripts":{
                    "sql1":{
                            "line1" :"DROP VIEW IF EXISTS v_recharge_pay_mode;",
                            "line2" :"CREATE VIEW v_recharge_pay_mode AS ",
                            "line3" :"select a.id,a.no,a.name,a.isDefault,a.shortcut,a.pointFlag,a.frontFlag,a.validFlag,a.ticketTypeId,",
                            "line4" :"a.checkFlag,a.rechargeFlag,a.numRate,a.numMaxface,a.incomeFlag,",
                            "line5" :"a.typeId,b.no as typeNo,b.name as typeName,b.sign as typeSign ",
                            "line6" :"from food_pay_mode a ",
                            "line7" :"inner join food_pay_type b on a.typeId = b.id ",
                            "line8" :"inner join recharge_pay_mode c on a.no = c.no;"
                            }
        }
    },
    "upgrade191":{
        "version":"0.0.2.132",
        "description":"添加参数设置 打印菜品特性",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='common_printDishPreFlag';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('common_printDishPreFlag','1','打印菜品特性','0 不打印 1 打印');"
                            }
        }
    },
    "upgrade192":{
        "version":"0.0.2.133",
        "description":"添加参数设置 单号采用全局流水号",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='common_ticketNo_useGlobalUniqueOrder';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('common_ticketNo_useGlobalUniqueOrder','0','单号采用全局流水号','0 不采用 1 采用');"
                            }
        }
    },
    "upgrade193":{
        "version":"0.0.2.133",
        "description":"添加参数设置 单号采用全局流水号_IP地址",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='common_ticketNo_globalUniqueOrder_ip';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('common_ticketNo_globalUniqueOrder_ip','127.0.0.1','单号采用全局流水号_IP地址','');"
                            }
        }
    },
    "upgrade194":{
        "version":"0.0.2.133",
        "description":"添加参数设置 单号采用全局流水号_端口",
        "precondition":"select case when count(1)=1 then 0 else 1 end from local_sys_parameter where parameterKey='common_ticketNo_globalUniqueOrder_port';",
        "scripts":{
                    "sql1":{
                            "line1":"insert into local_sys_parameter(parameterKey,parameterValue,parameterName,parameterDes)",
                            "line2":"values('common_ticketNo_globalUniqueOrder_port','8099','单号采用全局流水号_端口','');"
                            }
        }
    }
}