MyBatis-Plus Development Assistant
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md to install @user_a36dc51e/mybatis-plus-dev
About this skill
Problem
MyBatis-Plus usage in Java/Spring Boot often fails around dependencies, configuration, and semantic boundaries: the starter artifact changes with Spring Boot versions, pagination requires mybatis-plus-jsqlparser, Wrapper is not suitable for joins, window functions, or complex aggregation, updateById skips null fields by default, and logic delete, enum mapping, transaction rollback, and SQL injection checks can produce silent mistakes.
How It Works
The skill starts with dependency detection, checking pom.xml or build.gradle for mybatis-plus before deciding whether to activate, partially apply, or stop. It then routes to local references/ files for configuration, entity mapping, CRUD, pagination, plugins, XML, and transactions. Code guidance follows strict rules: inherit from BaseMapper / IService for single-table operations, prefer LambdaQueryWrapper with method references, move joins, GROUP BY, and window functions into XML, add the pagination interceptor last with an explicit DbType, and validate external input used in apply with {0} placeholders and injection checks.
Boundaries
It targets MyBatis-Plus 3.5.x with partial 3.4.x compatibility. Native MyBatis projects may only use the XML and transaction sections; JPA, Hibernate, DDL design, or raw SQL tuning are out of scope. Watch for version artifacts, pagination dependencies, field strategies, enum typeHandler declarations, and transaction rollbackFor settings.
Use Cases
- Add MyBatis-Plus to a Spring Boot 3 project and configure the starter, pagination plugin, and basic CRUD.
- Decide between Wrapper and XML for conditional queries and pagination, avoiding joins, window functions, and GROUP BY in Wrapper.
- Troubleshoot silent pagination failures, null-field update issues, missing transaction rollback, or enum serialization errors.
- Write XML join queries and custom pagination with correct IPage return, non-null page input, and ORDER BY.
Best For
- Java/Spring Boot backend engineers who want to reduce redundant SQL for single-table CRUD.
- Tech leads maintaining MyBatis projects who need to evaluate MyBatis-Plus adoption and migration scope.
- Backend developers handling pagination, conditional queries, and XML joins who need to avoid Wrapper misuse and SQL injection.
- Engineers debugging ORM configuration issues who need to check starters, pagination plugins, transaction rollback, and enum mapping.
Related Skills
A one-shot coding agent built on Claude Code CLI that runs non-interactively, supports a specified workdir, and can be monitored in the foreground or background.
Preview and confirm file sorting by extension, with recursive cleanup, ignore rules, and transactional rollback.
An engineering assistant for static HTML/CSS/JS pages, design-token extraction, IE8-compatible review, and structured delivery.
An engineering workflow for requirement analysis, scenario modeling, risk planning, quality gates, testing, and knowledge capture, with lightweight, standard, and full modes.