{"id":120,"date":"2024-09-04T18:12:53","date_gmt":"2024-09-04T10:12:53","guid":{"rendered":"https:\/\/wbki.net\/?p=120"},"modified":"2024-09-04T18:20:56","modified_gmt":"2024-09-04T10:20:56","slug":"java-mybatis%e6%a1%86%e6%9e%b6%e7%9a%84%e4%b8%80%e4%ba%9b%e7%9f%a5%e8%af%86","status":"publish","type":"post","link":"https:\/\/wbki.net\/?p=120","title":{"rendered":"Java MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><code>&lt;resultMap><\/code> \u6807\u7b7e<\/h2>\n\n\n\n<p><code>&lt;resultMap><\/code> \u6807\u7b7e\u901a\u5e38\u5728 MyBatis \u7684\u6620\u5c04\u6587\u4ef6\uff08XML \u914d\u7f6e\u6587\u4ef6\uff09\u4e2d\u5b9a\u4e49\uff0c\u5176\u57fa\u672c\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;resultMap id=\"resultMapId\" type=\"fullyQualifiedClassName\">\n    &lt;id property=\"idColumnName\" column=\"idColumn\" \/>\n    &lt;result property=\"propertyName\" column=\"columnName\" \/>\n    <em>&lt;!-- \u66f4\u591a\u7684 &lt;result> \u6807\u7b7e --><\/em>\n&lt;\/resultMap><\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f\u70b9\uff1a<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">type\u6700\u597d\u4ece\u5305\u540d\u4e0b\u5f00\u59cb<\/mark><\/strong>\uff0c\u5982com.example.fullyQualifiedClassName<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7ec4\u6210\u90e8\u5206<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>id<\/strong>: \u7528\u4e8e\u5b9a\u4e49\u552f\u4e00\u6807\u8bc6\u7b26\u7684\u6620\u5c04\u3002\u5728\u7ed3\u679c\u96c6\u4e2d\uff0c\u5e94\u8be5\u53ea\u6709\u4e00\u4e2a <code>&lt;id><\/code> \u6807\u7b7e\uff0c\u56e0\u4e3a\u5b83\u8868\u793a\u552f\u4e00\u952e\u3002\n<ul class=\"wp-block-list\">\n<li><code>property<\/code>: Java \u5bf9\u8c61\u7684\u5c5e\u6027\u540d\u3002<\/li>\n\n\n\n<li><code>column<\/code>: \u6570\u636e\u5e93\u8868\u4e2d\u7684\u5217\u540d\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>result<\/strong>: \u7528\u4e8e\u5b9a\u4e49\u975e\u552f\u4e00\u952e\u7684\u6620\u5c04\u3002\n<ul class=\"wp-block-list\">\n<li><code>property<\/code>: Java \u5bf9\u8c61\u7684\u5c5e\u6027\u540d\u3002<\/li>\n\n\n\n<li><code>column<\/code>: \u6570\u636e\u5e93\u8868\u4e2d\u7684\u5217\u540d\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u8fdb\u9636\u7279\u6027<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u81ea\u52a8\u6620\u5c04<\/strong>:\n<ul class=\"wp-block-list\">\n<li>\u5982\u679c\u67e5\u8be2\u7ed3\u679c\u4e2d\u7684\u5217\u540d\u4e0e Java \u5bf9\u8c61\u7684\u5c5e\u6027\u540d\u5b8c\u5168\u76f8\u540c\uff0c\u53ef\u4ee5\u4f7f\u7528\u00a0<code>&lt;resultMap><\/code>\u00a0\u7684\u00a0<code>autoMapping<\/code>\u00a0\u5c5e\u6027\u81ea\u52a8\u6620\u5c04\u8fd9\u4e9b\u5b57\u6bb5\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u5173\u8054\u67e5\u8be2<\/strong>:<ul><li>\u5f53\u67e5\u8be2\u6d89\u53ca\u591a\u8868\u8fde\u63a5\u5e76\u4e14\u9700\u8981\u5c06\u7ed3\u679c\u6620\u5c04\u5230\u5173\u8054\u5bf9\u8c61\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u00a0<code>&lt;association><\/code>\u00a0\u6807\u7b7e\u3002<\/li><\/ul><code>&lt;resultMap id=\"userWithRoles\" type=\"User\"> &lt;id property=\"id\" column=\"id\" \/> &lt;result property=\"username\" column=\"username\" \/> &lt;association property=\"roles\" javaType=\"Role\"> &lt;result property=\"roleId\" column=\"role_id\" \/> &lt;result property=\"roleName\" column=\"role_name\" \/> &lt;\/association> &lt;\/resultMap><\/code><\/li>\n\n\n\n<li><strong>\u96c6\u5408\u6620\u5c04<\/strong>:<ul><li>\u5f53\u9700\u8981\u5c06\u7ed3\u679c\u96c6\u4e2d\u7684\u591a\u884c\u6570\u636e\u6620\u5c04\u5230\u4e00\u4e2a\u96c6\u5408\u5c5e\u6027\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u00a0<code>&lt;collection><\/code>\u00a0\u6807\u7b7e\u3002<\/li><\/ul><code>&lt;resultMap id=\"userWithOrders\" type=\"User\"> &lt;id property=\"id\" column=\"id\" \/> &lt;result property=\"username\" column=\"username\" \/> &lt;collection property=\"orders\" ofType=\"Order\"> &lt;id property=\"id\" column=\"order_id\" \/> &lt;result property=\"orderDate\" column=\"order_date\" \/> &lt;\/collection> &lt;\/resultMap><\/code><\/li>\n\n\n\n<li><strong>\u590d\u6742\u7c7b\u578b\u6620\u5c04<\/strong>:\n<ul class=\"wp-block-list\">\n<li>\u5bf9\u4e8e\u590d\u6742\u7c7b\u578b\uff0c\u5982 Java \u4e2d\u7684\u00a0<code>Date<\/code>\uff0c\u53ef\u4ee5\u4f7f\u7528\u00a0<code>&lt;result><\/code>\u00a0\u6807\u7b7e\u7684\u00a0<code>typeHandler<\/code>\u00a0\u5c5e\u6027\u6307\u5b9a\u7c7b\u578b\u5904\u7406\u5668\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Discriminator<\/strong>:<ul><li>\u7528\u4e8e\u57fa\u4e8e\u67d0\u4e2a\u5b57\u6bb5\u7684\u503c\u6765\u8fd4\u56de\u4e0d\u540c\u7c7b\u578b\u7684\u7ed3\u679c\u3002\u8fd9\u5728\u5904\u7406\u7ee7\u627f\u7ed3\u6784\u6216\u591a\u6001\u65f6\u975e\u5e38\u6709\u7528\u3002<\/li><\/ul><code>&lt;resultMap id=\"discriminatorExample\" type=\"com.example.BaseClass\"> &lt;discriminator column=\"type\" javaType=\"int\" typeHandler=\"com.example.IntTypeHandler\"> &lt;case value=\"1\" resultType=\"com.example.SubClass1\"\/> &lt;case value=\"2\" resultType=\"com.example.SubClass2\"\/> &lt;\/discriminator> &lt;\/resultMap><\/code><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f7f\u7528\u793a\u4f8b<\/h3>\n\n\n\n<p>\u5047\u8bbe\u6709\u4e00\u4e2a <code>User<\/code> \u7c7b\u548c\u4e00\u4e2a <code>Order<\/code> \u7c7b\uff0c\u4f60\u60f3\u8981\u6267\u884c\u4e00\u4e2a\u67e5\u8be2\uff0c\u8be5\u67e5\u8be2\u8fd4\u56de\u7528\u6237\u53ca\u5176\u6240\u6709\u8ba2\u5355\u7684\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;resultMap id=\"userWithOrdersResultMap\" type=\"User\"><br>    &lt;id property=\"id\" column=\"user_id\" \/><br>    &lt;result property=\"username\" column=\"username\" \/><br>    &lt;collection property=\"orders\" ofType=\"Order\"><br>        &lt;id property=\"id\" column=\"order_id\" \/><br>        &lt;result property=\"orderDate\" column=\"order_date\" \/><br>    &lt;\/collection><br>&lt;\/resultMap><\/code><\/pre>\n\n\n\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>&lt;resultMap&gt;<\/code> \u5b9a\u4e49\u4e86\u5982\u4f55\u5c06\u67e5\u8be2\u7ed3\u679c\u6620\u5c04\u5230 <code>User<\/code> \u5bf9\u8c61\u53ca\u5176 <code>orders<\/code> \u96c6\u5408\u5c5e\u6027\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><code>&lt;trim><\/code> \u6807\u7b7e<\/h2>\n\n\n\n<p><code>&lt;trim><\/code> \u6807\u7b7e\u662f\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u52a8\u6001 SQL \u5143\u7d20\uff0c\u5b83\u5141\u8bb8\u4f60\u6784\u5efa\u4e00\u4e2a SQL \u8bed\u53e5\u7684\u7247\u6bb5\uff0c\u5176\u4e2d\u53ef\u4ee5\u5305\u542b\u591a\u4e2a\u5b50\u5143\u7d20\uff0c\u8fd9\u4e9b\u5b50\u5143\u7d20\u53ef\u4ee5\u662f <code>&lt;where><\/code>\u3001<code>&lt;set><\/code>\u3001<code>&lt;foreach><\/code> \u7b49\u3002<code>&lt;trim><\/code> \u6807\u7b7e\u4f1a\u81ea\u52a8\u5730\u6839\u636e\u5b50\u5143\u7d20\u7684\u5b58\u5728\u4e0e\u5426\u6765\u6dfb\u52a0\u6216\u7701\u7565 SQL \u8bed\u53e5\u4e2d\u7684\u67d0\u4e9b\u90e8\u5206\uff0c\u5982\u9017\u53f7\u3001\u7a7a\u683c\u548c\u5173\u952e\u5b57\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u57fa\u672c\u7528\u6cd5<\/h3>\n\n\n\n<p><code>&lt;trim&gt;<\/code> \u6807\u7b7e\u901a\u5e38\u7528\u4e8e\u6784\u5efa\u52a8\u6001 SQL\uff0c\u5b83\u6709\u4ee5\u4e0b\u51e0\u4e2a\u5e38\u7528\u7684\u5c5e\u6027\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"><code>prefix<\/code>\uff1a\u5728 SQL \u7247\u6bb5\u524d\u6dfb\u52a0\u7684\u6587\u672c\u3002<\/mark><\/strong><\/li>\n\n\n\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"><strong><code>prefixOverrides<\/code>\uff1a\u79fb\u9664 SQL \u7247\u6bb5\u524d\u591a\u4f59\u7684\u6587\u672c\u3002<\/strong><\/mark><\/li>\n\n\n\n<li><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"><code>suffix<\/code>\uff1a\u5728 SQL \u7247\u6bb5\u540e\u6dfb\u52a0\u7684\u6587\u672c\u3002<\/mark><\/strong><\/li>\n\n\n\n<li><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"><code>suffixOverrides<\/code>\uff1a\u79fb\u9664 SQL \u7247\u6bb5\u540e\u591a\u4f59\u7684\u6587\u672c\u3002<\/mark><\/strong><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u793a\u4f8b<\/h3>\n\n\n\n<p>\u5047\u8bbe\u4f60\u6709\u4e00\u4e2a\u7528\u6237\u8868 <code>users<\/code>\uff0c\u8868\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>CREATE TABLE users (\n    id INT PRIMARY KEY,\n    username VARCHAR(50),\n    email VARCHAR(100),\n    status VARCHAR(10)\n);<\/code><\/code><\/pre>\n\n\n\n<p>\u4f60\u60f3\u8981\u6784\u5efa\u4e00\u4e2a\u52a8\u6001\u67e5\u8be2\uff0c\u6839\u636e\u4f20\u5165\u7684\u6761\u4ef6\u52a8\u6001\u5730\u751f\u6210 SQL \u8bed\u53e5\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528 <code>&lt;trim&gt;<\/code> \u6807\u7b7e\u7684\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>&lt;select id=\"selectUsers\" resultType=\"User\">\n    SELECT id, username, email, status\n    FROM users\n    &lt;where>\n        &lt;trim suffixOverrides=\"AND \">\n            AND username LIKE CONCAT('%', #{username}, '%')\n            &lt;if test=\"email != null\">\n                AND email = #{email}\n            &lt;\/if>\n            &lt;if test=\"status != null\">\n                AND status = #{status}\n            &lt;\/if>\n        &lt;\/trim>\n    &lt;\/where>\n&lt;\/select><\/code><\/code><\/pre>\n\n\n\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>prefixOverrides=\"AND \"<\/code>\u00a0\u7528\u4e8e\u79fb\u9664\u6700\u540e\u4e00\u4e2a\u6761\u4ef6\u524d\u591a\u4f59\u7684 &#8220;AND &#8220;\u3002<\/li>\n\n\n\n<li><code>&lt;where><\/code>\u00a0\u6807\u7b7e\u4f1a\u81ea\u52a8\u5904\u7406 SQL \u4e2d\u7684 &#8220;WHERE&#8221; \u5173\u952e\u5b57\uff0c\u5982\u679c\u00a0<code>&lt;trim><\/code>\u00a0\u4e2d\u7684\u6761\u4ef6\u90fd\u4e0d\u6ee1\u8db3\uff0c&#8221;WHERE&#8221; \u5173\u952e\u5b57\u5c06\u4e0d\u4f1a\u88ab\u5305\u542b\u5728\u6700\u7ec8\u7684 SQL \u8bed\u53e5\u4e2d\u3002<\/li>\n\n\n\n<li><code>&lt;if><\/code>\u00a0\u6807\u7b7e\u7528\u4e8e\u6761\u4ef6\u5224\u65ad\uff0c\u53ea\u6709\u5f53\u6d4b\u8bd5\u8868\u8fbe\u5f0f\u4e3a\u771f\u65f6\uff0c\u76f8\u5e94\u7684 SQL \u7247\u6bb5\u624d\u4f1a\u88ab\u5305\u542b\u5728\u6700\u7ec8\u7684 SQL \u8bed\u53e5\u4e2d\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u52a8\u6001 SQL \u793a\u4f8b<\/h3>\n\n\n\n<p>\u5047\u8bbe\u4f60\u8c03\u7528 <code>selectUsers<\/code> \u65b9\u6cd5\uff0c\u5e76\u4f20\u5165 <code>username<\/code> \u4e3a <code>\"John\"<\/code>\uff0c\u4f46\u4e0d\u4f20\u5165 <code>email<\/code> \u548c <code>status<\/code>\uff0c\u5219\u751f\u6210\u7684 SQL \u8bed\u53e5\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>SELECT id, username, email, status\nFROM users\nWHERE username LIKE CONCAT('%John%')<\/code><\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u4f60\u4f20\u5165 <code>username<\/code> \u4e3a <code>\"John\"<\/code>\uff0c<code>email<\/code> \u4e3a <code>\"john@example.com\"<\/code>\uff0c\u548c <code>status<\/code> \u4e3a <code>\"active\"<\/code>\uff0c\u5219\u751f\u6210\u7684 SQL \u8bed\u53e5\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>SELECT id, username, email, status\nFROM users\nWHERE username LIKE CONCAT('%John%')\nAND email = 'john@example.com'\nAND status = 'active'<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u6ce8\u610f\u4e8b\u9879<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528\u00a0<code>&lt;trim><\/code>\u00a0\u6807\u7b7e\u65f6\uff0c\u8981\u6ce8\u610f\u6b63\u786e\u8bbe\u7f6e\u00a0<code>prefixOverrides<\/code>\u00a0\u548c\u00a0<code>suffixOverrides<\/code>\u00a0\u5c5e\u6027\uff0c\u4ee5\u907f\u514d\u751f\u6210\u65e0\u6548\u7684 SQL \u8bed\u53e5\u3002<\/li>\n\n\n\n<li><code>&lt;trim><\/code>\u00a0\u6807\u7b7e\u901a\u5e38\u4e0e\u00a0<code>&lt;where><\/code>\u3001<code>&lt;set><\/code>\u00a0\u7b49\u6807\u7b7e\u4e00\u8d77\u4f7f\u7528\uff0c\u4ee5\u6784\u5efa\u52a8\u6001\u7684 WHERE \u5b50\u53e5\u548c SET \u5b50\u53e5\u3002<\/li>\n\n\n\n<li>MyBatis \u4f1a\u81ea\u52a8\u5904\u7406 SQL \u8bed\u53e5\u4e2d\u7684\u7a7a\u683c\u548c\u9017\u53f7\uff0c\u786e\u4fdd\u751f\u6210\u7684 SQL \u8bed\u53e5\u662f\u6709\u6548\u7684\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>&lt;resultMap> \u6807\u7b7e &lt;resultMap> \u6807\u7b7e\u901a\u5e38\u5728 MyBatis \u7684\u6620\u5c04\u6587\u4ef6\uff08XM&#8230;<\/p>\n","protected":false},"author":1,"featured_media":125,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,7],"tags":[],"class_list":["post-120","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-programming-language"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6 - \u4e07\u522b\u5ba2\u7684\u767e\u5b9d\u888b<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wbki.net\/?p=120\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6 - \u4e07\u522b\u5ba2\u7684\u767e\u5b9d\u888b\" \/>\n<meta property=\"og:description\" content=\"&lt;resultMap&gt; \u6807\u7b7e &lt;resultMap&gt; \u6807\u7b7e\u901a\u5e38\u5728 MyBatis \u7684\u6620\u5c04\u6587\u4ef6\uff08XM...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wbki.net\/?p=120\" \/>\n<meta property=\"og:site_name\" content=\"\u4e07\u522b\u5ba2\u7684\u767e\u5b9d\u888b\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-04T10:12:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-04T10:20:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wbki.net\/wp-content\/uploads\/2024\/09\/Java-MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6.png\" \/>\n\t<meta property=\"og:image:width\" content=\"930\" \/>\n\t<meta property=\"og:image:height\" content=\"704\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Brother_Wan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brother_Wan\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/wbki.net\/?p=120#article\",\"isPartOf\":{\"@id\":\"https:\/\/wbki.net\/?p=120\"},\"author\":{\"name\":\"Brother_Wan\",\"@id\":\"https:\/\/wbki.net\/#\/schema\/person\/a18e9ddc78771da747372ebb77735bd8\"},\"headline\":\"Java MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6\",\"datePublished\":\"2024-09-04T10:12:53+00:00\",\"dateModified\":\"2024-09-04T10:20:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/wbki.net\/?p=120\"},\"wordCount\":40,\"publisher\":{\"@id\":\"https:\/\/wbki.net\/#\/schema\/person\/a18e9ddc78771da747372ebb77735bd8\"},\"image\":{\"@id\":\"https:\/\/wbki.net\/?p=120#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wbki.net\/wp-content\/uploads\/2024\/09\/Java-MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6.png\",\"articleSection\":[\"Java\",\"\u7f16\u7a0b\u8bed\u8a00\u77e5\u8bc6\"],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wbki.net\/?p=120\",\"url\":\"https:\/\/wbki.net\/?p=120\",\"name\":\"Java MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6 - \u4e07\u522b\u5ba2\u7684\u767e\u5b9d\u888b\",\"isPartOf\":{\"@id\":\"https:\/\/wbki.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wbki.net\/?p=120#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wbki.net\/?p=120#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wbki.net\/wp-content\/uploads\/2024\/09\/Java-MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6.png\",\"datePublished\":\"2024-09-04T10:12:53+00:00\",\"dateModified\":\"2024-09-04T10:20:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/wbki.net\/?p=120#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wbki.net\/?p=120\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/wbki.net\/?p=120#primaryimage\",\"url\":\"https:\/\/wbki.net\/wp-content\/uploads\/2024\/09\/Java-MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6.png\",\"contentUrl\":\"https:\/\/wbki.net\/wp-content\/uploads\/2024\/09\/Java-MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6.png\",\"width\":930,\"height\":704},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wbki.net\/?p=120#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/wbki.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wbki.net\/#website\",\"url\":\"https:\/\/wbki.net\/\",\"name\":\"\u4e07\u522b\u5ba2\u7684\u767e\u5b9d\u888b\",\"description\":\"\u4e07\u522b\u5ba2\u7684\u65e5\u8bb0\",\"publisher\":{\"@id\":\"https:\/\/wbki.net\/#\/schema\/person\/a18e9ddc78771da747372ebb77735bd8\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wbki.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/wbki.net\/#\/schema\/person\/a18e9ddc78771da747372ebb77735bd8\",\"name\":\"Brother_Wan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/wbki.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/wbki.net\/wp-content\/uploads\/2024\/02\/deddc670-d587-4881-acfc-4eab94c91754.jpg\",\"contentUrl\":\"https:\/\/wbki.net\/wp-content\/uploads\/2024\/02\/deddc670-d587-4881-acfc-4eab94c91754.jpg\",\"width\":1024,\"height\":1024,\"caption\":\"Brother_Wan\"},\"logo\":{\"@id\":\"https:\/\/wbki.net\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/wbki.net\"],\"url\":\"https:\/\/wbki.net\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6 - \u4e07\u522b\u5ba2\u7684\u767e\u5b9d\u888b","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wbki.net\/?p=120","og_locale":"zh_CN","og_type":"article","og_title":"Java MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6 - \u4e07\u522b\u5ba2\u7684\u767e\u5b9d\u888b","og_description":"&lt;resultMap> \u6807\u7b7e &lt;resultMap> \u6807\u7b7e\u901a\u5e38\u5728 MyBatis \u7684\u6620\u5c04\u6587\u4ef6\uff08XM...","og_url":"https:\/\/wbki.net\/?p=120","og_site_name":"\u4e07\u522b\u5ba2\u7684\u767e\u5b9d\u888b","article_published_time":"2024-09-04T10:12:53+00:00","article_modified_time":"2024-09-04T10:20:56+00:00","og_image":[{"width":930,"height":704,"url":"https:\/\/wbki.net\/wp-content\/uploads\/2024\/09\/Java-MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6.png","type":"image\/png"}],"author":"Brother_Wan","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"Brother_Wan","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wbki.net\/?p=120#article","isPartOf":{"@id":"https:\/\/wbki.net\/?p=120"},"author":{"name":"Brother_Wan","@id":"https:\/\/wbki.net\/#\/schema\/person\/a18e9ddc78771da747372ebb77735bd8"},"headline":"Java MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6","datePublished":"2024-09-04T10:12:53+00:00","dateModified":"2024-09-04T10:20:56+00:00","mainEntityOfPage":{"@id":"https:\/\/wbki.net\/?p=120"},"wordCount":40,"publisher":{"@id":"https:\/\/wbki.net\/#\/schema\/person\/a18e9ddc78771da747372ebb77735bd8"},"image":{"@id":"https:\/\/wbki.net\/?p=120#primaryimage"},"thumbnailUrl":"https:\/\/wbki.net\/wp-content\/uploads\/2024\/09\/Java-MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6.png","articleSection":["Java","\u7f16\u7a0b\u8bed\u8a00\u77e5\u8bc6"],"inLanguage":"zh-Hans"},{"@type":"WebPage","@id":"https:\/\/wbki.net\/?p=120","url":"https:\/\/wbki.net\/?p=120","name":"Java MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6 - \u4e07\u522b\u5ba2\u7684\u767e\u5b9d\u888b","isPartOf":{"@id":"https:\/\/wbki.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wbki.net\/?p=120#primaryimage"},"image":{"@id":"https:\/\/wbki.net\/?p=120#primaryimage"},"thumbnailUrl":"https:\/\/wbki.net\/wp-content\/uploads\/2024\/09\/Java-MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6.png","datePublished":"2024-09-04T10:12:53+00:00","dateModified":"2024-09-04T10:20:56+00:00","breadcrumb":{"@id":"https:\/\/wbki.net\/?p=120#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wbki.net\/?p=120"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/wbki.net\/?p=120#primaryimage","url":"https:\/\/wbki.net\/wp-content\/uploads\/2024\/09\/Java-MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6.png","contentUrl":"https:\/\/wbki.net\/wp-content\/uploads\/2024\/09\/Java-MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6.png","width":930,"height":704},{"@type":"BreadcrumbList","@id":"https:\/\/wbki.net\/?p=120#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/wbki.net\/"},{"@type":"ListItem","position":2,"name":"Java MyBatis\u6846\u67b6\u7684\u4e00\u4e9b\u77e5\u8bc6"}]},{"@type":"WebSite","@id":"https:\/\/wbki.net\/#website","url":"https:\/\/wbki.net\/","name":"\u4e07\u522b\u5ba2\u7684\u767e\u5b9d\u888b","description":"\u4e07\u522b\u5ba2\u7684\u65e5\u8bb0","publisher":{"@id":"https:\/\/wbki.net\/#\/schema\/person\/a18e9ddc78771da747372ebb77735bd8"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wbki.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/wbki.net\/#\/schema\/person\/a18e9ddc78771da747372ebb77735bd8","name":"Brother_Wan","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/wbki.net\/#\/schema\/person\/image\/","url":"https:\/\/wbki.net\/wp-content\/uploads\/2024\/02\/deddc670-d587-4881-acfc-4eab94c91754.jpg","contentUrl":"https:\/\/wbki.net\/wp-content\/uploads\/2024\/02\/deddc670-d587-4881-acfc-4eab94c91754.jpg","width":1024,"height":1024,"caption":"Brother_Wan"},"logo":{"@id":"https:\/\/wbki.net\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/wbki.net"],"url":"https:\/\/wbki.net\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/wbki.net\/index.php?rest_route=\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wbki.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wbki.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wbki.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wbki.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=120"}],"version-history":[{"count":3,"href":"https:\/\/wbki.net\/index.php?rest_route=\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":124,"href":"https:\/\/wbki.net\/index.php?rest_route=\/wp\/v2\/posts\/120\/revisions\/124"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wbki.net\/index.php?rest_route=\/wp\/v2\/media\/125"}],"wp:attachment":[{"href":"https:\/\/wbki.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wbki.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wbki.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}