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

import {Ad_position_styleMU} from './Ad_position_style' 


/**
 * @author auto generate
 * @version 1.0
 * @date 2021-04-15 16:40
 */
interface Ad_styleCU extends ConditionUtil<Ad_styleCU>{
    ID:FieldUtil<Ad_styleCU>;
    AD_POSTION_TYPE:FieldUtil<Ad_styleCU>;
    WIDTH:FieldUtil<Ad_styleCU>;
    HEIGHT:FieldUtil<Ad_styleCU>;
    TYPE:FieldUtil<Ad_styleCU>;
    STATUS:FieldUtil<Ad_styleCU>;
    CREATE_TIME:FieldUtil<Ad_styleCU>;
    CREATOR:FieldUtil<Ad_styleCU>;
    UPDATE_TIME:FieldUtil<Ad_styleCU>;
    UPDATOR:FieldUtil<Ad_styleCU>;
}

class Ad_styleCUImpl extends ConditionUtilImpl<Ad_styleCUImpl> implements Ad_styleCU{ 
    newInstance(): Ad_styleCUImpl {
        return new Ad_styleCUImpl();
    } 
    get ID(): FieldUtil<Ad_styleCU>{  
        return new FieldUtil('ID','id','主键id', this);
    }
    get AD_POSTION_TYPE(): FieldUtil<Ad_styleCU>{  
        return new FieldUtil('AD_POSTION_TYPE','adPostionType','广告位类型', this);
    }
    get WIDTH(): FieldUtil<Ad_styleCU>{  
        return new FieldUtil('WIDTH','width','宽度（单位像素）', this);
    }
    get HEIGHT(): FieldUtil<Ad_styleCU>{  
        return new FieldUtil('HEIGHT','height','高度（单位像素）', this);
    }
    get TYPE(): FieldUtil<Ad_styleCU>{  
        return new FieldUtil('TYPE','type','类型：0，单图', this);
    }
    get STATUS(): FieldUtil<Ad_styleCU>{  
        return new FieldUtil('STATUS','status','状态：0，启用；1，删除', this);
    }
    get CREATE_TIME(): FieldUtil<Ad_styleCU>{  
        return new FieldUtil('CREATE_TIME','createTime','', this);
    }
    get CREATOR(): FieldUtil<Ad_styleCU>{  
        return new FieldUtil('CREATOR','creator','', this);
    }
    get UPDATE_TIME(): FieldUtil<Ad_styleCU>{  
        return new FieldUtil('UPDATE_TIME','updateTime','', this);
    }
    get UPDATOR(): FieldUtil<Ad_styleCU>{  
        return new FieldUtil('UPDATOR','updator','', this);
    }
}

@Singleton 
class Ad_styleMU extends TableUtilImpl<Ad_styleCU,Ad_style>{ 
    tableName  = 'ad_style';
    tableFields  = ['id','ad_postion_type','width','height','type','status','create_time','creator','update_time','updator'];
    modelFields  = ['id','adPostionType','width','height','type','status','createTime','creator','updateTime','updator'];
    modelIdFields  = ['id'];
    tableIdFields  = ['id'];
    idType = IdType.CUSTOM;
    joinTables = [];
    subTables = [{
            name: 'ad_position_style',
            parentIdFields: [Ad_styleMU.ID],
            foreignKeyFields: [Ad_position_styleMU.AD_STYLE_ID],
            getTableUtil: ()=>{
                return Container.get(Ad_position_styleMU);
            }
        } as SubTable

];

    createConditionUtil(): Ad_styleCU {
        return new Ad_styleCUImpl();
    }   

    static get ID(): FieldUtil<Ad_styleCU>{ 
        return new FieldUtil('ID','id','主键id', new Ad_styleCUImpl());
    }
    static get AD_POSTION_TYPE(): FieldUtil<Ad_styleCU>{ 
        return new FieldUtil('AD_POSTION_TYPE','adPostionType','广告位类型', new Ad_styleCUImpl());
    }
    static get WIDTH(): FieldUtil<Ad_styleCU>{ 
        return new FieldUtil('WIDTH','width','宽度（单位像素）', new Ad_styleCUImpl());
    }
    static get HEIGHT(): FieldUtil<Ad_styleCU>{ 
        return new FieldUtil('HEIGHT','height','高度（单位像素）', new Ad_styleCUImpl());
    }
    static get TYPE(): FieldUtil<Ad_styleCU>{ 
        return new FieldUtil('TYPE','type','类型：0，单图', new Ad_styleCUImpl());
    }
    static get STATUS(): FieldUtil<Ad_styleCU>{ 
        return new FieldUtil('STATUS','status','状态：0，启用；1，删除', new Ad_styleCUImpl());
    }
    static get CREATE_TIME(): FieldUtil<Ad_styleCU>{ 
        return new FieldUtil('CREATE_TIME','createTime','', new Ad_styleCUImpl());
    }
    static get CREATOR(): FieldUtil<Ad_styleCU>{ 
        return new FieldUtil('CREATOR','creator','', new Ad_styleCUImpl());
    }
    static get UPDATE_TIME(): FieldUtil<Ad_styleCU>{ 
        return new FieldUtil('UPDATE_TIME','updateTime','', new Ad_styleCUImpl());
    }
    static get UPDATOR(): FieldUtil<Ad_styleCU>{ 
        return new FieldUtil('UPDATOR','updator','', new Ad_styleCUImpl());
    }

    get ID(): FieldUtil<Ad_styleCU>{ 
        return Ad_styleMU.ID;
    }
    get AD_POSTION_TYPE(): FieldUtil<Ad_styleCU>{ 
        return Ad_styleMU.AD_POSTION_TYPE;
    }
    get WIDTH(): FieldUtil<Ad_styleCU>{ 
        return Ad_styleMU.WIDTH;
    }
    get HEIGHT(): FieldUtil<Ad_styleCU>{ 
        return Ad_styleMU.HEIGHT;
    }
    get TYPE(): FieldUtil<Ad_styleCU>{ 
        return Ad_styleMU.TYPE;
    }
    get STATUS(): FieldUtil<Ad_styleCU>{ 
        return Ad_styleMU.STATUS;
    }
    get CREATE_TIME(): FieldUtil<Ad_styleCU>{ 
        return Ad_styleMU.CREATE_TIME;
    }
    get CREATOR(): FieldUtil<Ad_styleCU>{ 
        return Ad_styleMU.CREATOR;
    }
    get UPDATE_TIME(): FieldUtil<Ad_styleCU>{ 
        return Ad_styleMU.UPDATE_TIME;
    }
    get UPDATOR(): FieldUtil<Ad_styleCU>{ 
        return Ad_styleMU.UPDATOR;
    }
}
export {Ad_styleMU, Ad_styleCU}
