package com.tofly.data.sql.dao;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;

import com.tofly.ghrq_route.module.trouble.domain.TroubleBean;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/** 
 * DAO for table "DB_TROUBLE".
*/
public class TroubleBeanDao extends AbstractDao<TroubleBean, String> {

    public static final String TABLENAME = "DB_TROUBLE";

    /**
     * Properties of entity TroubleBean.<br/>
     * Can be used for QueryBuilder and for referencing column names.
     */
    public static class Properties {
        public final static Property Id = new Property(0, String.class, "id", true, "ID");
        public final static Property Userid = new Property(1, String.class, "userid", false, "USERID");
        public final static Property Address = new Property(2, String.class, "address", false, "ADDRESS");
        public final static Property Current = new Property(3, int.class, "current", false, "CURRENT");
        public final static Property DutyUserId = new Property(4, String.class, "dutyUserId", false, "DUTY_USER_ID");
        public final static Property DutyUserName = new Property(5, String.class, "dutyUserName", false, "DUTY_USER_NAME");
        public final static Property MaintainerUserId = new Property(6, String.class, "maintainerUserId", false, "MAINTAINER_USER_ID");
        public final static Property MaintainerUserName = new Property(7, String.class, "maintainerUserName", false, "MAINTAINER_USER_NAME");
        public final static Property Flag = new Property(8, int.class, "flag", false, "FLAG");
        public final static Property GisUserId = new Property(9, String.class, "gisUserId", false, "GIS_USER_ID");
        public final static Property HandleState = new Property(10, String.class, "handleState", false, "HANDLE_STATE");
        public final static Property HandleStateName = new Property(11, String.class, "handleStateName", false, "HANDLE_STATE_NAME");
        public final static Property OnDutyUserId = new Property(12, String.class, "onDutyUserId", false, "ON_DUTY_USER_ID");
        public final static Property OnDutyUserName = new Property(13, String.class, "onDutyUserName", false, "ON_DUTY_USER_NAME");
        public final static Property TempHandleProject = new Property(14, String.class, "tempHandleProject", false, "TEMP_HANDLE_PROJECT");
        public final static Property TempHandleResult = new Property(15, String.class, "tempHandleResult", false, "TEMP_HANDLE_RESULT");
        public final static Property EventType = new Property(16, int.class, "eventType", false, "EVENT_TYPE");
        public final static Property EventTypeName = new Property(17, String.class, "eventTypeName", false, "EVENT_TYPE_NAME");
        public final static Property ProcessId = new Property(18, int.class, "processId", false, "PROCESS_ID");
        public final static Property ProcessName = new Property(19, String.class, "processName", false, "PROCESS_NAME");
        public final static Property ProcessId2 = new Property(20, String.class, "processId2", false, "PROCESS_ID2");
        public final static Property ReportUserId = new Property(21, String.class, "reportUserId", false, "REPORT_USER_ID");
        public final static Property ReportUserName = new Property(22, String.class, "reportUserName", false, "REPORT_USER_NAME");
        public final static Property ReportTime = new Property(23, String.class, "reportTime", false, "REPORT_TIME");
        public final static Property TroubleInfo = new Property(24, String.class, "troubleInfo", false, "TROUBLE_INFO");
        public final static Property TroubleName = new Property(25, String.class, "troubleName", false, "TROUBLE_NAME");
        public final static Property UploadType = new Property(26, int.class, "uploadType", false, "UPLOAD_TYPE");
        public final static Property UploadTypeName = new Property(27, String.class, "uploadTypeName", false, "UPLOAD_TYPE_NAME");
        public final static Property DeptId = new Property(28, String.class, "deptId", false, "DEPT_ID");
        public final static Property DeptName = new Property(29, String.class, "deptName", false, "DEPT_NAME");
        public final static Property Director = new Property(30, String.class, "director", false, "DIRECTOR");
        public final static Property DirectorName = new Property(31, String.class, "directorName", false, "DIRECTOR_NAME");
        public final static Property DeviceInfo = new Property(32, String.class, "deviceInfo", false, "DEVICE_INFO");
        public final static Property DeviceInfoDesc = new Property(33, String.class, "deviceInfoDesc", false, "DEVICE_INFO_DESC");
        public final static Property FindTime = new Property(34, String.class, "findTime", false, "FIND_TIME");
        public final static Property FindUserid = new Property(35, String.class, "findUserid", false, "FIND_USERID");
        public final static Property FindUserName = new Property(36, String.class, "findUserName", false, "FIND_USER_NAME");
        public final static Property GisUserName = new Property(37, String.class, "gisUserName", false, "GIS_USER_NAME");
        public final static Property LevelId = new Property(38, String.class, "levelId", false, "LEVEL_ID");
        public final static Property LevelName = new Property(39, String.class, "levelName", false, "LEVEL_NAME");
        public final static Property LocationX = new Property(40, String.class, "locationX", false, "LOCATION_X");
        public final static Property LocationY = new Property(41, String.class, "locationY", false, "LOCATION_Y");
        public final static Property Notes = new Property(42, String.class, "notes", false, "NOTES");
        public final static Property PipeInfo = new Property(43, String.class, "pipeInfo", false, "PIPE_INFO");
        public final static Property PipeInfoDesc = new Property(44, String.class, "pipeInfoDesc", false, "PIPE_INFO_DESC");
        public final static Property SecretaryUserid = new Property(45, String.class, "secretaryUserid", false, "SECRETARY_USERID");
        public final static Property TroubleTypeId = new Property(46, String.class, "troubleTypeId", false, "TROUBLE_TYPE_ID");
        public final static Property TroubleTypeName = new Property(47, String.class, "troubleTypeName", false, "TROUBLE_TYPE_NAME");
        public final static Property UndersecretaryUserid = new Property(48, String.class, "undersecretaryUserid", false, "UNDERSECRETARY_USERID");
        public final static Property UndersecretaryUserName = new Property(49, String.class, "undersecretaryUserName", false, "UNDERSECRETARY_USER_NAME");
        public final static Property UndersecretaryCheckNotes = new Property(50, String.class, "undersecretaryCheckNotes", false, "UNDERSECRETARY_CHECK_NOTES");
        public final static Property UndersecretaryCheckTime = new Property(51, String.class, "undersecretaryCheckTime", false, "UNDERSECRETARY_CHECK_TIME");
        public final static Property UndersecretaryStateName = new Property(52, String.class, "undersecretaryStateName", false, "UNDERSECRETARY_STATE_NAME");
        public final static Property UndertakerUserid = new Property(53, String.class, "undertakerUserid", false, "UNDERTAKER_USERID");
        public final static Property UndertakerUserName = new Property(54, String.class, "undertakerUserName", false, "UNDERTAKER_USER_NAME");
        public final static Property UndertakerCheckNotes = new Property(55, String.class, "undertakerCheckNotes", false, "UNDERTAKER_CHECK_NOTES");
        public final static Property UndertakerCheckTime = new Property(56, String.class, "undertakerCheckTime", false, "UNDERTAKER_CHECK_TIME");
        public final static Property UndertakerHandleUserId = new Property(57, String.class, "undertakerHandleUserId", false, "UNDERTAKER_HANDLE_USER_ID");
        public final static Property UndertakerHandleUserName = new Property(58, String.class, "undertakerHandleUserName", false, "UNDERTAKER_HANDLE_USER_NAME");
        public final static Property UndertakerHandleNotes = new Property(59, String.class, "undertakerHandleNotes", false, "UNDERTAKER_HANDLE_NOTES");
        public final static Property UndertakerHandleTime = new Property(60, String.class, "undertakerHandleTime", false, "UNDERTAKER_HANDLE_TIME");
        public final static Property UnitName = new Property(61, String.class, "unitName", false, "UNIT_NAME");
        public final static Property Save_state = new Property(62, int.class, "save_state", false, "SAVE_STATE");
        public final static Property State = new Property(63, int.class, "state", false, "STATE");
        public final static Property StateName = new Property(64, String.class, "stateName", false, "STATE_NAME");
    }


    public TroubleBeanDao(DaoConfig config) {
        super(config);
    }
    
    public TroubleBeanDao(DaoConfig config, DaoSession daoSession) {
        super(config, daoSession);
    }

    /** Creates the underlying database table. */
    public static void createTable(Database db, boolean ifNotExists) {
        String constraint = ifNotExists? "IF NOT EXISTS ": "";
        db.execSQL("CREATE TABLE " + constraint + "\"DB_TROUBLE\" (" + //
                "\"ID\" TEXT PRIMARY KEY NOT NULL UNIQUE ," + // 0: id
                "\"USERID\" TEXT," + // 1: userid
                "\"ADDRESS\" TEXT," + // 2: address
                "\"CURRENT\" INTEGER NOT NULL ," + // 3: current
                "\"DUTY_USER_ID\" TEXT," + // 4: dutyUserId
                "\"DUTY_USER_NAME\" TEXT," + // 5: dutyUserName
                "\"MAINTAINER_USER_ID\" TEXT," + // 6: maintainerUserId
                "\"MAINTAINER_USER_NAME\" TEXT," + // 7: maintainerUserName
                "\"FLAG\" INTEGER NOT NULL ," + // 8: flag
                "\"GIS_USER_ID\" TEXT," + // 9: gisUserId
                "\"HANDLE_STATE\" TEXT," + // 10: handleState
                "\"HANDLE_STATE_NAME\" TEXT," + // 11: handleStateName
                "\"ON_DUTY_USER_ID\" TEXT," + // 12: onDutyUserId
                "\"ON_DUTY_USER_NAME\" TEXT," + // 13: onDutyUserName
                "\"TEMP_HANDLE_PROJECT\" TEXT," + // 14: tempHandleProject
                "\"TEMP_HANDLE_RESULT\" TEXT," + // 15: tempHandleResult
                "\"EVENT_TYPE\" INTEGER NOT NULL ," + // 16: eventType
                "\"EVENT_TYPE_NAME\" TEXT," + // 17: eventTypeName
                "\"PROCESS_ID\" INTEGER NOT NULL ," + // 18: processId
                "\"PROCESS_NAME\" TEXT," + // 19: processName
                "\"PROCESS_ID2\" TEXT," + // 20: processId2
                "\"REPORT_USER_ID\" TEXT," + // 21: reportUserId
                "\"REPORT_USER_NAME\" TEXT," + // 22: reportUserName
                "\"REPORT_TIME\" TEXT," + // 23: reportTime
                "\"TROUBLE_INFO\" TEXT," + // 24: troubleInfo
                "\"TROUBLE_NAME\" TEXT," + // 25: troubleName
                "\"UPLOAD_TYPE\" INTEGER NOT NULL ," + // 26: uploadType
                "\"UPLOAD_TYPE_NAME\" TEXT," + // 27: uploadTypeName
                "\"DEPT_ID\" TEXT," + // 28: deptId
                "\"DEPT_NAME\" TEXT," + // 29: deptName
                "\"DIRECTOR\" TEXT," + // 30: director
                "\"DIRECTOR_NAME\" TEXT," + // 31: directorName
                "\"DEVICE_INFO\" TEXT," + // 32: deviceInfo
                "\"DEVICE_INFO_DESC\" TEXT," + // 33: deviceInfoDesc
                "\"FIND_TIME\" TEXT," + // 34: findTime
                "\"FIND_USERID\" TEXT," + // 35: findUserid
                "\"FIND_USER_NAME\" TEXT," + // 36: findUserName
                "\"GIS_USER_NAME\" TEXT," + // 37: gisUserName
                "\"LEVEL_ID\" TEXT," + // 38: levelId
                "\"LEVEL_NAME\" TEXT," + // 39: levelName
                "\"LOCATION_X\" TEXT," + // 40: locationX
                "\"LOCATION_Y\" TEXT," + // 41: locationY
                "\"NOTES\" TEXT," + // 42: notes
                "\"PIPE_INFO\" TEXT," + // 43: pipeInfo
                "\"PIPE_INFO_DESC\" TEXT," + // 44: pipeInfoDesc
                "\"SECRETARY_USERID\" TEXT," + // 45: secretaryUserid
                "\"TROUBLE_TYPE_ID\" TEXT," + // 46: troubleTypeId
                "\"TROUBLE_TYPE_NAME\" TEXT," + // 47: troubleTypeName
                "\"UNDERSECRETARY_USERID\" TEXT," + // 48: undersecretaryUserid
                "\"UNDERSECRETARY_USER_NAME\" TEXT," + // 49: undersecretaryUserName
                "\"UNDERSECRETARY_CHECK_NOTES\" TEXT," + // 50: undersecretaryCheckNotes
                "\"UNDERSECRETARY_CHECK_TIME\" TEXT," + // 51: undersecretaryCheckTime
                "\"UNDERSECRETARY_STATE_NAME\" TEXT," + // 52: undersecretaryStateName
                "\"UNDERTAKER_USERID\" TEXT," + // 53: undertakerUserid
                "\"UNDERTAKER_USER_NAME\" TEXT," + // 54: undertakerUserName
                "\"UNDERTAKER_CHECK_NOTES\" TEXT," + // 55: undertakerCheckNotes
                "\"UNDERTAKER_CHECK_TIME\" TEXT," + // 56: undertakerCheckTime
                "\"UNDERTAKER_HANDLE_USER_ID\" TEXT," + // 57: undertakerHandleUserId
                "\"UNDERTAKER_HANDLE_USER_NAME\" TEXT," + // 58: undertakerHandleUserName
                "\"UNDERTAKER_HANDLE_NOTES\" TEXT," + // 59: undertakerHandleNotes
                "\"UNDERTAKER_HANDLE_TIME\" TEXT," + // 60: undertakerHandleTime
                "\"UNIT_NAME\" TEXT," + // 61: unitName
                "\"SAVE_STATE\" INTEGER NOT NULL ," + // 62: save_state
                "\"STATE\" INTEGER NOT NULL ," + // 63: state
                "\"STATE_NAME\" TEXT);"); // 64: stateName
    }

    /** Drops the underlying database table. */
    public static void dropTable(Database db, boolean ifExists) {
        String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"DB_TROUBLE\"";
        db.execSQL(sql);
    }

    @Override
    protected final void bindValues(DatabaseStatement stmt, TroubleBean entity) {
        stmt.clearBindings();
        stmt.bindString(1, entity.getId());
 
        String userid = entity.getUserid();
        if (userid != null) {
            stmt.bindString(2, userid);
        }
 
        String address = entity.getAddress();
        if (address != null) {
            stmt.bindString(3, address);
        }
        stmt.bindLong(4, entity.getCurrent());
 
        String dutyUserId = entity.getDutyUserId();
        if (dutyUserId != null) {
            stmt.bindString(5, dutyUserId);
        }
 
        String dutyUserName = entity.getDutyUserName();
        if (dutyUserName != null) {
            stmt.bindString(6, dutyUserName);
        }
 
        String maintainerUserId = entity.getMaintainerUserId();
        if (maintainerUserId != null) {
            stmt.bindString(7, maintainerUserId);
        }
 
        String maintainerUserName = entity.getMaintainerUserName();
        if (maintainerUserName != null) {
            stmt.bindString(8, maintainerUserName);
        }
        stmt.bindLong(9, entity.getFlag());
 
        String gisUserId = entity.getGisUserId();
        if (gisUserId != null) {
            stmt.bindString(10, gisUserId);
        }
 
        String handleState = entity.getHandleState();
        if (handleState != null) {
            stmt.bindString(11, handleState);
        }
 
        String handleStateName = entity.getHandleStateName();
        if (handleStateName != null) {
            stmt.bindString(12, handleStateName);
        }
 
        String onDutyUserId = entity.getOnDutyUserId();
        if (onDutyUserId != null) {
            stmt.bindString(13, onDutyUserId);
        }
 
        String onDutyUserName = entity.getOnDutyUserName();
        if (onDutyUserName != null) {
            stmt.bindString(14, onDutyUserName);
        }
 
        String tempHandleProject = entity.getTempHandleProject();
        if (tempHandleProject != null) {
            stmt.bindString(15, tempHandleProject);
        }
 
        String tempHandleResult = entity.getTempHandleResult();
        if (tempHandleResult != null) {
            stmt.bindString(16, tempHandleResult);
        }
        stmt.bindLong(17, entity.getEventType());
 
        String eventTypeName = entity.getEventTypeName();
        if (eventTypeName != null) {
            stmt.bindString(18, eventTypeName);
        }
        stmt.bindLong(19, entity.getProcessId());
 
        String processName = entity.getProcessName();
        if (processName != null) {
            stmt.bindString(20, processName);
        }
 
        String processId2 = entity.getProcessId2();
        if (processId2 != null) {
            stmt.bindString(21, processId2);
        }
 
        String reportUserId = entity.getReportUserId();
        if (reportUserId != null) {
            stmt.bindString(22, reportUserId);
        }
 
        String reportUserName = entity.getReportUserName();
        if (reportUserName != null) {
            stmt.bindString(23, reportUserName);
        }
 
        String reportTime = entity.getReportTime();
        if (reportTime != null) {
            stmt.bindString(24, reportTime);
        }
 
        String troubleInfo = entity.getTroubleInfo();
        if (troubleInfo != null) {
            stmt.bindString(25, troubleInfo);
        }
 
        String troubleName = entity.getTroubleName();
        if (troubleName != null) {
            stmt.bindString(26, troubleName);
        }
        stmt.bindLong(27, entity.getUploadType());
 
        String uploadTypeName = entity.getUploadTypeName();
        if (uploadTypeName != null) {
            stmt.bindString(28, uploadTypeName);
        }
 
        String deptId = entity.getDeptId();
        if (deptId != null) {
            stmt.bindString(29, deptId);
        }
 
        String deptName = entity.getDeptName();
        if (deptName != null) {
            stmt.bindString(30, deptName);
        }
 
        String director = entity.getDirector();
        if (director != null) {
            stmt.bindString(31, director);
        }
 
        String directorName = entity.getDirectorName();
        if (directorName != null) {
            stmt.bindString(32, directorName);
        }
 
        String deviceInfo = entity.getDeviceInfo();
        if (deviceInfo != null) {
            stmt.bindString(33, deviceInfo);
        }
 
        String deviceInfoDesc = entity.getDeviceInfoDesc();
        if (deviceInfoDesc != null) {
            stmt.bindString(34, deviceInfoDesc);
        }
 
        String findTime = entity.getFindTime();
        if (findTime != null) {
            stmt.bindString(35, findTime);
        }
 
        String findUserid = entity.getFindUserid();
        if (findUserid != null) {
            stmt.bindString(36, findUserid);
        }
 
        String findUserName = entity.getFindUserName();
        if (findUserName != null) {
            stmt.bindString(37, findUserName);
        }
 
        String gisUserName = entity.getGisUserName();
        if (gisUserName != null) {
            stmt.bindString(38, gisUserName);
        }
 
        String levelId = entity.getLevelId();
        if (levelId != null) {
            stmt.bindString(39, levelId);
        }
 
        String levelName = entity.getLevelName();
        if (levelName != null) {
            stmt.bindString(40, levelName);
        }
 
        String locationX = entity.getLocationX();
        if (locationX != null) {
            stmt.bindString(41, locationX);
        }
 
        String locationY = entity.getLocationY();
        if (locationY != null) {
            stmt.bindString(42, locationY);
        }
 
        String notes = entity.getNotes();
        if (notes != null) {
            stmt.bindString(43, notes);
        }
 
        String pipeInfo = entity.getPipeInfo();
        if (pipeInfo != null) {
            stmt.bindString(44, pipeInfo);
        }
 
        String pipeInfoDesc = entity.getPipeInfoDesc();
        if (pipeInfoDesc != null) {
            stmt.bindString(45, pipeInfoDesc);
        }
 
        String secretaryUserid = entity.getSecretaryUserid();
        if (secretaryUserid != null) {
            stmt.bindString(46, secretaryUserid);
        }
 
        String troubleTypeId = entity.getTroubleTypeId();
        if (troubleTypeId != null) {
            stmt.bindString(47, troubleTypeId);
        }
 
        String troubleTypeName = entity.getTroubleTypeName();
        if (troubleTypeName != null) {
            stmt.bindString(48, troubleTypeName);
        }
 
        String undersecretaryUserid = entity.getUndersecretaryUserid();
        if (undersecretaryUserid != null) {
            stmt.bindString(49, undersecretaryUserid);
        }
 
        String undersecretaryUserName = entity.getUndersecretaryUserName();
        if (undersecretaryUserName != null) {
            stmt.bindString(50, undersecretaryUserName);
        }
 
        String undersecretaryCheckNotes = entity.getUndersecretaryCheckNotes();
        if (undersecretaryCheckNotes != null) {
            stmt.bindString(51, undersecretaryCheckNotes);
        }
 
        String undersecretaryCheckTime = entity.getUndersecretaryCheckTime();
        if (undersecretaryCheckTime != null) {
            stmt.bindString(52, undersecretaryCheckTime);
        }
 
        String undersecretaryStateName = entity.getUndersecretaryStateName();
        if (undersecretaryStateName != null) {
            stmt.bindString(53, undersecretaryStateName);
        }
 
        String undertakerUserid = entity.getUndertakerUserid();
        if (undertakerUserid != null) {
            stmt.bindString(54, undertakerUserid);
        }
 
        String undertakerUserName = entity.getUndertakerUserName();
        if (undertakerUserName != null) {
            stmt.bindString(55, undertakerUserName);
        }
 
        String undertakerCheckNotes = entity.getUndertakerCheckNotes();
        if (undertakerCheckNotes != null) {
            stmt.bindString(56, undertakerCheckNotes);
        }
 
        String undertakerCheckTime = entity.getUndertakerCheckTime();
        if (undertakerCheckTime != null) {
            stmt.bindString(57, undertakerCheckTime);
        }
 
        String undertakerHandleUserId = entity.getUndertakerHandleUserId();
        if (undertakerHandleUserId != null) {
            stmt.bindString(58, undertakerHandleUserId);
        }
 
        String undertakerHandleUserName = entity.getUndertakerHandleUserName();
        if (undertakerHandleUserName != null) {
            stmt.bindString(59, undertakerHandleUserName);
        }
 
        String undertakerHandleNotes = entity.getUndertakerHandleNotes();
        if (undertakerHandleNotes != null) {
            stmt.bindString(60, undertakerHandleNotes);
        }
 
        String undertakerHandleTime = entity.getUndertakerHandleTime();
        if (undertakerHandleTime != null) {
            stmt.bindString(61, undertakerHandleTime);
        }
 
        String unitName = entity.getUnitName();
        if (unitName != null) {
            stmt.bindString(62, unitName);
        }
        stmt.bindLong(63, entity.getSave_state());
        stmt.bindLong(64, entity.getState());
 
        String stateName = entity.getStateName();
        if (stateName != null) {
            stmt.bindString(65, stateName);
        }
    }

    @Override
    protected final void bindValues(SQLiteStatement stmt, TroubleBean entity) {
        stmt.clearBindings();
        stmt.bindString(1, entity.getId());
 
        String userid = entity.getUserid();
        if (userid != null) {
            stmt.bindString(2, userid);
        }
 
        String address = entity.getAddress();
        if (address != null) {
            stmt.bindString(3, address);
        }
        stmt.bindLong(4, entity.getCurrent());
 
        String dutyUserId = entity.getDutyUserId();
        if (dutyUserId != null) {
            stmt.bindString(5, dutyUserId);
        }
 
        String dutyUserName = entity.getDutyUserName();
        if (dutyUserName != null) {
            stmt.bindString(6, dutyUserName);
        }
 
        String maintainerUserId = entity.getMaintainerUserId();
        if (maintainerUserId != null) {
            stmt.bindString(7, maintainerUserId);
        }
 
        String maintainerUserName = entity.getMaintainerUserName();
        if (maintainerUserName != null) {
            stmt.bindString(8, maintainerUserName);
        }
        stmt.bindLong(9, entity.getFlag());
 
        String gisUserId = entity.getGisUserId();
        if (gisUserId != null) {
            stmt.bindString(10, gisUserId);
        }
 
        String handleState = entity.getHandleState();
        if (handleState != null) {
            stmt.bindString(11, handleState);
        }
 
        String handleStateName = entity.getHandleStateName();
        if (handleStateName != null) {
            stmt.bindString(12, handleStateName);
        }
 
        String onDutyUserId = entity.getOnDutyUserId();
        if (onDutyUserId != null) {
            stmt.bindString(13, onDutyUserId);
        }
 
        String onDutyUserName = entity.getOnDutyUserName();
        if (onDutyUserName != null) {
            stmt.bindString(14, onDutyUserName);
        }
 
        String tempHandleProject = entity.getTempHandleProject();
        if (tempHandleProject != null) {
            stmt.bindString(15, tempHandleProject);
        }
 
        String tempHandleResult = entity.getTempHandleResult();
        if (tempHandleResult != null) {
            stmt.bindString(16, tempHandleResult);
        }
        stmt.bindLong(17, entity.getEventType());
 
        String eventTypeName = entity.getEventTypeName();
        if (eventTypeName != null) {
            stmt.bindString(18, eventTypeName);
        }
        stmt.bindLong(19, entity.getProcessId());
 
        String processName = entity.getProcessName();
        if (processName != null) {
            stmt.bindString(20, processName);
        }
 
        String processId2 = entity.getProcessId2();
        if (processId2 != null) {
            stmt.bindString(21, processId2);
        }
 
        String reportUserId = entity.getReportUserId();
        if (reportUserId != null) {
            stmt.bindString(22, reportUserId);
        }
 
        String reportUserName = entity.getReportUserName();
        if (reportUserName != null) {
            stmt.bindString(23, reportUserName);
        }
 
        String reportTime = entity.getReportTime();
        if (reportTime != null) {
            stmt.bindString(24, reportTime);
        }
 
        String troubleInfo = entity.getTroubleInfo();
        if (troubleInfo != null) {
            stmt.bindString(25, troubleInfo);
        }
 
        String troubleName = entity.getTroubleName();
        if (troubleName != null) {
            stmt.bindString(26, troubleName);
        }
        stmt.bindLong(27, entity.getUploadType());
 
        String uploadTypeName = entity.getUploadTypeName();
        if (uploadTypeName != null) {
            stmt.bindString(28, uploadTypeName);
        }
 
        String deptId = entity.getDeptId();
        if (deptId != null) {
            stmt.bindString(29, deptId);
        }
 
        String deptName = entity.getDeptName();
        if (deptName != null) {
            stmt.bindString(30, deptName);
        }
 
        String director = entity.getDirector();
        if (director != null) {
            stmt.bindString(31, director);
        }
 
        String directorName = entity.getDirectorName();
        if (directorName != null) {
            stmt.bindString(32, directorName);
        }
 
        String deviceInfo = entity.getDeviceInfo();
        if (deviceInfo != null) {
            stmt.bindString(33, deviceInfo);
        }
 
        String deviceInfoDesc = entity.getDeviceInfoDesc();
        if (deviceInfoDesc != null) {
            stmt.bindString(34, deviceInfoDesc);
        }
 
        String findTime = entity.getFindTime();
        if (findTime != null) {
            stmt.bindString(35, findTime);
        }
 
        String findUserid = entity.getFindUserid();
        if (findUserid != null) {
            stmt.bindString(36, findUserid);
        }
 
        String findUserName = entity.getFindUserName();
        if (findUserName != null) {
            stmt.bindString(37, findUserName);
        }
 
        String gisUserName = entity.getGisUserName();
        if (gisUserName != null) {
            stmt.bindString(38, gisUserName);
        }
 
        String levelId = entity.getLevelId();
        if (levelId != null) {
            stmt.bindString(39, levelId);
        }
 
        String levelName = entity.getLevelName();
        if (levelName != null) {
            stmt.bindString(40, levelName);
        }
 
        String locationX = entity.getLocationX();
        if (locationX != null) {
            stmt.bindString(41, locationX);
        }
 
        String locationY = entity.getLocationY();
        if (locationY != null) {
            stmt.bindString(42, locationY);
        }
 
        String notes = entity.getNotes();
        if (notes != null) {
            stmt.bindString(43, notes);
        }
 
        String pipeInfo = entity.getPipeInfo();
        if (pipeInfo != null) {
            stmt.bindString(44, pipeInfo);
        }
 
        String pipeInfoDesc = entity.getPipeInfoDesc();
        if (pipeInfoDesc != null) {
            stmt.bindString(45, pipeInfoDesc);
        }
 
        String secretaryUserid = entity.getSecretaryUserid();
        if (secretaryUserid != null) {
            stmt.bindString(46, secretaryUserid);
        }
 
        String troubleTypeId = entity.getTroubleTypeId();
        if (troubleTypeId != null) {
            stmt.bindString(47, troubleTypeId);
        }
 
        String troubleTypeName = entity.getTroubleTypeName();
        if (troubleTypeName != null) {
            stmt.bindString(48, troubleTypeName);
        }
 
        String undersecretaryUserid = entity.getUndersecretaryUserid();
        if (undersecretaryUserid != null) {
            stmt.bindString(49, undersecretaryUserid);
        }
 
        String undersecretaryUserName = entity.getUndersecretaryUserName();
        if (undersecretaryUserName != null) {
            stmt.bindString(50, undersecretaryUserName);
        }
 
        String undersecretaryCheckNotes = entity.getUndersecretaryCheckNotes();
        if (undersecretaryCheckNotes != null) {
            stmt.bindString(51, undersecretaryCheckNotes);
        }
 
        String undersecretaryCheckTime = entity.getUndersecretaryCheckTime();
        if (undersecretaryCheckTime != null) {
            stmt.bindString(52, undersecretaryCheckTime);
        }
 
        String undersecretaryStateName = entity.getUndersecretaryStateName();
        if (undersecretaryStateName != null) {
            stmt.bindString(53, undersecretaryStateName);
        }
 
        String undertakerUserid = entity.getUndertakerUserid();
        if (undertakerUserid != null) {
            stmt.bindString(54, undertakerUserid);
        }
 
        String undertakerUserName = entity.getUndertakerUserName();
        if (undertakerUserName != null) {
            stmt.bindString(55, undertakerUserName);
        }
 
        String undertakerCheckNotes = entity.getUndertakerCheckNotes();
        if (undertakerCheckNotes != null) {
            stmt.bindString(56, undertakerCheckNotes);
        }
 
        String undertakerCheckTime = entity.getUndertakerCheckTime();
        if (undertakerCheckTime != null) {
            stmt.bindString(57, undertakerCheckTime);
        }
 
        String undertakerHandleUserId = entity.getUndertakerHandleUserId();
        if (undertakerHandleUserId != null) {
            stmt.bindString(58, undertakerHandleUserId);
        }
 
        String undertakerHandleUserName = entity.getUndertakerHandleUserName();
        if (undertakerHandleUserName != null) {
            stmt.bindString(59, undertakerHandleUserName);
        }
 
        String undertakerHandleNotes = entity.getUndertakerHandleNotes();
        if (undertakerHandleNotes != null) {
            stmt.bindString(60, undertakerHandleNotes);
        }
 
        String undertakerHandleTime = entity.getUndertakerHandleTime();
        if (undertakerHandleTime != null) {
            stmt.bindString(61, undertakerHandleTime);
        }
 
        String unitName = entity.getUnitName();
        if (unitName != null) {
            stmt.bindString(62, unitName);
        }
        stmt.bindLong(63, entity.getSave_state());
        stmt.bindLong(64, entity.getState());
 
        String stateName = entity.getStateName();
        if (stateName != null) {
            stmt.bindString(65, stateName);
        }
    }

    @Override
    public String readKey(Cursor cursor, int offset) {
        return cursor.getString(offset + 0);
    }    

    @Override
    public TroubleBean readEntity(Cursor cursor, int offset) {
        TroubleBean entity = new TroubleBean( //
            cursor.getString(offset + 0), // id
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userid
            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // address
            cursor.getInt(offset + 3), // current
            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // dutyUserId
            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // dutyUserName
            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // maintainerUserId
            cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // maintainerUserName
            cursor.getInt(offset + 8), // flag
            cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // gisUserId
            cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // handleState
            cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // handleStateName
            cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // onDutyUserId
            cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // onDutyUserName
            cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // tempHandleProject
            cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // tempHandleResult
            cursor.getInt(offset + 16), // eventType
            cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // eventTypeName
            cursor.getInt(offset + 18), // processId
            cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // processName
            cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // processId2
            cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // reportUserId
            cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // reportUserName
            cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // reportTime
            cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // troubleInfo
            cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // troubleName
            cursor.getInt(offset + 26), // uploadType
            cursor.isNull(offset + 27) ? null : cursor.getString(offset + 27), // uploadTypeName
            cursor.isNull(offset + 28) ? null : cursor.getString(offset + 28), // deptId
            cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29), // deptName
            cursor.isNull(offset + 30) ? null : cursor.getString(offset + 30), // director
            cursor.isNull(offset + 31) ? null : cursor.getString(offset + 31), // directorName
            cursor.isNull(offset + 32) ? null : cursor.getString(offset + 32), // deviceInfo
            cursor.isNull(offset + 33) ? null : cursor.getString(offset + 33), // deviceInfoDesc
            cursor.isNull(offset + 34) ? null : cursor.getString(offset + 34), // findTime
            cursor.isNull(offset + 35) ? null : cursor.getString(offset + 35), // findUserid
            cursor.isNull(offset + 36) ? null : cursor.getString(offset + 36), // findUserName
            cursor.isNull(offset + 37) ? null : cursor.getString(offset + 37), // gisUserName
            cursor.isNull(offset + 38) ? null : cursor.getString(offset + 38), // levelId
            cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39), // levelName
            cursor.isNull(offset + 40) ? null : cursor.getString(offset + 40), // locationX
            cursor.isNull(offset + 41) ? null : cursor.getString(offset + 41), // locationY
            cursor.isNull(offset + 42) ? null : cursor.getString(offset + 42), // notes
            cursor.isNull(offset + 43) ? null : cursor.getString(offset + 43), // pipeInfo
            cursor.isNull(offset + 44) ? null : cursor.getString(offset + 44), // pipeInfoDesc
            cursor.isNull(offset + 45) ? null : cursor.getString(offset + 45), // secretaryUserid
            cursor.isNull(offset + 46) ? null : cursor.getString(offset + 46), // troubleTypeId
            cursor.isNull(offset + 47) ? null : cursor.getString(offset + 47), // troubleTypeName
            cursor.isNull(offset + 48) ? null : cursor.getString(offset + 48), // undersecretaryUserid
            cursor.isNull(offset + 49) ? null : cursor.getString(offset + 49), // undersecretaryUserName
            cursor.isNull(offset + 50) ? null : cursor.getString(offset + 50), // undersecretaryCheckNotes
            cursor.isNull(offset + 51) ? null : cursor.getString(offset + 51), // undersecretaryCheckTime
            cursor.isNull(offset + 52) ? null : cursor.getString(offset + 52), // undersecretaryStateName
            cursor.isNull(offset + 53) ? null : cursor.getString(offset + 53), // undertakerUserid
            cursor.isNull(offset + 54) ? null : cursor.getString(offset + 54), // undertakerUserName
            cursor.isNull(offset + 55) ? null : cursor.getString(offset + 55), // undertakerCheckNotes
            cursor.isNull(offset + 56) ? null : cursor.getString(offset + 56), // undertakerCheckTime
            cursor.isNull(offset + 57) ? null : cursor.getString(offset + 57), // undertakerHandleUserId
            cursor.isNull(offset + 58) ? null : cursor.getString(offset + 58), // undertakerHandleUserName
            cursor.isNull(offset + 59) ? null : cursor.getString(offset + 59), // undertakerHandleNotes
            cursor.isNull(offset + 60) ? null : cursor.getString(offset + 60), // undertakerHandleTime
            cursor.isNull(offset + 61) ? null : cursor.getString(offset + 61), // unitName
            cursor.getInt(offset + 62), // save_state
            cursor.getInt(offset + 63), // state
            cursor.isNull(offset + 64) ? null : cursor.getString(offset + 64) // stateName
        );
        return entity;
    }
     
    @Override
    public void readEntity(Cursor cursor, TroubleBean entity, int offset) {
        entity.setId(cursor.getString(offset + 0));
        entity.setUserid(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
        entity.setAddress(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
        entity.setCurrent(cursor.getInt(offset + 3));
        entity.setDutyUserId(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
        entity.setDutyUserName(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
        entity.setMaintainerUserId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
        entity.setMaintainerUserName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
        entity.setFlag(cursor.getInt(offset + 8));
        entity.setGisUserId(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
        entity.setHandleState(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
        entity.setHandleStateName(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
        entity.setOnDutyUserId(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
        entity.setOnDutyUserName(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
        entity.setTempHandleProject(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
        entity.setTempHandleResult(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
        entity.setEventType(cursor.getInt(offset + 16));
        entity.setEventTypeName(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
        entity.setProcessId(cursor.getInt(offset + 18));
        entity.setProcessName(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
        entity.setProcessId2(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
        entity.setReportUserId(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
        entity.setReportUserName(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22));
        entity.setReportTime(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23));
        entity.setTroubleInfo(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24));
        entity.setTroubleName(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25));
        entity.setUploadType(cursor.getInt(offset + 26));
        entity.setUploadTypeName(cursor.isNull(offset + 27) ? null : cursor.getString(offset + 27));
        entity.setDeptId(cursor.isNull(offset + 28) ? null : cursor.getString(offset + 28));
        entity.setDeptName(cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29));
        entity.setDirector(cursor.isNull(offset + 30) ? null : cursor.getString(offset + 30));
        entity.setDirectorName(cursor.isNull(offset + 31) ? null : cursor.getString(offset + 31));
        entity.setDeviceInfo(cursor.isNull(offset + 32) ? null : cursor.getString(offset + 32));
        entity.setDeviceInfoDesc(cursor.isNull(offset + 33) ? null : cursor.getString(offset + 33));
        entity.setFindTime(cursor.isNull(offset + 34) ? null : cursor.getString(offset + 34));
        entity.setFindUserid(cursor.isNull(offset + 35) ? null : cursor.getString(offset + 35));
        entity.setFindUserName(cursor.isNull(offset + 36) ? null : cursor.getString(offset + 36));
        entity.setGisUserName(cursor.isNull(offset + 37) ? null : cursor.getString(offset + 37));
        entity.setLevelId(cursor.isNull(offset + 38) ? null : cursor.getString(offset + 38));
        entity.setLevelName(cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39));
        entity.setLocationX(cursor.isNull(offset + 40) ? null : cursor.getString(offset + 40));
        entity.setLocationY(cursor.isNull(offset + 41) ? null : cursor.getString(offset + 41));
        entity.setNotes(cursor.isNull(offset + 42) ? null : cursor.getString(offset + 42));
        entity.setPipeInfo(cursor.isNull(offset + 43) ? null : cursor.getString(offset + 43));
        entity.setPipeInfoDesc(cursor.isNull(offset + 44) ? null : cursor.getString(offset + 44));
        entity.setSecretaryUserid(cursor.isNull(offset + 45) ? null : cursor.getString(offset + 45));
        entity.setTroubleTypeId(cursor.isNull(offset + 46) ? null : cursor.getString(offset + 46));
        entity.setTroubleTypeName(cursor.isNull(offset + 47) ? null : cursor.getString(offset + 47));
        entity.setUndersecretaryUserid(cursor.isNull(offset + 48) ? null : cursor.getString(offset + 48));
        entity.setUndersecretaryUserName(cursor.isNull(offset + 49) ? null : cursor.getString(offset + 49));
        entity.setUndersecretaryCheckNotes(cursor.isNull(offset + 50) ? null : cursor.getString(offset + 50));
        entity.setUndersecretaryCheckTime(cursor.isNull(offset + 51) ? null : cursor.getString(offset + 51));
        entity.setUndersecretaryStateName(cursor.isNull(offset + 52) ? null : cursor.getString(offset + 52));
        entity.setUndertakerUserid(cursor.isNull(offset + 53) ? null : cursor.getString(offset + 53));
        entity.setUndertakerUserName(cursor.isNull(offset + 54) ? null : cursor.getString(offset + 54));
        entity.setUndertakerCheckNotes(cursor.isNull(offset + 55) ? null : cursor.getString(offset + 55));
        entity.setUndertakerCheckTime(cursor.isNull(offset + 56) ? null : cursor.getString(offset + 56));
        entity.setUndertakerHandleUserId(cursor.isNull(offset + 57) ? null : cursor.getString(offset + 57));
        entity.setUndertakerHandleUserName(cursor.isNull(offset + 58) ? null : cursor.getString(offset + 58));
        entity.setUndertakerHandleNotes(cursor.isNull(offset + 59) ? null : cursor.getString(offset + 59));
        entity.setUndertakerHandleTime(cursor.isNull(offset + 60) ? null : cursor.getString(offset + 60));
        entity.setUnitName(cursor.isNull(offset + 61) ? null : cursor.getString(offset + 61));
        entity.setSave_state(cursor.getInt(offset + 62));
        entity.setState(cursor.getInt(offset + 63));
        entity.setStateName(cursor.isNull(offset + 64) ? null : cursor.getString(offset + 64));
     }
    
    @Override
    protected final String updateKeyAfterInsert(TroubleBean entity, long rowId) {
        return entity.getId();
    }
    
    @Override
    public String getKey(TroubleBean entity) {
        if(entity != null) {
            return entity.getId();
        } else {
            return null;
        }
    }

    @Override
    public boolean hasKey(TroubleBean entity) {
        throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
    }

    @Override
    protected final boolean isEntityUpdateable() {
        return true;
    }
    
}
