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

import {PayConfigMU} from './PayConfig' 


/**
 * @author auto generate
 * @version 1.0
 * @date 2020-10-16 11:27
 */
interface PayParkConfigCU extends ConditionUtil<PayParkConfigCU>{
    ID:FieldUtil<PayParkConfigCU>;
    PARK_ID:FieldUtil<PayParkConfigCU>;
    PAY_CONFIG_ID:FieldUtil<PayParkConfigCU>;
    REMARK:FieldUtil<PayParkConfigCU>;
    STATE:FieldUtil<PayParkConfigCU>;
    CREATE_TIME:FieldUtil<PayParkConfigCU>;
    UPDATE_TIME:FieldUtil<PayParkConfigCU>;
}

class PayParkConfigCUImpl extends ConditionUtilImpl<PayParkConfigCUImpl> implements PayParkConfigCU{ 
    newInstance(): PayParkConfigCUImpl {
        return new PayParkConfigCUImpl();
    } 
    get ID(): FieldUtil<PayParkConfigCU>{  
        return new FieldUtil('ID','id','', this);
    }
    get PARK_ID(): FieldUtil<PayParkConfigCU>{  
        return new FieldUtil('PARK_ID','parkId','车场ID', this);
    }
    get PAY_CONFIG_ID(): FieldUtil<PayParkConfigCU>{  
        return new FieldUtil('PAY_CONFIG_ID','payConfigId','支付配置ID', this);
    }
    get REMARK(): FieldUtil<PayParkConfigCU>{  
        return new FieldUtil('REMARK','remark','备注', this);
    }
    get STATE(): FieldUtil<PayParkConfigCU>{  
        return new FieldUtil('STATE','state','状态：0-正常，1-删除', this);
    }
    get CREATE_TIME(): FieldUtil<PayParkConfigCU>{  
        return new FieldUtil('CREATE_TIME','createTime','创建时间', this);
    }
    get UPDATE_TIME(): FieldUtil<PayParkConfigCU>{  
        return new FieldUtil('UPDATE_TIME','updateTime','更新时间', this);
    }
}

@Singleton 
class PayParkConfigMU extends TableUtilImpl<PayParkConfigCU,PayParkConfig>{ 
    tableName  = 'pay_park_config';
    tableFields  = ['id','park_id','pay_config_id','remark','state','create_time','update_time'];
    modelFields  = ['id','parkId','payConfigId','remark','state','createTime','updateTime'];
    modelIdFields  = ['id'];
    tableIdFields  = ['id'];
    idType = IdType.CUSTOM;
    joinTables = [];
    subTables = [{
            name: 'payConfig',
            parentIdFields: [PayParkConfigMU.PAY_CONFIG_ID],
            foreignKeyFields: [PayConfigMU.ID],
            getTableUtil: ()=>{
                return Container.get(PayConfigMU);
            }
        } as SubTable

];

    createConditionUtil(): PayParkConfigCU {
        return new PayParkConfigCUImpl();
    }   

    static get ID(): FieldUtil<PayParkConfigCU>{ 
        return new FieldUtil('ID','id','', new PayParkConfigCUImpl());
    }
    static get PARK_ID(): FieldUtil<PayParkConfigCU>{ 
        return new FieldUtil('PARK_ID','parkId','车场ID', new PayParkConfigCUImpl());
    }
    static get PAY_CONFIG_ID(): FieldUtil<PayParkConfigCU>{ 
        return new FieldUtil('PAY_CONFIG_ID','payConfigId','支付配置ID', new PayParkConfigCUImpl());
    }
    static get REMARK(): FieldUtil<PayParkConfigCU>{ 
        return new FieldUtil('REMARK','remark','备注', new PayParkConfigCUImpl());
    }
    static get STATE(): FieldUtil<PayParkConfigCU>{ 
        return new FieldUtil('STATE','state','状态：0-正常，1-删除', new PayParkConfigCUImpl());
    }
    static get CREATE_TIME(): FieldUtil<PayParkConfigCU>{ 
        return new FieldUtil('CREATE_TIME','createTime','创建时间', new PayParkConfigCUImpl());
    }
    static get UPDATE_TIME(): FieldUtil<PayParkConfigCU>{ 
        return new FieldUtil('UPDATE_TIME','updateTime','更新时间', new PayParkConfigCUImpl());
    }

    get ID(): FieldUtil<PayParkConfigCU>{ 
        return PayParkConfigMU.ID;
    }
    get PARK_ID(): FieldUtil<PayParkConfigCU>{ 
        return PayParkConfigMU.PARK_ID;
    }
    get PAY_CONFIG_ID(): FieldUtil<PayParkConfigCU>{ 
        return PayParkConfigMU.PAY_CONFIG_ID;
    }
    get REMARK(): FieldUtil<PayParkConfigCU>{ 
        return PayParkConfigMU.REMARK;
    }
    get STATE(): FieldUtil<PayParkConfigCU>{ 
        return PayParkConfigMU.STATE;
    }
    get CREATE_TIME(): FieldUtil<PayParkConfigCU>{ 
        return PayParkConfigMU.CREATE_TIME;
    }
    get UPDATE_TIME(): FieldUtil<PayParkConfigCU>{ 
        return PayParkConfigMU.UPDATE_TIME;
    }
}
export {PayParkConfigMU, PayParkConfigCU}
