Comments (1)
在作者的指导下搞定了。
public String selectNoDeleteByCondition(MappedStatement ms) {
Class<?> entityClass = getEntityClass(ms);
//将返回值修改为实体类型
setResultType(ms, entityClass);
StringBuilder sql = new StringBuilder("SELECT ");
sql.append("<if test=\"distinct\">distinct</if>");
//支持查询指定列
sql.append(SqlHelper.exampleSelectColumns(entityClass));
sql.append(SqlHelper.fromTable(entityClass, tableName(entityClass)));
sql.append("<where>\n")
.append(" (del_flag is null or del_flag!=1) \n")
.append("<trim prefix=\" and (\" suffix=\") \">\n");
//去掉SqlHelper.exampleWhereClause方法中的<where></where>标签
String whereClause = SqlHelper.exampleWhereClause();
whereClause = StringUtils.removeAll(whereClause, "<where>","</where>");
sql.append(whereClause)
.append("</trim>\n")
.append("</where>")
.append(SqlHelper.orderByDefault(entityClass))
.append(SqlHelper.exampleOrderBy(entityClass));
return sql.toString();
}
from mapper.
Related Issues (20)
- 特定场景下报java.lang.ClassCastException
- 主键策略失效 貌似是个BUG HOT 4
- 动态表名实现覆盖不全
- 求求开发者能再出一版这个,兼容SpringBoot3 HOT 2
- 希望优化:MapperHelper#processConfiguration,配置指定接口时,会对所有MapperStatements做循环
- @LogicDelete能否支持null作为被删除标记
- `Class.getDeclaredFields()` 返回的元素顺序不确定可能会导致测试失败
- Example.builder() 缺少ORDERBY属性初始化 HOT 3
- 初始化失败 HOT 2
- 4.2.3版本不兼容SpringNative: Code generation does not support tk.mybatis.mapper.mapperhelper.MapperHelper
- 4.3.0 版本征集开发者
- 减少生成的mappedStatement HOT 2
- typeHandler是否支持自定义的select查询呢? 测试下来只有tk自带的select比如 selectAll能够利用typeHandler机制 HOT 1
- [insertList] [sql server] 不允许从数据类型 varbinary 到 datetime2 的隐式转换。请使用 CONVERT 函数来运行此查询。 HOT 9
- 【请求】SQL server 插入非自增主键问题 HOT 1
- Unable to put different providers in one self-defined common mapper while using annotation-based dynamic routing HOT 3
- 咨询下Mapper最新版本4.2.3是否支持JDK17?还是待4.3.0版本发布后才会支持? HOT 3
- 建议spring boot 2和3的支持,使用不同的分支,发布不同的包 HOT 2
- 支持代码生成swagger实体类支持spring doc方式 现在还是老spring fox方式 HOT 5
- 采用MapperScannerConfigurer 扫描mapper 没有注册到EntityHelper HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapper.