BusinessDataResultsEntity.java 3.2 KB
package org.yrhl.syncdata.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.Map;

/**
 * 数据凭证结果表
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2022-03-01
 */
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("business_data_results")
public class BusinessDataResultsEntity extends BaseEntity {
	private static final long serialVersionUID = 1L;

	/**
	 * 平台编码
	 */
	private String platformCode;
	/**
	 * 系统编码
	 */
	private String pubservicePlatCode;
	/**
	 * 系统标识码
	 */
	private String systemCode;
	/**
	 * 项目id
	 */
	private String tenderProjectId;
	/**
	 * 模块名称
	 */
	private String module;
	/**
	 *
	 */
	private String tenderFlowKey;
	/**
	 *
	 */
	private String opType;
	/**
	 * 业务节点名称
	 */
	private String tableName;
	/**
	 * 业务id
	 */
	private String tableInfoId;
	/**
	 * 业务数据json
	 */
	private String dataValue;
	/**
	 *
	 */
	private String blockChainPrev;
	/**
	 * 执行结果
	 */
	private String blockChainHash;
	/**
	 *
	 */
	private String blockChainUrl;
	/**
	 * 执行状态(0:存证失败 1:存证成功)
	 */
	private Integer status;
	/**
	 * 块号
	 */
	private String blockNum;

	private String date;


	// 静态方法,用于从 Map 转换到 BusinessDataResultsEntity
	public static BusinessDataResultsEntity fromMap(Map<String, Object> map) {
		BusinessDataResultsEntity entity = new BusinessDataResultsEntity();
		// 假设 map 中有与 entity 字段对应的键
		entity.setId(null== map.get("id")?null:(Long) map.get("id"));
		entity.setPlatformCode(null== map.get("platform_code")?null:(String) map.get("platform_code"));
		entity.setPubservicePlatCode(null== map.get("pubservice_plat_code")?null:(String) map.get("pubservice_plat_code"));
		entity.setSystemCode(null==map.get("system_code")?null:(String) map.get("system_code"));
		entity.setTenderProjectId((String) map.get("tender_project_id"));
		entity.setModule(null==map.get("module")?null:(String) map.get("module"));
		entity.setTenderFlowKey(null== map.get("tender_flow_key")?null:(String) map.get("tender_flow_key"));
		entity.setOpType(null==map.get("op_type")?null:(String) map.get("op_type"));
		entity.setTableName(null== map.get("table_name")?null:(String) map.get("table_name"));
		entity.setTableInfoId(null==map.get("table_info_id")?null:(String) map.get("table_info_id"));
		entity.setDataValue(null== map.get("data_value")?null:(String) map.get("data_value"));
		entity.setBlockChainPrev(null== map.get("block_chain_prev")?null:(String) map.get("block_chain_prev"));
		entity.setBlockChainHash(null== map.get("block_chain_hash")?null:(String) map.get("block_chain_hash"));
		entity.setBlockChainUrl(null== map.get("block_chain_url")?null:(String) map.get("block_chain_url"));
		entity.setStatus(null==map.get("status")?null:(int) map.get("status"));
		entity.setBlockNum(null==map.get("block_num")?null:(String) map.get("block_num"));
		entity.setCreator(null==map.get("creator")?null:(long) map.get("creator"));
		entity.setCreateDate(null== map.get("create_date")?null:(Date) map.get("create_date"));
		// 其他字段的设置...
		return entity;
	}
}