import { FieldInfo } from 'model-util-base'
import { ConditionUtil, ConditionUtilImpl, FieldUtil, TableUtilImpl, IdType, JoinTable, SubTable } from 'model-util'
import { Container, Singleton } from 'typescript-ioc' 
import { PpUserLocalAuth } from '../models/index' 

import {PpUserV3MU} from './PpUserV3' 


/**
 * @author auto generate
 * @version 1.0
 * @date 2021-04-22 15:11
 */
interface PpUserLocalAuthCU extends ConditionUtil<PpUserLocalAuthCU>{
    ACCOUNT_ID:FieldUtil<PpUserLocalAuthCU>;
    PP_USER_ID:FieldUtil<PpUserLocalAuthCU>;
    USER_NAME:FieldUtil<PpUserLocalAuthCU>;
    PASSWORD:FieldUtil<PpUserLocalAuthCU>;
    PHONE:FieldUtil<PpUserLocalAuthCU>;
    CREAT_TIME:FieldUtil<PpUserLocalAuthCU>;
    UPDATE_TIME:FieldUtil<PpUserLocalAuthCU>;
}

class PpUserLocalAuthCUImpl extends ConditionUtilImpl<PpUserLocalAuthCUImpl> implements PpUserLocalAuthCU{ 
    newInstance(): PpUserLocalAuthCUImpl {
        return new PpUserLocalAuthCUImpl();
    } 
    get ACCOUNT_ID(): FieldUtil<PpUserLocalAuthCU>{  
        return new FieldUtil('ACCOUNT_ID','accountId','', this);
    }
    get PP_USER_ID(): FieldUtil<PpUserLocalAuthCU>{  
        return new FieldUtil('PP_USER_ID','ppUserId','', this);
    }
    get USER_NAME(): FieldUtil<PpUserLocalAuthCU>{  
        return new FieldUtil('USER_NAME','userName','', this);
    }
    get PASSWORD(): FieldUtil<PpUserLocalAuthCU>{  
        return new FieldUtil('PASSWORD','password','', this);
    }
    get PHONE(): FieldUtil<PpUserLocalAuthCU>{  
        return new FieldUtil('PHONE','phone','', this);
    }
    get CREAT_TIME(): FieldUtil<PpUserLocalAuthCU>{  
        return new FieldUtil('CREAT_TIME','creatTime','', this);
    }
    get UPDATE_TIME(): FieldUtil<PpUserLocalAuthCU>{  
        return new FieldUtil('UPDATE_TIME','updateTime','', this);
    }
}

@Singleton 
class PpUserLocalAuthMU extends TableUtilImpl<PpUserLocalAuthCU,PpUserLocalAuth>{ 
    tableName  = 'pp_user_local_auth';
    tableFields  = ['ACCOUNT_ID','PP_USER_ID','USER_NAME','PASSWORD','PHONE','CREAT_TIME','UPDATE_TIME'];
    modelFields  = ['accountId','ppUserId','userName','password','phone','creatTime','updateTime'];
    modelIdFields  = ['accountId'];
    tableIdFields  = ['ACCOUNT_ID'];
    idType = IdType.CUSTOM;
    joinTables = [];
    subTables = [{
            name: 'ppUserV3',
            parentIdFields: [PpUserLocalAuthMU.PP_USER_ID],
            foreignKeyFields: [PpUserV3MU.ID],
            getTableUtil: ()=>{
                return Container.get(PpUserV3MU);
            }
        } as SubTable

];

    createConditionUtil(): PpUserLocalAuthCU {
        return new PpUserLocalAuthCUImpl();
    }   

    static get ACCOUNT_ID(): FieldUtil<PpUserLocalAuthCU>{ 
        return new FieldUtil('ACCOUNT_ID','accountId','', new PpUserLocalAuthCUImpl());
    }
    static get PP_USER_ID(): FieldUtil<PpUserLocalAuthCU>{ 
        return new FieldUtil('PP_USER_ID','ppUserId','', new PpUserLocalAuthCUImpl());
    }
    static get USER_NAME(): FieldUtil<PpUserLocalAuthCU>{ 
        return new FieldUtil('USER_NAME','userName','', new PpUserLocalAuthCUImpl());
    }
    static get PASSWORD(): FieldUtil<PpUserLocalAuthCU>{ 
        return new FieldUtil('PASSWORD','password','', new PpUserLocalAuthCUImpl());
    }
    static get PHONE(): FieldUtil<PpUserLocalAuthCU>{ 
        return new FieldUtil('PHONE','phone','', new PpUserLocalAuthCUImpl());
    }
    static get CREAT_TIME(): FieldUtil<PpUserLocalAuthCU>{ 
        return new FieldUtil('CREAT_TIME','creatTime','', new PpUserLocalAuthCUImpl());
    }
    static get UPDATE_TIME(): FieldUtil<PpUserLocalAuthCU>{ 
        return new FieldUtil('UPDATE_TIME','updateTime','', new PpUserLocalAuthCUImpl());
    }

    get ACCOUNT_ID(): FieldUtil<PpUserLocalAuthCU>{ 
        return PpUserLocalAuthMU.ACCOUNT_ID;
    }
    get PP_USER_ID(): FieldUtil<PpUserLocalAuthCU>{ 
        return PpUserLocalAuthMU.PP_USER_ID;
    }
    get USER_NAME(): FieldUtil<PpUserLocalAuthCU>{ 
        return PpUserLocalAuthMU.USER_NAME;
    }
    get PASSWORD(): FieldUtil<PpUserLocalAuthCU>{ 
        return PpUserLocalAuthMU.PASSWORD;
    }
    get PHONE(): FieldUtil<PpUserLocalAuthCU>{ 
        return PpUserLocalAuthMU.PHONE;
    }
    get CREAT_TIME(): FieldUtil<PpUserLocalAuthCU>{ 
        return PpUserLocalAuthMU.CREAT_TIME;
    }
    get UPDATE_TIME(): FieldUtil<PpUserLocalAuthCU>{ 
        return PpUserLocalAuthMU.UPDATE_TIME;
    }
}
export {PpUserLocalAuthMU, PpUserLocalAuthCU}
