#pragma once

#include <iostream>
#include <vector>

using namespace std;

class CrowdednessTimeConfig
{
public:
    std::string addTime;
    std::string updateTime;
    int createBy;
    int updateBy;
    std::string attr1;
    std::string attr2;
    std::string attr3;
    int appId;
    int pvcId;
    std::string startTime;
    std::string endTime;
    int timeType;
    std::string remark;

public:
    CrowdednessTimeConfig() {}
    ~CrowdednessTimeConfig() {}

    /**
     * @description: sql返回的结果转换对象
     * @param {string} sqlRet
     * @return {*}
     */    
    bool sqlRetToJson(vector<std::string> sqlRet)
    {
        addTime = sqlRet[1];
        updateTime = sqlRet[2];
        createBy = atoi(sqlRet[3].c_str());
        updateBy = atoi(sqlRet[4].c_str());
        attr1 = sqlRet[5];
        attr2 = sqlRet[6];
        attr3 = sqlRet[7];

        appId = atoi(sqlRet[8].c_str());
        pvcId = atoi(sqlRet[9].c_str());
        startTime = sqlRet[10];
        endTime = sqlRet[11];
        timeType = atoi(sqlRet[12].c_str());
        remark = sqlRet[13];

        return true;
    }
};