import { FieldInfo } from 'model-util-base'
import { ConditionUtil, ConditionUtilImpl, FieldUtil, TableUtilImpl, IdType, JoinTable, SubTable } from 'model-util'
import { Container, Singleton } from 'typescript-ioc' 
import { AdMaterialType } from '../models/index' 
/**
 * @author auto generate
 * @version 1.1
 * @date 2021-06-07 15:15
 */
interface AdMaterialTypeCU extends ConditionUtil<AdMaterialTypeCU>{
    CODE:FieldUtil<AdMaterialTypeCU>;
    NAME:FieldUtil<AdMaterialTypeCU>;
    DEL_FLAG:FieldUtil<AdMaterialTypeCU>;
}

class AdMaterialTypeCUImpl extends ConditionUtilImpl<AdMaterialTypeCUImpl> implements AdMaterialTypeCU{ 
    newInstance(): AdMaterialTypeCUImpl {
        return new AdMaterialTypeCUImpl();
    } 
    get CODE(): FieldUtil<AdMaterialTypeCU>{  
        return new FieldUtil('code','code','素材类型', this);
    }
    get NAME(): FieldUtil<AdMaterialTypeCU>{  
        return new FieldUtil('name','name','素材类型名称', this);
    }
    get DEL_FLAG(): FieldUtil<AdMaterialTypeCU>{  
        return new FieldUtil('del_flag','delFlag','是否删除', this);
    }
}

@Singleton 
class AdMaterialTypeMU extends TableUtilImpl<AdMaterialTypeCU,AdMaterialType>{ 
    tableName  = 'ad_material_type';
    tableFields  = ['code','name','del_flag'];
    modelFields  = ['code','name','delFlag'];
    modelIdFields  = ['code'];
    tableIdFields  = ['code'];
    idType = IdType.CUSTOM;
    joinTables = [];
    subTables = [];

    createConditionUtil(): AdMaterialTypeCU {
        return new AdMaterialTypeCUImpl();
    }   

    static get CODE(): FieldUtil<AdMaterialTypeCU>{ 
        return new FieldUtil('code','code','素材类型', new AdMaterialTypeCUImpl());
    }
    static get NAME(): FieldUtil<AdMaterialTypeCU>{ 
        return new FieldUtil('name','name','素材类型名称', new AdMaterialTypeCUImpl());
    }
    static get DEL_FLAG(): FieldUtil<AdMaterialTypeCU>{ 
        return new FieldUtil('del_flag','delFlag','是否删除', new AdMaterialTypeCUImpl());
    }

    get CODE(): FieldUtil<AdMaterialTypeCU>{ 
        return AdMaterialTypeMU.CODE;
    }
    get NAME(): FieldUtil<AdMaterialTypeCU>{ 
        return AdMaterialTypeMU.NAME;
    }
    get DEL_FLAG(): FieldUtil<AdMaterialTypeCU>{ 
        return AdMaterialTypeMU.DEL_FLAG;
    }
}
export {AdMaterialTypeMU, AdMaterialTypeCU}
