import { FieldInfo } from 'model-util-base'
import { ConditionUtil, ConditionUtilImpl, FieldUtil, TableUtilImpl, IdType, JoinTable, SubTable } from 'model-util'
import { Container, Singleton } from 'typescript-ioc' 
import { MerCoupon } from '../models/index' 
/**
 * @author auto generate
 * @version 1.0
 * @date 2020-12-11 17:07
 */
interface MerCouponCU extends ConditionUtil<MerCouponCU>{
    ID:FieldUtil<MerCouponCU>;
    MER_ID:FieldUtil<MerCouponCU>;
    COUPON_ID:FieldUtil<MerCouponCU>;
    TOTAL_NUM:FieldUtil<MerCouponCU>;
    LIMIT_TYPE:FieldUtil<MerCouponCU>;
    MAX_MONTH:FieldUtil<MerCouponCU>;
    MAX_WEEK:FieldUtil<MerCouponCU>;
    MAX_DAY:FieldUtil<MerCouponCU>;
    REST_MONTH:FieldUtil<MerCouponCU>;
    REST_WEEK:FieldUtil<MerCouponCU>;
    REST_DAY:FieldUtil<MerCouponCU>;
    LOG_ID:FieldUtil<MerCouponCU>;
    VALIDITY_TIME:FieldUtil<MerCouponCU>;
    UPDATE_TIME:FieldUtil<MerCouponCU>;
}

class MerCouponCUImpl extends ConditionUtilImpl<MerCouponCUImpl> implements MerCouponCU{ 
    newInstance(): MerCouponCUImpl {
        return new MerCouponCUImpl();
    } 
    get ID(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('ID','id','', this);
    }
    get MER_ID(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('MER_ID','merId','商户ID', this);
    }
    get COUPON_ID(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('COUPON_ID','couponId','抵用券ID', this);
    }
    get TOTAL_NUM(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('TOTAL_NUM','totalNum','可用张数', this);
    }
    get LIMIT_TYPE(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('LIMIT_TYPE','limitType','限制类型 （0不限制，3按月，2按周，1按日）', this);
    }
    get MAX_MONTH(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('MAX_MONTH','maxMonth','月上限', this);
    }
    get MAX_WEEK(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('MAX_WEEK','maxWeek','周上限', this);
    }
    get MAX_DAY(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('MAX_DAY','maxDay','日上限', this);
    }
    get REST_MONTH(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('REST_MONTH','restMonth','月剩余', this);
    }
    get REST_WEEK(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('REST_WEEK','restWeek','周剩余', this);
    }
    get REST_DAY(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('REST_DAY','restDay','日剩余', this);
    }
    get LOG_ID(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('LOG_ID','logId','更新任务ID', this);
    }
    get VALIDITY_TIME(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('VALIDITY_TIME','validityTime','二维码有效时间，单位分钟，默认值12小时', this);
    }
    get UPDATE_TIME(): FieldUtil<MerCouponCU>{  
        return new FieldUtil('UPDATE_TIME','updateTime','', this);
    }
}

@Singleton 
class MerCouponMU extends TableUtilImpl<MerCouponCU,MerCoupon>{ 
    tableName  = 'co_mer_coupon';
    tableFields  = ['ID','MER_ID','COUPON_ID','TOTAL_NUM','LIMIT_TYPE','MAX_MONTH','MAX_WEEK','MAX_DAY','REST_MONTH','REST_WEEK','REST_DAY','LOG_ID','VALIDITY_TIME','UPDATE_TIME'];
    modelFields  = ['id','merId','couponId','totalNum','limitType','maxMonth','maxWeek','maxDay','restMonth','restWeek','restDay','logId','validityTime','updateTime'];
    modelIdFields  = ['id'];
    tableIdFields  = ['ID'];
    idType = IdType.CUSTOM;
    joinTables = [];
    subTables = [];

    createConditionUtil(): MerCouponCU {
        return new MerCouponCUImpl();
    }   

    static get ID(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('ID','id','', new MerCouponCUImpl());
    }
    static get MER_ID(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('MER_ID','merId','商户ID', new MerCouponCUImpl());
    }
    static get COUPON_ID(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('COUPON_ID','couponId','抵用券ID', new MerCouponCUImpl());
    }
    static get TOTAL_NUM(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('TOTAL_NUM','totalNum','可用张数', new MerCouponCUImpl());
    }
    static get LIMIT_TYPE(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('LIMIT_TYPE','limitType','限制类型 （0不限制，3按月，2按周，1按日）', new MerCouponCUImpl());
    }
    static get MAX_MONTH(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('MAX_MONTH','maxMonth','月上限', new MerCouponCUImpl());
    }
    static get MAX_WEEK(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('MAX_WEEK','maxWeek','周上限', new MerCouponCUImpl());
    }
    static get MAX_DAY(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('MAX_DAY','maxDay','日上限', new MerCouponCUImpl());
    }
    static get REST_MONTH(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('REST_MONTH','restMonth','月剩余', new MerCouponCUImpl());
    }
    static get REST_WEEK(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('REST_WEEK','restWeek','周剩余', new MerCouponCUImpl());
    }
    static get REST_DAY(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('REST_DAY','restDay','日剩余', new MerCouponCUImpl());
    }
    static get LOG_ID(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('LOG_ID','logId','更新任务ID', new MerCouponCUImpl());
    }
    static get VALIDITY_TIME(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('VALIDITY_TIME','validityTime','二维码有效时间，单位分钟，默认值12小时', new MerCouponCUImpl());
    }
    static get UPDATE_TIME(): FieldUtil<MerCouponCU>{ 
        return new FieldUtil('UPDATE_TIME','updateTime','', new MerCouponCUImpl());
    }

    get ID(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.ID;
    }
    get MER_ID(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.MER_ID;
    }
    get COUPON_ID(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.COUPON_ID;
    }
    get TOTAL_NUM(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.TOTAL_NUM;
    }
    get LIMIT_TYPE(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.LIMIT_TYPE;
    }
    get MAX_MONTH(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.MAX_MONTH;
    }
    get MAX_WEEK(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.MAX_WEEK;
    }
    get MAX_DAY(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.MAX_DAY;
    }
    get REST_MONTH(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.REST_MONTH;
    }
    get REST_WEEK(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.REST_WEEK;
    }
    get REST_DAY(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.REST_DAY;
    }
    get LOG_ID(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.LOG_ID;
    }
    get VALIDITY_TIME(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.VALIDITY_TIME;
    }
    get UPDATE_TIME(): FieldUtil<MerCouponCU>{ 
        return MerCouponMU.UPDATE_TIME;
    }
}
export {MerCouponMU, MerCouponCU}
