{"id":4062,"date":"2024-08-26T20:01:26","date_gmt":"2024-08-26T12:01:26","guid":{"rendered":"https:\/\/qaqaq.top\/?p=4062"},"modified":"2024-08-27T15:57:11","modified_gmt":"2024-08-27T07:57:11","slug":"mybatis-plus%e7%9a%84mybatisx%e6%8f%92%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/qaqaq.top\/?p=4062","title":{"rendered":"MyBatis-Plus\u7684MyBatisX\u63d2\u4ef6"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u4ee3\u7801\u751f\u6210<\/h2>\n\n\n\n<p>\u9996\u5148\u5728idea\u4e2d\u5b89\u88c5MyBatisX\u63d2\u4ef6<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-98-1024x763.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"763\" data-original=\"https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-98-1024x763.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-4071\"  sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<p>\u53f3\u952e\u6570\u636e\u8868<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-97.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"390\" height=\"371\" data-original=\"https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-97.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-4068\"  sizes=\"(max-width: 390px) 100vw, 390px\" \/><\/div><\/figure>\n\n\n\n<p>\u5982\u56fe\u6240\u793a\uff0c\u8bbe\u7f6e\u5b9e\u4f53\u7c7b\u5305\u540d\u7b49<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-95-1024x604.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"604\" data-original=\"https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-95-1024x604.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-4066\"  sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<p>\u5982\u56fe\u6240\u793a\uff0c\u751f\u6210\u6ce8\u89e3\uff0c\u5b9e\u4f53\u7c7b\u6ce8\u89e3\uff0c\u65b9\u6cd5\u7b49<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-99-1024x604.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"604\" data-original=\"https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-99-1024x604.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-4073\"  sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u5feb\u901f\u751f\u6210\u6dfb\u52a0<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-100.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"667\" height=\"197\" data-original=\"https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-100.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-4075\"  sizes=\"(max-width: 667px) 100vw, 667px\" \/><\/div><\/figure>\n\n\n\n<p>UserMapper<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public interface UserMapper extends BaseMapper&lt;User> {\n\n    int insertSelective(User user);\n\n}<\/code><\/pre>\n\n\n\n<p>UserMapper.xml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    &lt;insert id=\"insertSelective\">\n        insert into t_user\n        &lt;trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n            &lt;if test=\"uid != null\">,&lt;\/if>\n            &lt;if test=\"userName != null\">user_name,&lt;\/if>\n            &lt;if test=\"age != null\">age,&lt;\/if>\n            &lt;if test=\"email != null\">email,&lt;\/if>\n            &lt;if test=\"sex != null\">sex,&lt;\/if>\n            &lt;if test=\"isDeleted != null\">is_deleted,&lt;\/if>\n        &lt;\/trim>\n        values\n        &lt;trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n            &lt;if test=\"uid != null\">#{uid,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"userName != null\">#{userName,jdbcType=VARCHAR},&lt;\/if>\n            &lt;if test=\"age != null\">#{age,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"email != null\">#{email,jdbcType=VARCHAR},&lt;\/if>\n            &lt;if test=\"sex != null\">#{sex,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"isDeleted != null\">#{isDeleted,jdbcType=NUMERIC},&lt;\/if>\n        &lt;\/trim>\n    &lt;\/insert><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5feb\u901f\u751f\u6210\u5220\u9664<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-101.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"704\" height=\"185\" data-original=\"https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-101.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-4077\" style=\"width:840px;height:auto\"  sizes=\"(max-width: 704px) 100vw, 704px\" \/><\/div><\/figure>\n\n\n\n<p>UserMapper<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public interface UserMapper extends BaseMapper&lt;User> {\n\n    int insertSelective(User user);\n\n    int deleteByUidAndUserName(@Param(\"uid\") Long uid, @Param(\"userName\") String userName);\n\n}<\/code><\/pre>\n\n\n\n<p>UserMapper.xml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n&lt;!DOCTYPE mapper\n        PUBLIC \"-\/\/mybatis.org\/\/DTD Mapper 3.0\/\/EN\"\n        \"http:\/\/mybatis.org\/dtd\/mybatis-3-mapper.dtd\">\n&lt;mapper namespace=\"top.qaqaq.mybatisplus.mapper.UserMapper\">\n\n    &lt;!--Map&lt;String, Object> selectMapById(Long id);-->\n    &lt;select id=\"selectMapById\" resultType=\"map\">\n        select id, name, age, email from user where id = #{id}\n    &lt;\/select>\n\n    &lt;!--Page&lt;User> selectPageVo(@Param(\"page\") Page&lt;User> page, @Param(\"age\") Integer age);-->\n    &lt;select id=\"selectPageVo\" resultType=\"User\">\n        select uid, user_name, age, email from t_user where age > #{age}\n    &lt;\/select>\n    &lt;insert id=\"insertSelective\">\n        insert into t_user\n        &lt;trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n            &lt;if test=\"uid != null\">,&lt;\/if>\n            &lt;if test=\"userName != null\">user_name,&lt;\/if>\n            &lt;if test=\"age != null\">age,&lt;\/if>\n            &lt;if test=\"email != null\">email,&lt;\/if>\n            &lt;if test=\"sex != null\">sex,&lt;\/if>\n            &lt;if test=\"isDeleted != null\">is_deleted,&lt;\/if>\n        &lt;\/trim>\n        values\n        &lt;trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n            &lt;if test=\"uid != null\">#{uid,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"userName != null\">#{userName,jdbcType=VARCHAR},&lt;\/if>\n            &lt;if test=\"age != null\">#{age,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"email != null\">#{email,jdbcType=VARCHAR},&lt;\/if>\n            &lt;if test=\"sex != null\">#{sex,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"isDeleted != null\">#{isDeleted,jdbcType=NUMERIC},&lt;\/if>\n        &lt;\/trim>\n    &lt;\/insert>\n    &lt;delete id=\"deleteByUidAndUserName\">\n        delete\n        from t_user\n        where\n            = #{uid,jdbcType=NUMERIC}\n          AND user_name = #{userName,jdbcType=VARCHAR}\n    &lt;\/delete>\n\n&lt;\/mapper><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5feb\u901f\u751f\u6210\u4fee\u6539<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-102.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"206\" data-original=\"https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-102.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-4079\"  sizes=\"(max-width: 657px) 100vw, 657px\" \/><\/div><\/figure>\n\n\n\n<p>UserMapper<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public interface UserMapper extends BaseMapper&lt;User> {\n\n    int insertSelective(User user);\n\n    int deleteByUidAndUserName(@Param(\"uid\") Long uid, @Param(\"userName\") String userName);\n\n    int updateAgeAndSexByUid(@Param(\"age\") Integer age, @Param(\"sex\") Integer sex, @Param(\"uid\") Long uid);\n\n}<\/code><\/pre>\n\n\n\n<p>UserMapper.xml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n&lt;!DOCTYPE mapper\n        PUBLIC \"-\/\/mybatis.org\/\/DTD Mapper 3.0\/\/EN\"\n        \"http:\/\/mybatis.org\/dtd\/mybatis-3-mapper.dtd\">\n&lt;mapper namespace=\"top.qaqaq.mybatisplus.mapper.UserMapper\">\n\n    &lt;!--Map&lt;String, Object> selectMapById(Long id);-->\n    &lt;select id=\"selectMapById\" resultType=\"map\">\n        select id, name, age, email from user where id = #{id}\n    &lt;\/select>\n\n    &lt;!--Page&lt;User> selectPageVo(@Param(\"page\") Page&lt;User> page, @Param(\"age\") Integer age);-->\n    &lt;select id=\"selectPageVo\" resultType=\"User\">\n        select uid, user_name, age, email from t_user where age > #{age}\n    &lt;\/select>\n    &lt;insert id=\"insertSelective\">\n        insert into t_user\n        &lt;trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n            &lt;if test=\"uid != null\">,&lt;\/if>\n            &lt;if test=\"userName != null\">user_name,&lt;\/if>\n            &lt;if test=\"age != null\">age,&lt;\/if>\n            &lt;if test=\"email != null\">email,&lt;\/if>\n            &lt;if test=\"sex != null\">sex,&lt;\/if>\n            &lt;if test=\"isDeleted != null\">is_deleted,&lt;\/if>\n        &lt;\/trim>\n        values\n        &lt;trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n            &lt;if test=\"uid != null\">#{uid,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"userName != null\">#{userName,jdbcType=VARCHAR},&lt;\/if>\n            &lt;if test=\"age != null\">#{age,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"email != null\">#{email,jdbcType=VARCHAR},&lt;\/if>\n            &lt;if test=\"sex != null\">#{sex,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"isDeleted != null\">#{isDeleted,jdbcType=NUMERIC},&lt;\/if>\n        &lt;\/trim>\n    &lt;\/insert>\n    &lt;delete id=\"deleteByUidAndUserName\">\n        delete\n        from t_user\n        where\n            = #{uid,jdbcType=NUMERIC}\n          AND user_name = #{userName,jdbcType=VARCHAR}\n    &lt;\/delete>\n    &lt;update id=\"updateAgeAndSexByUid\">\n        update t_user\n        set age = #{age,jdbcType=NUMERIC},\n            sex = #{sex,jdbcType=NUMERIC}\n        where\n            = #{uid,jdbcType=NUMERIC}\n    &lt;\/update>\n\n&lt;\/mapper><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5feb\u901f\u751f\u6210\u67e5\u8be2<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-103.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"719\" height=\"195\" data-original=\"https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-103.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-4080\"  sizes=\"(max-width: 719px) 100vw, 719px\" \/><\/div><\/figure>\n\n\n\n<p>UserMapper<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public interface UserMapper extends BaseMapper&lt;User> {\n\n    int insertSelective(User user);\n\n    int deleteByUidAndUserName(@Param(\"uid\") Long uid, @Param(\"userName\") String userName);\n\n    int updateAgeAndSexByUid(@Param(\"age\") Integer age, @Param(\"sex\") Integer sex, @Param(\"uid\") Long uid);\n\n    List&lt;User> selectAgeAndSexByAgeBetween(@Param(\"beginAge\") Integer beginAge, @Param(\"endAge\") Integer endAge);\n\n}<\/code><\/pre>\n\n\n\n<p>UserMapper.xml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n&lt;!DOCTYPE mapper\n        PUBLIC \"-\/\/mybatis.org\/\/DTD Mapper 3.0\/\/EN\"\n        \"http:\/\/mybatis.org\/dtd\/mybatis-3-mapper.dtd\">\n&lt;mapper namespace=\"top.qaqaq.mybatisplus.mapper.UserMapper\">\n\n    &lt;!--Map&lt;String, Object> selectMapById(Long id);-->\n    &lt;select id=\"selectMapById\" resultType=\"map\">\n        select id, name, age, email from user where id = #{id}\n    &lt;\/select>\n\n    &lt;!--Page&lt;User> selectPageVo(@Param(\"page\") Page&lt;User> page, @Param(\"age\") Integer age);-->\n    &lt;select id=\"selectPageVo\" resultType=\"User\">\n        select uid, user_name, age, email from t_user where age > #{age}\n    &lt;\/select>\n    &lt;insert id=\"insertSelective\">\n        insert into t_user\n        &lt;trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n            &lt;if test=\"uid != null\">,&lt;\/if>\n            &lt;if test=\"userName != null\">user_name,&lt;\/if>\n            &lt;if test=\"age != null\">age,&lt;\/if>\n            &lt;if test=\"email != null\">email,&lt;\/if>\n            &lt;if test=\"sex != null\">sex,&lt;\/if>\n            &lt;if test=\"isDeleted != null\">is_deleted,&lt;\/if>\n        &lt;\/trim>\n        values\n        &lt;trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n            &lt;if test=\"uid != null\">#{uid,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"userName != null\">#{userName,jdbcType=VARCHAR},&lt;\/if>\n            &lt;if test=\"age != null\">#{age,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"email != null\">#{email,jdbcType=VARCHAR},&lt;\/if>\n            &lt;if test=\"sex != null\">#{sex,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"isDeleted != null\">#{isDeleted,jdbcType=NUMERIC},&lt;\/if>\n        &lt;\/trim>\n    &lt;\/insert>\n    &lt;delete id=\"deleteByUidAndUserName\">\n        delete\n        from t_user\n        where\n            = #{uid,jdbcType=NUMERIC}\n          AND user_name = #{userName,jdbcType=VARCHAR}\n    &lt;\/delete>\n    &lt;update id=\"updateAgeAndSexByUid\">\n        update t_user\n        set age = #{age,jdbcType=NUMERIC},\n            sex = #{sex,jdbcType=NUMERIC}\n        where\n            = #{uid,jdbcType=NUMERIC}\n    &lt;\/update>\n    &lt;select id=\"selectAgeAndSexByAgeBetween\" resultMap=\"BaseResultMap\">\n        select age, sex\n        from t_user\n        where age between #{beginAge,jdbcType=NUMERIC} and #{endAge,jdbcType=NUMERIC}\n    &lt;\/select>\n\n&lt;\/mapper><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5feb\u901f\u751f\u6210\u6392\u5e8f<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-104.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"194\" data-original=\"https:\/\/qaqaq.top\/wp-content\/uploads\/2024\/08\/image-104.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-4081\"  sizes=\"(max-width: 738px) 100vw, 738px\" \/><\/div><\/figure>\n\n\n\n<p>UserMapper<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public interface UserMapper extends BaseMapper&lt;User> {\n\n    int insertSelective(User user);\n\n    int deleteByUidAndUserName(@Param(\"uid\") Long uid, @Param(\"userName\") String userName);\n\n    int updateAgeAndSexByUid(@Param(\"age\") Integer age, @Param(\"sex\") Integer sex, @Param(\"uid\") Long uid);\n\n    List&lt;User> selectAgeAndSexByAgeBetween(@Param(\"beginAge\") Integer beginAge, @Param(\"endAge\") Integer endAge);\n\n    List&lt;User> selectAllOrderByAgeDesc();\n\n}<\/code><\/pre>\n\n\n\n<p>UserMapper.xml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n&lt;!DOCTYPE mapper\n        PUBLIC \"-\/\/mybatis.org\/\/DTD Mapper 3.0\/\/EN\"\n        \"http:\/\/mybatis.org\/dtd\/mybatis-3-mapper.dtd\">\n&lt;mapper namespace=\"top.qaqaq.mybatisplus.mapper.UserMapper\">\n\n    &lt;!--Map&lt;String, Object> selectMapById(Long id);-->\n    &lt;select id=\"selectMapById\" resultType=\"map\">\n        select id, name, age, email from user where id = #{id}\n    &lt;\/select>\n\n    &lt;!--Page&lt;User> selectPageVo(@Param(\"page\") Page&lt;User> page, @Param(\"age\") Integer age);-->\n    &lt;select id=\"selectPageVo\" resultType=\"User\">\n        select uid, user_name, age, email from t_user where age > #{age}\n    &lt;\/select>\n    &lt;insert id=\"insertSelective\">\n        insert into t_user\n        &lt;trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n            &lt;if test=\"uid != null\">,&lt;\/if>\n            &lt;if test=\"userName != null\">user_name,&lt;\/if>\n            &lt;if test=\"age != null\">age,&lt;\/if>\n            &lt;if test=\"email != null\">email,&lt;\/if>\n            &lt;if test=\"sex != null\">sex,&lt;\/if>\n            &lt;if test=\"isDeleted != null\">is_deleted,&lt;\/if>\n        &lt;\/trim>\n        values\n        &lt;trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">\n            &lt;if test=\"uid != null\">#{uid,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"userName != null\">#{userName,jdbcType=VARCHAR},&lt;\/if>\n            &lt;if test=\"age != null\">#{age,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"email != null\">#{email,jdbcType=VARCHAR},&lt;\/if>\n            &lt;if test=\"sex != null\">#{sex,jdbcType=NUMERIC},&lt;\/if>\n            &lt;if test=\"isDeleted != null\">#{isDeleted,jdbcType=NUMERIC},&lt;\/if>\n        &lt;\/trim>\n    &lt;\/insert>\n    &lt;delete id=\"deleteByUidAndUserName\">\n        delete\n        from t_user\n        where\n            = #{uid,jdbcType=NUMERIC}\n          AND user_name = #{userName,jdbcType=VARCHAR}\n    &lt;\/delete>\n    &lt;update id=\"updateAgeAndSexByUid\">\n        update t_user\n        set age = #{age,jdbcType=NUMERIC},\n            sex = #{sex,jdbcType=NUMERIC}\n        where\n            = #{uid,jdbcType=NUMERIC}\n    &lt;\/update>\n    &lt;select id=\"selectAgeAndSexByAgeBetween\" resultMap=\"BaseResultMap\">\n        select age, sex\n        from t_user\n        where age between #{beginAge,jdbcType=NUMERIC} and #{endAge,jdbcType=NUMERIC}\n    &lt;\/select>\n    &lt;select id=\"selectAllOrderByAgeDesc\" resultMap=\"BaseResultMap\">\n        select\n        &lt;include refid=\"Base_Column_List\"\/>\n        from t_user\n        order by age desc\n    &lt;\/select>\n\n&lt;\/mapper><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee3\u7801\u751f\u6210 \u9996\u5148\u5728idea\u4e2d\u5b89\u88c5MyBatisX\u63d2\u4ef6 \u53f3\u952e\u6570\u636e\u8868 \u5982\u56fe\u6240\u793a\uff0c\u8bbe\u7f6e\u5b9e\u4f53\u7c7b\u5305\u540d\u7b49 \u5982\u56fe\u6240\u793a\uff0c\u751f\u6210\u6ce8\u89e3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[165],"tags":[183],"class_list":["post-4062","post","type-post","status-publish","format-standard","hentry","category-mybatisplus-","tag-mybatisplus"],"_links":{"self":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/4062"}],"collection":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4062"}],"version-history":[{"count":8,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/4062\/revisions"}],"predecessor-version":[{"id":4082,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/4062\/revisions\/4082"}],"wp:attachment":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}