# 老的项目使用MybatisPlus注解支持增删改查 **Repository Path**: anlinxi/fakerMybatisPlusUtil ## Basic Information - **Project Name**: 老的项目使用MybatisPlus注解支持增删改查 - **Description**: 超老的项目使用MybatisPlus注解支持最基本的增删改查功能。 主要是手上接到了一个sturts的老项目,稍微改造一下以支持代码生成器的实体类。 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-01-17 - **Last Updated**: 2023-09-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 老的项目使用MybatisPlus注解支持增删改查 #### 介绍 超老的项目使用MybatisPlus注解支持最基本的增删改查功能。 主要是手上接到了一个sturts的老项目,还是基于jdk1.6的,稍微改造一下以支持代码生成器的实体类。 #### 软件架构 java spring #### 安装教程 1. 复制fakerMybatisPlus模块的文件到您的项目或者使用打包后的fakerMybatisPlus.jar添加依赖 2. 已打包的地址:https://toscode.gitee.com/anlinxi/fakerMybatisPlusUtil/tree/master/others/release 3. 差mybatis plus注解和类且无mybatis plus jar包的的可以引入mybatisPlusAnnotation模块,这是精简功能和支持jdk1.6的版本,和真正的mybatisPlus互斥 4. 差swagger注解且无swagger jar包的可引入swaggerAnnotation模块 5. 差@Excel注解的可引入esayPoi包,或者使用cn.afterturn.easypoi.excel.annotation.Excel 6. 各个模块都可以打包为jar包放入带引用的项目libs内 7. 日志使用的org.apache.log4j.Logger,需要系统自带有这个 #### 使用说明 ```java MybatisPlusJdbc mybatisPlusJdbcUtil = MybatisPlusJdbcUtil.getInstance(InstallFormDomain.class); //新增 InstallFormDomain installBase = new InstallFormDomain(); installBase.setIfId(123L); installBase.setTerrCode("8634"); mybatisPlusJdbcUtil.save(installBase); //删除 mybatisPlusJdbcUtil.removeById(installBase.getIfId()); //修改 mybatisPlusJdbcUtil.updateById(installBase); //查询列表 Map params1 = new HashMap(); params1.put("STATE_CODE", "1"); params1.put("XXX_XXX", "XXXXX"); List tList = mybatisPlusJdbcUtil.listByMap(params1); System.out.println(tList); //按id查询 InstallFormDomain installFormDomain = mybatisPlusJdbcUtil.getById(12345); System.out.println(installFormDomain); //分页查询 Page installFormDomainPage = new Page(2, 8); installFormDomainPage = mybatisPlusJdbcUtil.page(installFormDomainPage, params1); System.out.println(installFormDomainPage); //QueryWrapper查询 QueryWrapper query = new QueryWrapper(); query.select("ID", "NO", "USER_ID", "TIME"); query.like("PHONE", "1500"); query.likeRight("TERR_CODE", "8634"); query.eq("ID", 123); Page installFormDomainPage2 = new Page(2, 8); Page page2 = mybatisPlusJdbcUtil.page(installFormDomainPage2, query); ``` #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)