# mybatis-plus-support
**Repository Path**: runjay/mybatis-plus-support
## Basic Information
- **Project Name**: mybatis-plus-support
- **Description**: mybatis plus 增强框架
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 4
- **Forks**: 1
- **Created**: 2024-03-13
- **Last Updated**: 2024-04-01
## Categories & Tags
**Categories**: Uncategorized
**Tags**: MyBatis, mybatis-plus, 表单查询插件
## README
# mybatis-plus-support
#### 介绍
mybatis plus 增强框架
- mps-core 提供基础Mapper增强函数 lock exists incrUpdateById 等函数。查看 [BaseMapperSupportTest.java](mybatis-plus-support-example%2Fsrc%2Ftest%2Fjava%2Fnet%2Frunjava%2Fmps%2Fexample%2Frun%2FBaseMapperSupportTest.java)
- mps-query-form 通用表单查询插件。 查看 [QueryFormTest.java](mybatis-plus-support-example%2Fsrc%2Ftest%2Fjava%2Fnet%2Frunjava%2Fmps%2Fexample%2Frun%2FQueryFormTest.java)
#### 功能说明
TestStudentMapper.xml
```xml
SELECT
t1.*,t2.code,t2.class_name
from test_student t1
LEFT JOIN test_class t2
ON(t1.class_id = t2.id )
WHERE 1 = 1 and 1 = 1 OR 1 = 1
```
```java
// 指定分组前后关系以及连接方式,也可以都不设置
@WhereGroup(value = {
@WhereGroupItem(name = "a",concatType = ConcatType.OR),
// 默认分组,如不指定则优先默认分组。且所有字段条件都是在最外层不带括弧
@WhereGroupItem(name = Where.DEFAULT_GROUP,concatType = ConcatType.AND)
})
@Data
public class QueryStudentForm extends BasePageForm {
//a 组生成sql (t1.name LIKE ? OR t1.id IN (?, ?, ?) AND t1.age BETWEEN ? AND ?)
@Where(type = Where.Type.LIKE_RIGHT,groupName = "a",order = 1)
private String name;
@Where(type = Where.Type.BETWEEN,groupName = "a",tableAliasName = "t1",order = 3)
private Integer [] age;
@Where(type = Where.Type.IN,groupName = "a",columnName = "id",order = 2,concatType = ConcatType.OR)
private Long [] ids;
// 默认分组 (t1.class_id = ? AND t2.code = ?)
@Where
private Long classId;
@Where(tableClass = TestClass.class,columnName = "code")
private String classCode;
/**
* 未增加where条件,无法自动过滤。 需要手动mybatis xml代码中定义使用
*/
private String className;
}
@Mapper
public interface TestStudentMapper extends BaseMapperSupport {
IPage