//
//  BaseDao.h
//  TaiZhouTobacco_7s
//
//  Created by JianjiYuan on 14-5-22.
//  Copyright (c) 2014年 JianjiYuan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <FMDB.h>
#import "DBInstance.h"

typedef enum : NSUInteger {
    DaoOperateTypeInsert,
    DaoOperateTypeUpdate,
    DaoOperateTypeSelect,
    DaoOperateTypeDelete
} DaoOperateType;

@interface BaseDao : NSObject

+ (instancetype)getInstance;

//SELECT
- (NSArray *)excuteSelectBySQL:(NSString *)sql;
//OPERATE
- (BOOL)excuteSQL:(NSString *)sql operateType:(DaoOperateType)type;
- (BOOL)excuteSQLs:(NSArray *)sqls operateType:(DaoOperateType)type;
//INSERT
- (BOOL)insertData:(NSObject *)entity key:(NSString *)key toTable:(NSString *)table;
- (BOOL)insertDatas:(NSArray *)entities key:(NSString *)key toTable:(NSString *)table;
//UPDATE
- (BOOL)updateData:(NSObject *)entity key:(NSString *)key inTable:(NSString *)table;
- (BOOL)updateDatas:(NSArray *)entities key:(NSString *)key inTable:(NSString *)table;
//DELETE
- (BOOL)deleteData:(NSObject *)entity key:(NSString *)key inTable:(NSString *)table;
- (BOOL)deleteDatas:(NSArray *)entities key:(NSString *)key inTable:(NSString *)table;

@end
