
class MaintenanceListEntity {
	int pageNum;
	int pageCount;
	int total;
	int pageSize;
	bool hasNext;
	bool hasPrev;
	List<MaintenanceListItem> rows;

	MaintenanceListEntity.fromJsonMap(Map<String, dynamic> map):
				pageNum = map["pageNum"],
				pageCount = map["pageCount"],
				total = map["total"],
				pageSize = map["pageSize"],
				hasNext = map["hasNext"],
				hasPrev = map["hasPrev"],
				rows = List<MaintenanceListItem>.from(map["rows"].map((it) => MaintenanceListItem.fromJsonMap(it)));

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['pageNum'] = pageNum;
		data['pageCount'] = pageCount;
		data['total'] = total;
		data['pageSize'] = pageSize;
		data['hasNext'] = hasNext;
		data['hasPrev'] = hasPrev;
		data['rows'] = rows != null ?
		this.rows.map((v) => v.toJson()).toList()
				: null;
		return data;
	}
}

class MaintenanceListItem {
	String projectName;
	String projectId;
	String planId;
	String recordId;
	String liftId;
	String workerId;
	String coordinate;
	String liftCode;
	String registrationCode;
	String useCompanyCode;
	int liftType;
	int category;
	String liftTypeName;
	String workerName;
	String planDate;
	String periods;
	String maintenanceType;
	String maintenanceTypeName;
	String status;
	String hasEvaluate;
	String devicePosition;

	MaintenanceListItem();
	MaintenanceListItem.fromJsonMap(Map<String, dynamic> map):
				projectName = map["projectName"]??"",
				projectId = map["projectId"]??"",
				planId = map["mtPlanId"]??"",
				recordId = map["recordId"]??"",
				liftId = map["liftId"]??"",
				workerId = map["workerId"]??"",
				coordinate = map["coordinate"]??"",
				liftCode = map["liftCode"]??"",
				registrationCode = map["registrationCode"]??"",
				useCompanyCode = map["useCompanyCode"]??"",
				liftType = map["liftType"]??1,
				category = map["category"]??1,
				liftTypeName = map["liftType"]==1?"直梯":"扶梯",
				workerName = map["workerName"]??"",
				planDate = map["planDate"]??"",
				maintenanceType = map["maintenanceType"]??"",
				maintenanceTypeName = map["maintenanceType"]=="1"?"半月":map["maintenanceType"]=="2"?"季度":map["maintenanceType"]=="3"?"半年":"全年",
				status = map["status"]??"0",
				hasEvaluate = map["hasEvaluate"]??"0",
				devicePosition = map["devicePosition"]??"";

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['projectName'] = projectName;
		data['projectId'] = projectId;
		data['mtPlanId'] = planId;
		data['recordId'] = recordId;
		data['liftId'] = liftId;
		data['workerId'] = workerId;
		data['coordinate'] = coordinate;
		data['liftCode'] = liftCode;
		data['registrationCode'] = registrationCode;
		data['useCompanyCode'] = useCompanyCode;
		data['liftType'] = liftType;
		data['category'] = category;
		data['workerName'] = workerName;
		data['planDate'] = planDate;
		data['maintenanceType'] = maintenanceType;
		data['status'] = status;
		data['devicePosition'] = devicePosition;
		data['hasEvaluate'] = hasEvaluate;
		return data;
	}
}
