# mybatis-help
**Repository Path**: shifpeng/mybatis-help
## Basic Information
- **Project Name**: mybatis-help
- **Description**: No description available
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 0
- **Created**: 2019-11-28
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
## mybatis-help
1. 使用要求
1. mybatis:3.4.0+
2. mybatis-spring:1.3.0+
2. maven引入
```xml
xyz.redrain
mybatis-help
1.0.0-RELEASE
```
3. 使用mybatis的mapper接口方法
1. mapper.xml中namespace为mapper全限定类名
```xml
...
```
4. mapper 接口继承
```java
public interface UserMapper extends BaseMapper {
}
```
5. POJO对象与表映射
1. 非必填 主键属性名必须为id,可加上`@Id`注解
2. 非必填 `@Table`为表名
3. 非必填 `@Column` 为列名
4. 非必填 `@Ignore`不映射
5. 非必填 `@JavaType`设置Java类型
6. 非必填 `@Order`查询时属性的排序
7. 非必填 `@Indexs`设置索引
```java
@Table("t_user")
@Indexs({"password", "password,username,`user_id`"})
public class User {
@Id()
private Integer id;
private String userName;
@Column(jdbcType = "varchar")
private String password;
@UpdateSetNull
private Date time;
@Ignore
private Date time1;
//getter,setter
}
```
6. mybatis与spring集成:
1. spring配置文档
```xml
```