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

import {ParkingLotMU} from './ParkingLot' 


/**
 * @author auto generate
 * @version 1.0
 * @date 2020-10-16 11:27
 */
interface CpOrderCU extends ConditionUtil<CpOrderCU>{
    ID:FieldUtil<CpOrderCU>;
    USER_ID:FieldUtil<CpOrderCU>;
    ORDER_NO:FieldUtil<CpOrderCU>;
    TRADE_ID:FieldUtil<CpOrderCU>;
    PARK_ORDER_NO:FieldUtil<CpOrderCU>;
    PARK_ID:FieldUtil<CpOrderCU>;
    PLATE_NO:FieldUtil<CpOrderCU>;
    CARD_NO:FieldUtil<CpOrderCU>;
    PARK_NAME:FieldUtil<CpOrderCU>;
    ENTRY_TIME:FieldUtil<CpOrderCU>;
    PAY_TIME:FieldUtil<CpOrderCU>;
    ELAPSED_TIME:FieldUtil<CpOrderCU>;
    TOTAL_AMOUNT:FieldUtil<CpOrderCU>;
    PAYABLE:FieldUtil<CpOrderCU>;
    DELAY_TIME:FieldUtil<CpOrderCU>;
    IMG_NAME:FieldUtil<CpOrderCU>;
    IMG_TYPE:FieldUtil<CpOrderCU>;
    IMG_INFO:FieldUtil<CpOrderCU>;
    CAR_TYPE:FieldUtil<CpOrderCU>;
    CAR_STYLE:FieldUtil<CpOrderCU>;
    CURRENCY_CODE:FieldUtil<CpOrderCU>;
    ORDER_TITLE:FieldUtil<CpOrderCU>;
    ORDER_DESC:FieldUtil<CpOrderCU>;
    TRAFFIC_ID:FieldUtil<CpOrderCU>;
    PAY_STATUS:FieldUtil<CpOrderCU>;
    BIZ_STATUS:FieldUtil<CpOrderCU>;
    EXT_JSON:FieldUtil<CpOrderCU>;
    REMARK:FieldUtil<CpOrderCU>;
    STATE:FieldUtil<CpOrderCU>;
    CREATE_TIME:FieldUtil<CpOrderCU>;
    UPDATE_TIME:FieldUtil<CpOrderCU>;
    DEDUCTION_AMOUNT:FieldUtil<CpOrderCU>;
    PAID_AMOUNT:FieldUtil<CpOrderCU>;
    OUT_ORDER_NO:FieldUtil<CpOrderCU>;
    ERROR_INFO:FieldUtil<CpOrderCU>;
}

class CpOrderCUImpl extends ConditionUtilImpl<CpOrderCUImpl> implements CpOrderCU{ 
    newInstance(): CpOrderCUImpl {
        return new CpOrderCUImpl();
    } 
    get ID(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('ID','id','', this);
    }
    get USER_ID(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('USER_ID','userId','车主用户ID', this);
    }
    get ORDER_NO(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('ORDER_NO','orderNo','内部订单号', this);
    }
    get TRADE_ID(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('TRADE_ID','tradeId','交易表ID', this);
    }
    get PARK_ORDER_NO(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('PARK_ORDER_NO','parkOrderNo','车场订单号', this);
    }
    get PARK_ID(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('PARK_ID','parkId','车场ID', this);
    }
    get PLATE_NO(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('PLATE_NO','plateNo','车牌号', this);
    }
    get CARD_NO(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('CARD_NO','cardNo','无牌车入场卡号', this);
    }
    get PARK_NAME(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('PARK_NAME','parkName','出场设备号', this);
    }
    get ENTRY_TIME(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('ENTRY_TIME','entryTime','入场时间yyyy-MM-dd HH:mm:ss', this);
    }
    get PAY_TIME(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('PAY_TIME','payTime','缴费时间', this);
    }
    get ELAPSED_TIME(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('ELAPSED_TIME','elapsedTime','计费时长', this);
    }
    get TOTAL_AMOUNT(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('TOTAL_AMOUNT','totalAmount','车场计费总金额(分)', this);
    }
    get PAYABLE(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('PAYABLE','payable','本次应付金额（减去优惠金额）,单位为分', this);
    }
    get DELAY_TIME(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('DELAY_TIME','delayTime','收费后允许延时出场的时间限制（分钟），默认：20分钟', this);
    }
    get IMG_NAME(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('IMG_NAME','imgName','停车入场图片', this);
    }
    get IMG_TYPE(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('IMG_TYPE','imgType','图片信息类型：2=图片URL（可公网访问地址）', this);
    }
    get IMG_INFO(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('IMG_INFO','imgInfo','图片URL', this);
    }
    get CAR_TYPE(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('CAR_TYPE','carType','固定车类型  详见参数枚举 1.6.2', this);
    }
    get CAR_STYLE(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('CAR_STYLE','carStyle','车辆类型 详见参数枚举1.6.8', this);
    }
    get CURRENCY_CODE(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('CURRENCY_CODE','currencyCode','币种代码ISO-4217', this);
    }
    get ORDER_TITLE(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('ORDER_TITLE','orderTitle','订单标题', this);
    }
    get ORDER_DESC(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('ORDER_DESC','orderDesc','订单描述', this);
    }
    get TRAFFIC_ID(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('TRAFFIC_ID','trafficId','出入场唯一记录ID（v6.x有这个参数，v5.x没有）', this);
    }
    get PAY_STATUS(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('PAY_STATUS','payStatus','支付状态,0:支付成功，1：支付失败，2：待支付，3：支付中，4：支付超时', this);
    }
    get BIZ_STATUS(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('BIZ_STATUS','bizStatus','业务状态 0:已同步,1:未同步', this);
    }
    get EXT_JSON(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('EXT_JSON','extJson','扩展字段信息-JSON', this);
    }
    get REMARK(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('REMARK','remark','备注', this);
    }
    get STATE(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('STATE','state','状态：0-正常，1-删除', this);
    }
    get CREATE_TIME(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('CREATE_TIME','createTime','创建时间', this);
    }
    get UPDATE_TIME(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('UPDATE_TIME','updateTime','更新时间', this);
    }
    get DEDUCTION_AMOUNT(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('DEDUCTION_AMOUNT','deductionAmount','优惠总金额（单位:分）线上优惠总金额，免费金额+ 免费时长抵扣的金额（只需计算即可，不需在停车费中减', this);
    }
    get PAID_AMOUNT(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('PAID_AMOUNT','paidAmount','已经支付过的金额（单位:分） 线上已经支付的金额+线下已经支付的金额+线下优惠', this);
    }
    get OUT_ORDER_NO(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('OUT_ORDER_NO','outOrderNo','第三方支付的外部订单号', this);
    }
    get ERROR_INFO(): FieldUtil<CpOrderCU>{  
        return new FieldUtil('ERROR_INFO','errorInfo','异常信息', this);
    }
    get LOT_NAME(): FieldInfo{  
        return new FieldInfo('lotName','');
    }
}

@Singleton 
class CpOrderMU extends TableUtilImpl<CpOrderCU,CpOrder>{ 
    tableName  = 'cp_order';
    tableFields  = ['id','user_id','order_no','trade_id','park_order_no','park_id','plate_no','card_no','park_name','entry_time','pay_time','elapsed_time','total_amount','payable','delay_time','img_name','img_type','img_Info','car_type','car_style','currency_code','order_title','order_desc','traffic_id','pay_status','biz_status','ext_json','remark','state','create_time','update_time','deduction_amount','paid_amount','out_order_no','error_info'];
    modelFields  = ['id','userId','orderNo','tradeId','parkOrderNo','parkId','plateNo','cardNo','parkName','entryTime','payTime','elapsedTime','totalAmount','payable','delayTime','imgName','imgType','imgInfo','carType','carStyle','currencyCode','orderTitle','orderDesc','trafficId','payStatus','bizStatus','extJson','remark','state','createTime','updateTime','deductionAmount','paidAmount','outOrderNo','errorInfo','lotName'];
    modelIdFields  = ['id'];
    tableIdFields  = ['id'];
    idType = IdType.CUSTOM;
    joinTables = [{
            joinByDefault: true,
            foreignKeyFields: [CpOrderMU.PARK_ID],
            joinIdFields: [ParkingLotMU.LOT_ID],
            getTableUtil: ()=>{
                return Container.get(ParkingLotMU);
            },
            fields: [
                {
                    fieldUtil: ParkingLotMU.LOT_NAME,
                    alias: 'lotName'
                }
            ]

        } as JoinTable

];
    subTables = [];

    createConditionUtil(): CpOrderCU {
        return new CpOrderCUImpl();
    }   

    static get ID(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('ID','id','', new CpOrderCUImpl());
    }
    static get USER_ID(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('USER_ID','userId','车主用户ID', new CpOrderCUImpl());
    }
    static get ORDER_NO(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('ORDER_NO','orderNo','内部订单号', new CpOrderCUImpl());
    }
    static get TRADE_ID(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('TRADE_ID','tradeId','交易表ID', new CpOrderCUImpl());
    }
    static get PARK_ORDER_NO(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('PARK_ORDER_NO','parkOrderNo','车场订单号', new CpOrderCUImpl());
    }
    static get PARK_ID(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('PARK_ID','parkId','车场ID', new CpOrderCUImpl());
    }
    static get PLATE_NO(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('PLATE_NO','plateNo','车牌号', new CpOrderCUImpl());
    }
    static get CARD_NO(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('CARD_NO','cardNo','无牌车入场卡号', new CpOrderCUImpl());
    }
    static get PARK_NAME(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('PARK_NAME','parkName','出场设备号', new CpOrderCUImpl());
    }
    static get ENTRY_TIME(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('ENTRY_TIME','entryTime','入场时间yyyy-MM-dd HH:mm:ss', new CpOrderCUImpl());
    }
    static get PAY_TIME(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('PAY_TIME','payTime','缴费时间', new CpOrderCUImpl());
    }
    static get ELAPSED_TIME(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('ELAPSED_TIME','elapsedTime','计费时长', new CpOrderCUImpl());
    }
    static get TOTAL_AMOUNT(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('TOTAL_AMOUNT','totalAmount','车场计费总金额(分)', new CpOrderCUImpl());
    }
    static get PAYABLE(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('PAYABLE','payable','本次应付金额（减去优惠金额）,单位为分', new CpOrderCUImpl());
    }
    static get DELAY_TIME(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('DELAY_TIME','delayTime','收费后允许延时出场的时间限制（分钟），默认：20分钟', new CpOrderCUImpl());
    }
    static get IMG_NAME(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('IMG_NAME','imgName','停车入场图片', new CpOrderCUImpl());
    }
    static get IMG_TYPE(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('IMG_TYPE','imgType','图片信息类型：2=图片URL（可公网访问地址）', new CpOrderCUImpl());
    }
    static get IMG_INFO(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('IMG_INFO','imgInfo','图片URL', new CpOrderCUImpl());
    }
    static get CAR_TYPE(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('CAR_TYPE','carType','固定车类型  详见参数枚举 1.6.2', new CpOrderCUImpl());
    }
    static get CAR_STYLE(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('CAR_STYLE','carStyle','车辆类型 详见参数枚举1.6.8', new CpOrderCUImpl());
    }
    static get CURRENCY_CODE(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('CURRENCY_CODE','currencyCode','币种代码ISO-4217', new CpOrderCUImpl());
    }
    static get ORDER_TITLE(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('ORDER_TITLE','orderTitle','订单标题', new CpOrderCUImpl());
    }
    static get ORDER_DESC(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('ORDER_DESC','orderDesc','订单描述', new CpOrderCUImpl());
    }
    static get TRAFFIC_ID(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('TRAFFIC_ID','trafficId','出入场唯一记录ID（v6.x有这个参数，v5.x没有）', new CpOrderCUImpl());
    }
    static get PAY_STATUS(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('PAY_STATUS','payStatus','支付状态,0:支付成功，1：支付失败，2：待支付，3：支付中，4：支付超时', new CpOrderCUImpl());
    }
    static get BIZ_STATUS(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('BIZ_STATUS','bizStatus','业务状态 0:已同步,1:未同步', new CpOrderCUImpl());
    }
    static get EXT_JSON(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('EXT_JSON','extJson','扩展字段信息-JSON', new CpOrderCUImpl());
    }
    static get REMARK(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('REMARK','remark','备注', new CpOrderCUImpl());
    }
    static get STATE(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('STATE','state','状态：0-正常，1-删除', new CpOrderCUImpl());
    }
    static get CREATE_TIME(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('CREATE_TIME','createTime','创建时间', new CpOrderCUImpl());
    }
    static get UPDATE_TIME(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('UPDATE_TIME','updateTime','更新时间', new CpOrderCUImpl());
    }
    static get DEDUCTION_AMOUNT(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('DEDUCTION_AMOUNT','deductionAmount','优惠总金额（单位:分）线上优惠总金额，免费金额+ 免费时长抵扣的金额（只需计算即可，不需在停车费中减', new CpOrderCUImpl());
    }
    static get PAID_AMOUNT(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('PAID_AMOUNT','paidAmount','已经支付过的金额（单位:分） 线上已经支付的金额+线下已经支付的金额+线下优惠', new CpOrderCUImpl());
    }
    static get OUT_ORDER_NO(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('OUT_ORDER_NO','outOrderNo','第三方支付的外部订单号', new CpOrderCUImpl());
    }
    static get ERROR_INFO(): FieldUtil<CpOrderCU>{ 
        return new FieldUtil('ERROR_INFO','errorInfo','异常信息', new CpOrderCUImpl());
    }
    static get LOT_NAME(): FieldInfo{  
        return new FieldInfo('lotName','');
    }

    get ID(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.ID;
    }
    get USER_ID(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.USER_ID;
    }
    get ORDER_NO(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.ORDER_NO;
    }
    get TRADE_ID(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.TRADE_ID;
    }
    get PARK_ORDER_NO(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.PARK_ORDER_NO;
    }
    get PARK_ID(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.PARK_ID;
    }
    get PLATE_NO(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.PLATE_NO;
    }
    get CARD_NO(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.CARD_NO;
    }
    get PARK_NAME(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.PARK_NAME;
    }
    get ENTRY_TIME(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.ENTRY_TIME;
    }
    get PAY_TIME(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.PAY_TIME;
    }
    get ELAPSED_TIME(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.ELAPSED_TIME;
    }
    get TOTAL_AMOUNT(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.TOTAL_AMOUNT;
    }
    get PAYABLE(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.PAYABLE;
    }
    get DELAY_TIME(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.DELAY_TIME;
    }
    get IMG_NAME(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.IMG_NAME;
    }
    get IMG_TYPE(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.IMG_TYPE;
    }
    get IMG_INFO(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.IMG_INFO;
    }
    get CAR_TYPE(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.CAR_TYPE;
    }
    get CAR_STYLE(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.CAR_STYLE;
    }
    get CURRENCY_CODE(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.CURRENCY_CODE;
    }
    get ORDER_TITLE(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.ORDER_TITLE;
    }
    get ORDER_DESC(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.ORDER_DESC;
    }
    get TRAFFIC_ID(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.TRAFFIC_ID;
    }
    get PAY_STATUS(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.PAY_STATUS;
    }
    get BIZ_STATUS(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.BIZ_STATUS;
    }
    get EXT_JSON(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.EXT_JSON;
    }
    get REMARK(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.REMARK;
    }
    get STATE(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.STATE;
    }
    get CREATE_TIME(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.CREATE_TIME;
    }
    get UPDATE_TIME(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.UPDATE_TIME;
    }
    get DEDUCTION_AMOUNT(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.DEDUCTION_AMOUNT;
    }
    get PAID_AMOUNT(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.PAID_AMOUNT;
    }
    get OUT_ORDER_NO(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.OUT_ORDER_NO;
    }
    get ERROR_INFO(): FieldUtil<CpOrderCU>{ 
        return CpOrderMU.ERROR_INFO;
    }
    get LOT_NAME(): FieldInfo{  
        return CpOrderMU.LOT_NAME;
    }
}
export {CpOrderMU, CpOrderCU}
