[{"data":1,"prerenderedAt":800},["ShallowReactive",2],{"post-/blog/json-to-mybatis-mapper":3,"related-/blog/json-to-mybatis-mapper":198},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"category":11,"keywords":12,"body":16,"_type":192,"_id":193,"_source":194,"_file":195,"_stem":196,"_extension":197},"/blog/json-to-mybatis-mapper","blog",false,"","JSON 转 MyBatis Mapper 教程","根据 JSON 生成 MyBatis Mapper XML 与实体类，加速 Java 持久层开发。","2026-08-19","代码生成",[13,14,15],"json转mybatis","mybatis mapper","mapper xml",{"type":17,"children":18,"toc":184},"root",[19,27,33,39,44,49,54,59,141,146,168,173,178],{"type":20,"tag":21,"props":22,"children":24},"element","h1",{"id":23},"json-转-mybatis-mapper-教程",[25],{"type":26,"value":8},"text",{"type":20,"tag":28,"props":29,"children":30},"p",{},[31],{"type":26,"value":32},"根据 JSON 结构生成 MyBatis Mapper XML 与对应实体类，加速 Java 持久层开发。",{"type":20,"tag":34,"props":35,"children":37},"h2",{"id":36},"生成内容",[38],{"type":26,"value":36},{"type":20,"tag":28,"props":40,"children":41},{},[42],{"type":26,"value":43},"实体类字段、resultMap 映射、基础 CRUD 的 SQL 语句。",{"type":20,"tag":34,"props":45,"children":47},{"id":46},"使用场景",[48],{"type":26,"value":46},{"type":20,"tag":28,"props":50,"children":51},{},[52],{"type":26,"value":53},"根据接口返回 JSON 反推表结构与 Mapper，快速搭建持久层。",{"type":20,"tag":34,"props":55,"children":57},{"id":56},"代码示例",[58],{"type":26,"value":56},{"type":20,"tag":60,"props":61,"children":65},"pre",{"className":62,"code":63,"language":64,"meta":7,"style":7},"language-json shiki shiki-themes github-dark","{\"id\": 1, \"name\": \"x\", \"age\": 20}\n","json",[66],{"type":20,"tag":67,"props":68,"children":69},"code",{"__ignoreMap":7},[70],{"type":20,"tag":71,"props":72,"children":75},"span",{"class":73,"line":74},"line",1,[76,82,88,93,98,103,108,112,118,122,127,131,136],{"type":20,"tag":71,"props":77,"children":79},{"style":78},"--shiki-default:#E1E4E8",[80],{"type":26,"value":81},"{",{"type":20,"tag":71,"props":83,"children":85},{"style":84},"--shiki-default:#79B8FF",[86],{"type":26,"value":87},"\"id\"",{"type":20,"tag":71,"props":89,"children":90},{"style":78},[91],{"type":26,"value":92},": ",{"type":20,"tag":71,"props":94,"children":95},{"style":84},[96],{"type":26,"value":97},"1",{"type":20,"tag":71,"props":99,"children":100},{"style":78},[101],{"type":26,"value":102},", ",{"type":20,"tag":71,"props":104,"children":105},{"style":84},[106],{"type":26,"value":107},"\"name\"",{"type":20,"tag":71,"props":109,"children":110},{"style":78},[111],{"type":26,"value":92},{"type":20,"tag":71,"props":113,"children":115},{"style":114},"--shiki-default:#9ECBFF",[116],{"type":26,"value":117},"\"x\"",{"type":20,"tag":71,"props":119,"children":120},{"style":78},[121],{"type":26,"value":102},{"type":20,"tag":71,"props":123,"children":124},{"style":84},[125],{"type":26,"value":126},"\"age\"",{"type":20,"tag":71,"props":128,"children":129},{"style":78},[130],{"type":26,"value":92},{"type":20,"tag":71,"props":132,"children":133},{"style":84},[134],{"type":26,"value":135},"20",{"type":20,"tag":71,"props":137,"children":138},{"style":78},[139],{"type":26,"value":140},"}\n",{"type":20,"tag":34,"props":142,"children":144},{"id":143},"推荐在线工具",[145],{"type":26,"value":143},{"type":20,"tag":147,"props":148,"children":149},"ul",{},[150,160],{"type":20,"tag":151,"props":152,"children":153},"li",{},[154],{"type":20,"tag":155,"props":156,"children":158},"a",{"href":157},"/codegen/mybatis",[159],{"type":26,"value":157},{"type":20,"tag":151,"props":161,"children":162},{},[163],{"type":20,"tag":155,"props":164,"children":166},{"href":165},"/format",[167],{"type":26,"value":165},{"type":20,"tag":34,"props":169,"children":171},{"id":170},"小结",[172],{"type":26,"value":170},{"type":20,"tag":28,"props":174,"children":175},{},[176],{"type":26,"value":177},"根据 JSON 生成 MyBatis Mapper XML 与实体类，加速 Java 持久层开发。 JSONDog 提供全套 JSON 在线工具，纯前端、零上传、中英双语，欢迎免费使用。",{"type":20,"tag":179,"props":180,"children":181},"style",{},[182],{"type":26,"value":183},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":185,"depth":185,"links":186},2,[187,188,189,190,191],{"id":36,"depth":185,"text":36},{"id":46,"depth":185,"text":46},{"id":56,"depth":185,"text":56},{"id":143,"depth":185,"text":143},{"id":170,"depth":185,"text":170},"markdown","content:blog:json-to-mybatis-mapper.md","content","blog/json-to-mybatis-mapper.md","blog/json-to-mybatis-mapper","md",[199,352,527,669],{"_path":200,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":201,"description":202,"date":10,"category":11,"keywords":203,"body":207,"_type":192,"_id":349,"_source":194,"_file":350,"_stem":351,"_extension":197},"/blog/json-to-csharp-class","JSON 转 C# 类教程","根据 JSON 生成 C# 类，用于 .NET 后端快速建模与反序列化。",[204,205,206],"json转csharp","json to c#","csharp class",{"type":17,"children":208,"toc":342},[209,214,219,224,229,234,239,243,307,311,329,333,338],{"type":20,"tag":21,"props":210,"children":212},{"id":211},"json-转-c-类教程",[213],{"type":26,"value":201},{"type":20,"tag":28,"props":215,"children":216},{},[217],{"type":26,"value":218},"根据 JSON 生成 C# 类定义，自动推断属性类型，用于 .NET 序列化建模。",{"type":20,"tag":34,"props":220,"children":222},{"id":221},"类型映射",[223],{"type":26,"value":221},{"type":20,"tag":28,"props":225,"children":226},{},[227],{"type":26,"value":228},"string→string、number→int/double、boolean→bool、array→List、object→嵌套类。",{"type":20,"tag":34,"props":230,"children":232},{"id":231},"使用建议",[233],{"type":26,"value":231},{"type":20,"tag":28,"props":235,"children":236},{},[237],{"type":26,"value":238},"可配合 Newtonsoft.Json 或 System.Text.Json 使用。",{"type":20,"tag":34,"props":240,"children":241},{"id":56},[242],{"type":26,"value":56},{"type":20,"tag":60,"props":244,"children":246},{"className":62,"code":245,"language":64,"meta":7,"style":7},"{\"id\": 1, \"name\": \"x\", \"price\": 9.9}\n",[247],{"type":20,"tag":67,"props":248,"children":249},{"__ignoreMap":7},[250],{"type":20,"tag":71,"props":251,"children":252},{"class":73,"line":74},[253,257,261,265,269,273,277,281,285,289,294,298,303],{"type":20,"tag":71,"props":254,"children":255},{"style":78},[256],{"type":26,"value":81},{"type":20,"tag":71,"props":258,"children":259},{"style":84},[260],{"type":26,"value":87},{"type":20,"tag":71,"props":262,"children":263},{"style":78},[264],{"type":26,"value":92},{"type":20,"tag":71,"props":266,"children":267},{"style":84},[268],{"type":26,"value":97},{"type":20,"tag":71,"props":270,"children":271},{"style":78},[272],{"type":26,"value":102},{"type":20,"tag":71,"props":274,"children":275},{"style":84},[276],{"type":26,"value":107},{"type":20,"tag":71,"props":278,"children":279},{"style":78},[280],{"type":26,"value":92},{"type":20,"tag":71,"props":282,"children":283},{"style":114},[284],{"type":26,"value":117},{"type":20,"tag":71,"props":286,"children":287},{"style":78},[288],{"type":26,"value":102},{"type":20,"tag":71,"props":290,"children":291},{"style":84},[292],{"type":26,"value":293},"\"price\"",{"type":20,"tag":71,"props":295,"children":296},{"style":78},[297],{"type":26,"value":92},{"type":20,"tag":71,"props":299,"children":300},{"style":84},[301],{"type":26,"value":302},"9.9",{"type":20,"tag":71,"props":304,"children":305},{"style":78},[306],{"type":26,"value":140},{"type":20,"tag":34,"props":308,"children":309},{"id":143},[310],{"type":26,"value":143},{"type":20,"tag":147,"props":312,"children":313},{},[314,322],{"type":20,"tag":151,"props":315,"children":316},{},[317],{"type":20,"tag":155,"props":318,"children":320},{"href":319},"/codegen/java",[321],{"type":26,"value":319},{"type":20,"tag":151,"props":323,"children":324},{},[325],{"type":20,"tag":155,"props":326,"children":327},{"href":165},[328],{"type":26,"value":165},{"type":20,"tag":34,"props":330,"children":331},{"id":170},[332],{"type":26,"value":170},{"type":20,"tag":28,"props":334,"children":335},{},[336],{"type":26,"value":337},"根据 JSON 生成 C# 类，用于 .NET 后端快速建模与反序列化。 JSONDog 提供全套 JSON 在线工具，纯前端、零上传、中英双语，欢迎免费使用。",{"type":20,"tag":179,"props":339,"children":340},{},[341],{"type":26,"value":183},{"title":7,"searchDepth":185,"depth":185,"links":343},[344,345,346,347,348],{"id":221,"depth":185,"text":221},{"id":231,"depth":185,"text":231},{"id":56,"depth":185,"text":56},{"id":143,"depth":185,"text":143},{"id":170,"depth":185,"text":170},"content:blog:json-to-csharp-class.md","blog/json-to-csharp-class.md","blog/json-to-csharp-class",{"_path":353,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":354,"description":355,"date":10,"category":11,"keywords":356,"body":360,"_type":192,"_id":524,"_source":194,"_file":525,"_stem":526,"_extension":197},"/blog/json-to-excel","JSON 转 Excel 教程","将 JSON 数据导出为 Excel xlsx 文件，用于数据分析与报表。",[357,358,359],"json转excel","json to xlsx","导出excel",{"type":17,"children":361,"toc":517},[362,367,372,377,382,386,391,395,481,485,504,508,513],{"type":20,"tag":21,"props":363,"children":365},{"id":364},"json-转-excel-教程",[366],{"type":26,"value":354},{"type":20,"tag":28,"props":368,"children":369},{},[370],{"type":26,"value":371},"将 JSON 数组导出为 Excel xlsx 文件，键作为列名，用于数据分析与报表分发。",{"type":20,"tag":34,"props":373,"children":375},{"id":374},"转换条件",[376],{"type":26,"value":374},{"type":20,"tag":28,"props":378,"children":379},{},[380],{"type":26,"value":381},"JSON 须为对象数组，每个对象的键作为列，值作为单元格。",{"type":20,"tag":34,"props":383,"children":384},{"id":46},[385],{"type":26,"value":46},{"type":20,"tag":28,"props":387,"children":388},{},[389],{"type":26,"value":390},"导出业务数据、生成报表、与 Excel 用户协作。",{"type":20,"tag":34,"props":392,"children":393},{"id":56},[394],{"type":26,"value":56},{"type":20,"tag":60,"props":396,"children":398},{"className":62,"code":397,"language":64,"meta":7,"style":7},"[{\"id\":1,\"name\":\"a\"},{\"id\":2,\"name\":\"b\"}]\n",[399],{"type":20,"tag":67,"props":400,"children":401},{"__ignoreMap":7},[402],{"type":20,"tag":71,"props":403,"children":404},{"class":73,"line":74},[405,410,414,419,423,428,432,436,441,446,450,454,459,463,467,471,476],{"type":20,"tag":71,"props":406,"children":407},{"style":78},[408],{"type":26,"value":409},"[{",{"type":20,"tag":71,"props":411,"children":412},{"style":84},[413],{"type":26,"value":87},{"type":20,"tag":71,"props":415,"children":416},{"style":78},[417],{"type":26,"value":418},":",{"type":20,"tag":71,"props":420,"children":421},{"style":84},[422],{"type":26,"value":97},{"type":20,"tag":71,"props":424,"children":425},{"style":78},[426],{"type":26,"value":427},",",{"type":20,"tag":71,"props":429,"children":430},{"style":84},[431],{"type":26,"value":107},{"type":20,"tag":71,"props":433,"children":434},{"style":78},[435],{"type":26,"value":418},{"type":20,"tag":71,"props":437,"children":438},{"style":114},[439],{"type":26,"value":440},"\"a\"",{"type":20,"tag":71,"props":442,"children":443},{"style":78},[444],{"type":26,"value":445},"},{",{"type":20,"tag":71,"props":447,"children":448},{"style":84},[449],{"type":26,"value":87},{"type":20,"tag":71,"props":451,"children":452},{"style":78},[453],{"type":26,"value":418},{"type":20,"tag":71,"props":455,"children":456},{"style":84},[457],{"type":26,"value":458},"2",{"type":20,"tag":71,"props":460,"children":461},{"style":78},[462],{"type":26,"value":427},{"type":20,"tag":71,"props":464,"children":465},{"style":84},[466],{"type":26,"value":107},{"type":20,"tag":71,"props":468,"children":469},{"style":78},[470],{"type":26,"value":418},{"type":20,"tag":71,"props":472,"children":473},{"style":114},[474],{"type":26,"value":475},"\"b\"",{"type":20,"tag":71,"props":477,"children":478},{"style":78},[479],{"type":26,"value":480},"}]\n",{"type":20,"tag":34,"props":482,"children":483},{"id":143},[484],{"type":26,"value":143},{"type":20,"tag":147,"props":486,"children":487},{},[488,496],{"type":20,"tag":151,"props":489,"children":490},{},[491],{"type":20,"tag":155,"props":492,"children":494},{"href":493},"/convert/csv",[495],{"type":26,"value":493},{"type":20,"tag":151,"props":497,"children":498},{},[499],{"type":20,"tag":155,"props":500,"children":502},{"href":501},"/flatten",[503],{"type":26,"value":501},{"type":20,"tag":34,"props":505,"children":506},{"id":170},[507],{"type":26,"value":170},{"type":20,"tag":28,"props":509,"children":510},{},[511],{"type":26,"value":512},"将 JSON 数据导出为 Excel xlsx 文件，用于数据分析与报表。 JSONDog 提供全套 JSON 在线工具，纯前端、零上传、中英双语，欢迎免费使用。",{"type":20,"tag":179,"props":514,"children":515},{},[516],{"type":26,"value":183},{"title":7,"searchDepth":185,"depth":185,"links":518},[519,520,521,522,523],{"id":374,"depth":185,"text":374},{"id":46,"depth":185,"text":46},{"id":56,"depth":185,"text":56},{"id":143,"depth":185,"text":143},{"id":170,"depth":185,"text":170},"content:blog:json-to-excel.md","blog/json-to-excel.md","blog/json-to-excel",{"_path":528,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":529,"description":530,"date":10,"category":11,"keywords":531,"body":535,"_type":192,"_id":666,"_source":194,"_file":667,"_stem":668,"_extension":197},"/blog/json-to-go-struct","JSON 转 Go struct 教程","根据 JSON 生成 Go 结构体，含 json tag，用于 Go 后端快速建模。",[532,533,534],"json转go","json to golang","go struct",{"type":17,"children":536,"toc":659},[537,542,547,551,556,562,575,579,625,629,646,650,655],{"type":20,"tag":21,"props":538,"children":540},{"id":539},"json-转-go-struct-教程",[541],{"type":26,"value":529},{"type":20,"tag":28,"props":543,"children":544},{},[545],{"type":26,"value":546},"根据 JSON 生成 Go 结构体定义，自动添加 json tag，用于 Go 后端反序列化建模。",{"type":20,"tag":34,"props":548,"children":549},{"id":221},[550],{"type":26,"value":221},{"type":20,"tag":28,"props":552,"children":553},{},[554],{"type":26,"value":555},"string→string、number→int/float64、boolean→bool、array→slice、object→嵌套 struct。",{"type":20,"tag":34,"props":557,"children":559},{"id":558},"tag-生成",[560],{"type":26,"value":561},"tag 生成",{"type":20,"tag":28,"props":563,"children":564},{},[565,567,573],{"type":26,"value":566},"默认生成 ",{"type":20,"tag":67,"props":568,"children":570},{"className":569},[],[571],{"type":26,"value":572},"json:\"key\"",{"type":26,"value":574}," tag，可选 omitempty。",{"type":20,"tag":34,"props":576,"children":577},{"id":56},[578],{"type":26,"value":56},{"type":20,"tag":60,"props":580,"children":582},{"className":62,"code":581,"language":64,"meta":7,"style":7},"{\"id\": 1, \"name\": \"x\"}\n",[583],{"type":20,"tag":67,"props":584,"children":585},{"__ignoreMap":7},[586],{"type":20,"tag":71,"props":587,"children":588},{"class":73,"line":74},[589,593,597,601,605,609,613,617,621],{"type":20,"tag":71,"props":590,"children":591},{"style":78},[592],{"type":26,"value":81},{"type":20,"tag":71,"props":594,"children":595},{"style":84},[596],{"type":26,"value":87},{"type":20,"tag":71,"props":598,"children":599},{"style":78},[600],{"type":26,"value":92},{"type":20,"tag":71,"props":602,"children":603},{"style":84},[604],{"type":26,"value":97},{"type":20,"tag":71,"props":606,"children":607},{"style":78},[608],{"type":26,"value":102},{"type":20,"tag":71,"props":610,"children":611},{"style":84},[612],{"type":26,"value":107},{"type":20,"tag":71,"props":614,"children":615},{"style":78},[616],{"type":26,"value":92},{"type":20,"tag":71,"props":618,"children":619},{"style":114},[620],{"type":26,"value":117},{"type":20,"tag":71,"props":622,"children":623},{"style":78},[624],{"type":26,"value":140},{"type":20,"tag":34,"props":626,"children":627},{"id":143},[628],{"type":26,"value":143},{"type":20,"tag":147,"props":630,"children":631},{},[632,639],{"type":20,"tag":151,"props":633,"children":634},{},[635],{"type":20,"tag":155,"props":636,"children":637},{"href":319},[638],{"type":26,"value":319},{"type":20,"tag":151,"props":640,"children":641},{},[642],{"type":20,"tag":155,"props":643,"children":644},{"href":165},[645],{"type":26,"value":165},{"type":20,"tag":34,"props":647,"children":648},{"id":170},[649],{"type":26,"value":170},{"type":20,"tag":28,"props":651,"children":652},{},[653],{"type":26,"value":654},"根据 JSON 生成 Go 结构体，含 json tag，用于 Go 后端快速建模。 JSONDog 提供全套 JSON 在线工具，纯前端、零上传、中英双语，欢迎免费使用。",{"type":20,"tag":179,"props":656,"children":657},{},[658],{"type":26,"value":183},{"title":7,"searchDepth":185,"depth":185,"links":660},[661,662,663,664,665],{"id":221,"depth":185,"text":221},{"id":558,"depth":185,"text":561},{"id":56,"depth":185,"text":56},{"id":143,"depth":185,"text":143},{"id":170,"depth":185,"text":170},"content:blog:json-to-go-struct.md","blog/json-to-go-struct.md","blog/json-to-go-struct",{"_path":670,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":671,"description":672,"date":10,"category":11,"keywords":673,"body":677,"_type":192,"_id":797,"_source":194,"_file":798,"_stem":799,"_extension":197},"/blog/json-to-graphql","JSON 转 GraphQL 教程","根据 JSON 结构生成 GraphQL type 定义，用于 GraphQL 服务建模。",[674,675,676],"json转graphql","graphql type","graphql",{"type":17,"children":678,"toc":790},[679,684,689,693,698,702,707,711,756,760,777,781,786],{"type":20,"tag":21,"props":680,"children":682},{"id":681},"json-转-graphql-教程",[683],{"type":26,"value":671},{"type":20,"tag":28,"props":685,"children":686},{},[687],{"type":26,"value":688},"根据 JSON 结构生成 GraphQL type 定义，用于 GraphQL 服务的 schema 建模。",{"type":20,"tag":34,"props":690,"children":691},{"id":221},[692],{"type":26,"value":221},{"type":20,"tag":28,"props":694,"children":695},{},[696],{"type":26,"value":697},"string→String、number→Int/Float、boolean→Boolean、array→列表类型、object→嵌套 type。",{"type":20,"tag":34,"props":699,"children":700},{"id":46},[701],{"type":26,"value":46},{"type":20,"tag":28,"props":703,"children":704},{},[705],{"type":26,"value":706},"快速为 GraphQL 服务生成 type 定义，减少手写。",{"type":20,"tag":34,"props":708,"children":709},{"id":56},[710],{"type":26,"value":56},{"type":20,"tag":60,"props":712,"children":713},{"className":62,"code":581,"language":64,"meta":7,"style":7},[714],{"type":20,"tag":67,"props":715,"children":716},{"__ignoreMap":7},[717],{"type":20,"tag":71,"props":718,"children":719},{"class":73,"line":74},[720,724,728,732,736,740,744,748,752],{"type":20,"tag":71,"props":721,"children":722},{"style":78},[723],{"type":26,"value":81},{"type":20,"tag":71,"props":725,"children":726},{"style":84},[727],{"type":26,"value":87},{"type":20,"tag":71,"props":729,"children":730},{"style":78},[731],{"type":26,"value":92},{"type":20,"tag":71,"props":733,"children":734},{"style":84},[735],{"type":26,"value":97},{"type":20,"tag":71,"props":737,"children":738},{"style":78},[739],{"type":26,"value":102},{"type":20,"tag":71,"props":741,"children":742},{"style":84},[743],{"type":26,"value":107},{"type":20,"tag":71,"props":745,"children":746},{"style":78},[747],{"type":26,"value":92},{"type":20,"tag":71,"props":749,"children":750},{"style":114},[751],{"type":26,"value":117},{"type":20,"tag":71,"props":753,"children":754},{"style":78},[755],{"type":26,"value":140},{"type":20,"tag":34,"props":757,"children":758},{"id":143},[759],{"type":26,"value":143},{"type":20,"tag":147,"props":761,"children":762},{},[763,770],{"type":20,"tag":151,"props":764,"children":765},{},[766],{"type":20,"tag":155,"props":767,"children":768},{"href":319},[769],{"type":26,"value":319},{"type":20,"tag":151,"props":771,"children":772},{},[773],{"type":20,"tag":155,"props":774,"children":775},{"href":165},[776],{"type":26,"value":165},{"type":20,"tag":34,"props":778,"children":779},{"id":170},[780],{"type":26,"value":170},{"type":20,"tag":28,"props":782,"children":783},{},[784],{"type":26,"value":785},"根据 JSON 结构生成 GraphQL type 定义，用于 GraphQL 服务建模。 JSONDog 提供全套 JSON 在线工具，纯前端、零上传、中英双语，欢迎免费使用。",{"type":20,"tag":179,"props":787,"children":788},{},[789],{"type":26,"value":183},{"title":7,"searchDepth":185,"depth":185,"links":791},[792,793,794,795,796],{"id":221,"depth":185,"text":221},{"id":46,"depth":185,"text":46},{"id":56,"depth":185,"text":56},{"id":143,"depth":185,"text":143},{"id":170,"depth":185,"text":170},"content:blog:json-to-graphql.md","blog/json-to-graphql.md","blog/json-to-graphql",1787305467518]