mirror of
https://gitee.com/best_handsome/mybatis-plus-join
synced 2025-07-11 00:02:22 +08:00
去除连表查询逻辑删除字段,需要手动添加
This commit is contained in:
parent
600786c121
commit
29e2c61804
@ -20,12 +20,11 @@
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<version>1.1.2</version>
|
||||
</dependency>
|
||||
```
|
||||
或者clone代码到本地,执行mvn install,再引入以上依赖
|
||||
<br>
|
||||
注:需要mybatis-plus版本号大于等于 3.4.0
|
||||
<br>
|
||||
|
||||
2. 添加配置文件
|
||||
|
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<version>1.1.2</version>
|
||||
<name>mybatis-plus-join</name>
|
||||
<description>An enhanced toolkit of Mybatis-Plus to simplify development.</description>
|
||||
<url>https://github.com/yulichang/mybatis-plus-join</url>
|
||||
|
@ -15,6 +15,23 @@ import java.util.List;
|
||||
*/
|
||||
public abstract class MPJAbstractMethod extends AbstractMethod {
|
||||
|
||||
/**
|
||||
* 连表操作不考虑entity查询和逻辑删除
|
||||
*/
|
||||
@Override
|
||||
protected String sqlWhereEntityWrapper(boolean newLine, TableInfo table) {
|
||||
String sqlScript = EMPTY;
|
||||
sqlScript += SqlScriptUtils.convertIf(String.format(SqlScriptUtils.convertIf(" AND", String.format("%s and %s", WRAPPER_NONEMPTYOFENTITY, WRAPPER_NONEMPTYOFNORMAL), false) + " ${%s}", WRAPPER_SQLSEGMENT),
|
||||
String.format("%s != null and %s != '' and %s", WRAPPER_SQLSEGMENT, WRAPPER_SQLSEGMENT,
|
||||
WRAPPER_NONEMPTYOFWHERE), true);
|
||||
sqlScript = SqlScriptUtils.convertWhere(sqlScript) + NEWLINE;
|
||||
sqlScript += SqlScriptUtils.convertIf(String.format(" ${%s}", WRAPPER_SQLSEGMENT),
|
||||
String.format("%s != null and %s != '' and %s", WRAPPER_SQLSEGMENT, WRAPPER_SQLSEGMENT,
|
||||
WRAPPER_EMPTYOFWHERE), true);
|
||||
sqlScript = SqlScriptUtils.convertIf(sqlScript, String.format("%s != null", WRAPPER), true);
|
||||
return newLine ? NEWLINE + sqlScript : sqlScript;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String sqlSelectColumns(TableInfo table, boolean queryWrapper) {
|
||||
String selectColumns = ASTERISK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user