import {ModelUtil, ModelUtilImpl, ConditionUtil, ConditionUtilImpl, FieldUtil } from 'model-util'
import {Container, Singleton} from 'typescript-ioc' 
import { PpUserLocalAuthUnionPpUserV3 } from '../models/index' 


/**
 * @author auto generate
 * @version 1.2
 * @date 2021-08-18 09:25
 */
interface PpUserLocalAuthUnionPpUserV3CU extends ConditionUtil<PpUserLocalAuthUnionPpUserV3CU>{
    USERID:FieldUtil<PpUserLocalAuthUnionPpUserV3CU>;
    PHONE:FieldUtil<PpUserLocalAuthUnionPpUserV3CU>;
    COMMONLPN:FieldUtil<PpUserLocalAuthUnionPpUserV3CU>;
    CREATETIME:FieldUtil<PpUserLocalAuthUnionPpUserV3CU>;
}

class PpUserLocalAuthUnionPpUserV3CUImpl extends ConditionUtilImpl<PpUserLocalAuthUnionPpUserV3CUImpl> implements PpUserLocalAuthUnionPpUserV3CU{ 
    newInstance(): PpUserLocalAuthUnionPpUserV3CUImpl {
        return new PpUserLocalAuthUnionPpUserV3CUImpl();
    } 
    get USERID(): FieldUtil<PpUserLocalAuthUnionPpUserV3CU>{  
        return new FieldUtil('userId','userid','userId', this);
    }
    get PHONE(): FieldUtil<PpUserLocalAuthUnionPpUserV3CU>{  
        return new FieldUtil('phone','phone','phone', this);
    }
    get COMMONLPN(): FieldUtil<PpUserLocalAuthUnionPpUserV3CU>{  
        return new FieldUtil('commonLpn','commonlpn','commonLpn', this);
    }
    get CREATETIME(): FieldUtil<PpUserLocalAuthUnionPpUserV3CU>{  
        return new FieldUtil('createTime','createtime','createTime', this);
    }
}

@Singleton
class PpUserLocalAuthUnionPpUserV3MU extends ModelUtilImpl<PpUserLocalAuthUnionPpUserV3CU,PpUserLocalAuthUnionPpUserV3>{ 
    joinTables = [];
    selectSQL ='SELECT pula.PP_USER_ID AS userId, pula.PHONE AS phone, ifnull(puv.COMMON_LPN, "") AS commonLpn,pula.CREAT_TIME AS createTime FROM pp_user_local_auth pula LEFT JOIN pp_user_v3 puv ON (puv.ID =pula.PP_USER_ID) ';
    tableFields  = ['userId','phone','commonLpn','createTime'];
    modelFields  = ['userid','phone','commonlpn','createtime'];

    createConditionUtil(): PpUserLocalAuthUnionPpUserV3CU {
        return new PpUserLocalAuthUnionPpUserV3CUImpl();
    }   

    static get USERID(): FieldUtil<PpUserLocalAuthUnionPpUserV3CU>{ 
        return new FieldUtil('userId','userid','userId', new PpUserLocalAuthUnionPpUserV3CUImpl());
    }
    static get PHONE(): FieldUtil<PpUserLocalAuthUnionPpUserV3CU>{ 
        return new FieldUtil('phone','phone','phone', new PpUserLocalAuthUnionPpUserV3CUImpl());
    }
    static get COMMONLPN(): FieldUtil<PpUserLocalAuthUnionPpUserV3CU>{ 
        return new FieldUtil('commonLpn','commonlpn','commonLpn', new PpUserLocalAuthUnionPpUserV3CUImpl());
    }
    static get CREATETIME(): FieldUtil<PpUserLocalAuthUnionPpUserV3CU>{ 
        return new FieldUtil('createTime','createtime','createTime', new PpUserLocalAuthUnionPpUserV3CUImpl());
    }

    get USERID(): FieldUtil<PpUserLocalAuthUnionPpUserV3CU>{ 
        return PpUserLocalAuthUnionPpUserV3MU.USERID;
    }
    get PHONE(): FieldUtil<PpUserLocalAuthUnionPpUserV3CU>{ 
        return PpUserLocalAuthUnionPpUserV3MU.PHONE;
    }
    get COMMONLPN(): FieldUtil<PpUserLocalAuthUnionPpUserV3CU>{ 
        return PpUserLocalAuthUnionPpUserV3MU.COMMONLPN;
    }
    get CREATETIME(): FieldUtil<PpUserLocalAuthUnionPpUserV3CU>{ 
        return PpUserLocalAuthUnionPpUserV3MU.CREATETIME;
    }
}
export {PpUserLocalAuthUnionPpUserV3MU, PpUserLocalAuthUnionPpUserV3CU}
