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_position_style } from '../models/index' 

import {Ad_styleMU} from './Ad_style' 


/**
 * @author auto generate
 * @version 1.0
 * @date 2021-04-19 14:33
 */
interface Ad_position_styleCU extends ConditionUtil<Ad_position_styleCU>{
    AD_POSITION_ID:FieldUtil<Ad_position_styleCU>;
    AD_STYLE_ID:FieldUtil<Ad_position_styleCU>;
    DEL_FLAG:FieldUtil<Ad_position_styleCU>;
}

class Ad_position_styleCUImpl extends ConditionUtilImpl<Ad_position_styleCUImpl> implements Ad_position_styleCU{ 
    newInstance(): Ad_position_styleCUImpl {
        return new Ad_position_styleCUImpl();
    } 
    get AD_POSITION_ID(): FieldUtil<Ad_position_styleCU>{  
        return new FieldUtil('AD_POSITION_ID','adPositionId','广告位置表id', this);
    }
    get AD_STYLE_ID(): FieldUtil<Ad_position_styleCU>{  
        return new FieldUtil('AD_STYLE_ID','adStyleId','广告样式表id', this);
    }
    get DEL_FLAG(): FieldUtil<Ad_position_styleCU>{  
        return new FieldUtil('DEL_FLAG','delFlag','是否删除：0，否；1，是', this);
    }
    get ID(): FieldInfo{  
        return new FieldInfo('id','主键id');
    }
    get AD_POSTION_TYPE(): FieldInfo{  
        return new FieldInfo('adPostionType','广告位类型');
    }
    get WIDTH(): FieldInfo{  
        return new FieldInfo('width','宽度（单位像素）');
    }
    get HEIGHT(): FieldInfo{  
        return new FieldInfo('height','高度（单位像素）');
    }
    get TYPE(): FieldInfo{  
        return new FieldInfo('type','类型：0，单图');
    }
    get STATUS(): FieldInfo{  
        return new FieldInfo('status','状态：0，启用；1，删除');
    }
    get CREATE_TIME(): FieldInfo{  
        return new FieldInfo('createTime','');
    }
    get CREATOR(): FieldInfo{  
        return new FieldInfo('creator','');
    }
    get UPDATE_TIME(): FieldInfo{  
        return new FieldInfo('updateTime','');
    }
    get UPDATOR(): FieldInfo{  
        return new FieldInfo('updator','');
    }
}

@Singleton 
class Ad_position_styleMU extends TableUtilImpl<Ad_position_styleCU,Ad_position_style>{ 
    tableName  = 'ad_position_style';
    tableFields  = ['ad_position_id','ad_style_id','del_flag'];
    modelFields  = ['adPositionId','adStyleId','delFlag','id','adPostionType','width','height','type','status','createTime','creator','updateTime','updator'];
    modelIdFields  = ['adPositionId','adStyleId'];
    tableIdFields  = ['ad_position_id','ad_style_id'];
    idType = IdType.CUSTOM;
    joinTables = [{
            joinByDefault: false,
            foreignKeyFields: [Ad_position_styleMU.AD_STYLE_ID],
            joinIdFields: [Ad_styleMU.ID],
            getTableUtil: ()=>{
                return Container.get(Ad_styleMU);
            },
            fields: [
                {
                    fieldUtil: Ad_styleMU.ID,
                    alias: 'id'
                }
                ,{
                    fieldUtil: Ad_styleMU.AD_POSTION_TYPE,
                    alias: 'adPostionType'
                }
                ,{
                    fieldUtil: Ad_styleMU.WIDTH,
                    alias: 'width'
                }
                ,{
                    fieldUtil: Ad_styleMU.HEIGHT,
                    alias: 'height'
                }
                ,{
                    fieldUtil: Ad_styleMU.TYPE,
                    alias: 'type'
                }
                ,{
                    fieldUtil: Ad_styleMU.STATUS,
                    alias: 'status'
                }
                ,{
                    fieldUtil: Ad_styleMU.CREATE_TIME,
                    alias: 'createTime'
                }
                ,{
                    fieldUtil: Ad_styleMU.CREATOR,
                    alias: 'creator'
                }
                ,{
                    fieldUtil: Ad_styleMU.UPDATE_TIME,
                    alias: 'updateTime'
                }
                ,{
                    fieldUtil: Ad_styleMU.UPDATOR,
                    alias: 'updator'
                }
            ]

        } as JoinTable

];
    subTables = [];

    createConditionUtil(): Ad_position_styleCU {
        return new Ad_position_styleCUImpl();
    }   

    static get AD_POSITION_ID(): FieldUtil<Ad_position_styleCU>{ 
        return new FieldUtil('AD_POSITION_ID','adPositionId','广告位置表id', new Ad_position_styleCUImpl());
    }
    static get AD_STYLE_ID(): FieldUtil<Ad_position_styleCU>{ 
        return new FieldUtil('AD_STYLE_ID','adStyleId','广告样式表id', new Ad_position_styleCUImpl());
    }
    static get DEL_FLAG(): FieldUtil<Ad_position_styleCU>{ 
        return new FieldUtil('DEL_FLAG','delFlag','是否删除：0，否；1，是', new Ad_position_styleCUImpl());
    }
    static get ID(): FieldInfo{  
        return new FieldInfo('id','主键id');
    }
    static get AD_POSTION_TYPE(): FieldInfo{  
        return new FieldInfo('adPostionType','广告位类型');
    }
    static get WIDTH(): FieldInfo{  
        return new FieldInfo('width','宽度（单位像素）');
    }
    static get HEIGHT(): FieldInfo{  
        return new FieldInfo('height','高度（单位像素）');
    }
    static get TYPE(): FieldInfo{  
        return new FieldInfo('type','类型：0，单图');
    }
    static get STATUS(): FieldInfo{  
        return new FieldInfo('status','状态：0，启用；1，删除');
    }
    static get CREATE_TIME(): FieldInfo{  
        return new FieldInfo('createTime','');
    }
    static get CREATOR(): FieldInfo{  
        return new FieldInfo('creator','');
    }
    static get UPDATE_TIME(): FieldInfo{  
        return new FieldInfo('updateTime','');
    }
    static get UPDATOR(): FieldInfo{  
        return new FieldInfo('updator','');
    }

    get AD_POSITION_ID(): FieldUtil<Ad_position_styleCU>{ 
        return Ad_position_styleMU.AD_POSITION_ID;
    }
    get AD_STYLE_ID(): FieldUtil<Ad_position_styleCU>{ 
        return Ad_position_styleMU.AD_STYLE_ID;
    }
    get DEL_FLAG(): FieldUtil<Ad_position_styleCU>{ 
        return Ad_position_styleMU.DEL_FLAG;
    }
    get ID(): FieldInfo{  
        return Ad_position_styleMU.ID;
    }
    get AD_POSTION_TYPE(): FieldInfo{  
        return Ad_position_styleMU.AD_POSTION_TYPE;
    }
    get WIDTH(): FieldInfo{  
        return Ad_position_styleMU.WIDTH;
    }
    get HEIGHT(): FieldInfo{  
        return Ad_position_styleMU.HEIGHT;
    }
    get TYPE(): FieldInfo{  
        return Ad_position_styleMU.TYPE;
    }
    get STATUS(): FieldInfo{  
        return Ad_position_styleMU.STATUS;
    }
    get CREATE_TIME(): FieldInfo{  
        return Ad_position_styleMU.CREATE_TIME;
    }
    get CREATOR(): FieldInfo{  
        return Ad_position_styleMU.CREATOR;
    }
    get UPDATE_TIME(): FieldInfo{  
        return Ad_position_styleMU.UPDATE_TIME;
    }
    get UPDATOR(): FieldInfo{  
        return Ad_position_styleMU.UPDATOR;
    }
}
export {Ad_position_styleMU, Ad_position_styleCU}
