package cn.ibizlab.core.lite.extensions.model;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

@Getter
@Setter
@NoArgsConstructor
@Accessors(chain = true)
public class Model {

    @JSONField(ordinal = 1)
    private String id;

    @JSONField(ordinal = 2)
    private String name;

    @JSONField(ordinal = 3)
    private String system;

    @JSONField(ordinal = 4)
    private String factEntity;

    @JSONField(ordinal = 5)
    private DataModel model;



    public static void main(String[] arg)
    {
        String jsonstr="{\"dataModelName\":\"T_TYYW_XJ_YSGS_AJ\",\"objectProperties\":[{\"propertyName\":\"T_TYYW_XJ_YSGS_AJ\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"T_TYYW_XJ_YSGS_AJ\",\"propertyMappings\":[]},{\"propertyName\":\"T_TYYW_GG_AQZY\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"T_TYYW_GG_AQZY\",\"propertyMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"joinPropertyName\":\"T_TYYW_XJ_YSGS_AJ\",\"joinPropertyColumn\":\"BMSAH\"}]},{\"propertyName\":\"AJ_YX_AJ\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"AJ_YX_AJ\",\"propertyMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"joinPropertyName\":\"T_TYYW_XJ_YSGS_AJ\",\"joinPropertyColumn\":\"BMSAH\"}]},{\"propertyName\":\"T_TYYW_GG_ZCHDJD\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"T_TYYW_GG_ZCHDJD\",\"propertyMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"joinPropertyName\":\"T_TYYW_XJ_YSGS_AJ\",\"joinPropertyColumn\":\"BMSAH\"}]},{\"propertyName\":\"T_TYYW_GG_SPHDJD\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"T_TYYW_GG_SPHDJD\",\"propertyMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"joinPropertyName\":\"T_TYYW_XJ_YSGS_AJ\",\"joinPropertyColumn\":\"BMSAH\"}]},{\"propertyName\":\"T_TYYW_GG_ZSCQQK\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"T_TYYW_GG_ZSCQQK\",\"propertyMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"joinPropertyName\":\"T_TYYW_XJ_YSGS_AJ\",\"joinPropertyColumn\":\"BMSAH\"}]}],\"nestedDataModels\":[{\"dataModelName\":\"T_TYYW_XJ_YSGS_XYR\",\"objectProperties\":[{\"propertyName\":\"T_TYYW_XJ_YSGS_XYR\",\"system\":\"tyywplus\",\"propertyEntity\":\"T_TYYW_XJ_YSGS_XYR\",\"propertyMappings\":[]},{\"propertyName\":\"T_TYYW_GG_ZRRSJLS\",\"system\":\"tyywplus\",\"propertyEntity\":\"T_TYYW_GG_ZRRSJLS\",\"propertyMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"joinPropertyName\":\"T_TYYW_XJ_YSGS_XYR\",\"joinPropertyColumn\":\"BMSAH\"},{\"selfPropertyColumn\":\"ZRRBM\",\"joinPropertyName\":\"T_TYYW_XJ_YSGS_XYR\",\"joinPropertyColumn\":\"ZRRBM\"}]}],\"nestedDataModels\":[{\"dataModelName\":\"T_TYYW_GG_QZCSQK\",\"objectProperties\":[{\"propertyName\":\"T_TYYW_GG_QZCSQK\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"T_TYYW_GG_QZCSQK\",\"propertyMappings\":[]}],\"nestedDataModels\":[],\"layerMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"parentPropertyColumn\":\"BMSAH\"},{\"selfPropertyColumn\":\"ZRRBM\",\"parentPropertyColumn\":\"ZRRBM\"}]},{\"dataModelName\":\"T_TYYW_GG_LZCSQK\",\"objectProperties\":[{\"propertyName\":\"T_TYYW_GG_LZCSQK\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"T_TYYW_GG_LZCSQK\",\"propertyMappings\":[]}],\"nestedDataModels\":[],\"layerMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"parentPropertyColumn\":\"BMSAH\"},{\"selfPropertyColumn\":\"ZRRBM\",\"parentPropertyColumn\":\"ZRRBM\"}]}],\"layerMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"parentPropertyColumn\":\"BMSAH\"}]},{\"dataModelName\":\"AJ_YX_SLRZ\",\"objectProperties\":[{\"propertyName\":\"AJ_YX_SLRZ\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"AJ_YX_SLRZ\",\"propertyMappings\":[]}],\"nestedDataModels\":[],\"layerMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"parentPropertyColumn\":\"BMSAH\"}]},{\"dataModelName\":\"T_TYYW_GG_XSYJQK\",\"objectProperties\":[{\"propertyName\":\"T_TYYW_GG_XSYJQK\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"T_TYYW_GG_XSYJQK\",\"propertyMappings\":[]}],\"nestedDataModels\":[],\"layerMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"parentPropertyColumn\":\"BMSAH\"}]},{\"dataModelName\":\"T_TYYW_GG_JCJYQK\",\"objectProperties\":[{\"propertyName\":\"T_TYYW_GG_JCJYQK\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"T_TYYW_GG_JCJYQK\",\"propertyMappings\":[]}],\"nestedDataModels\":[],\"layerMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"parentPropertyColumn\":\"BMSAH\"}]}],\"layerMappings\":[]}";

        JSONObject jo= JSON.parseObject(jsonstr);

        DataModel model=JSONObject.toJavaObject(jo, DataModel.class);


        System.out.println(JSONObject.toJSONString(model));
    }

}
