File tree 2 files changed +3
-9
lines changed
core/src/main/java/tk/mybatis/mapper
2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -944,7 +944,6 @@ public static String exampleCheck(Class<?> entityClass) {
944
944
public static String exampleWhereClause () {
945
945
return "<if test=\" _parameter != null\" >" +
946
946
"<where>\n " +
947
- " ${@tk.mybatis.mapper.util.OGNL@andNotLogicDelete(_parameter)}" +
948
947
" <trim prefix=\" (\" prefixOverrides=\" and |or \" suffix=\" )\" >\n " +
949
948
" <foreach collection=\" oredCriteria\" item=\" criteria\" >\n " +
950
949
" <if test=\" criteria.valid\" >\n " +
@@ -973,6 +972,7 @@ public static String exampleWhereClause() {
973
972
" </if>\n " +
974
973
" </foreach>\n " +
975
974
" </trim>\n " +
975
+ " ${@tk.mybatis.mapper.util.OGNL@andNotLogicDelete(_parameter)}" +
976
976
"</where>" +
977
977
"</if>" ;
978
978
}
@@ -984,7 +984,6 @@ public static String exampleWhereClause() {
984
984
*/
985
985
public static String updateByExampleWhereClause () {
986
986
return "<where>\n " +
987
- " ${@tk.mybatis.mapper.util.OGNL@andNotLogicDelete(example)}" +
988
987
" <trim prefix=\" (\" prefixOverrides=\" and |or \" suffix=\" )\" >\n " +
989
988
" <foreach collection=\" example.oredCriteria\" item=\" criteria\" >\n " +
990
989
" <if test=\" criteria.valid\" >\n " +
@@ -1013,6 +1012,7 @@ public static String updateByExampleWhereClause() {
1013
1012
" </if>\n " +
1014
1013
" </foreach>\n " +
1015
1014
" </trim>\n " +
1015
+ " ${@tk.mybatis.mapper.util.OGNL@andNotLogicDelete(example)}" +
1016
1016
"</where>" ;
1017
1017
}
1018
1018
Original file line number Diff line number Diff line change @@ -243,13 +243,7 @@ public static String andNotLogicDelete(Object parameter) {
243
243
EntityColumn column = entry .getValue ();
244
244
if (column .getEntityField ().isAnnotationPresent (LogicDelete .class )) {
245
245
// 未逻辑删除的条件
246
- result = column .getColumn () + " = " + SqlHelper .getLogicDeletedValue (column , false );
247
-
248
- // 如果Example中有条件,则拼接" and ",
249
- // 如果是空的oredCriteria,则where中只有逻辑删除注解的未删除条件
250
- if (example .getOredCriteria () != null && example .getOredCriteria ().size () != 0 ) {
251
- result += " and " ;
252
- }
246
+ result = "and " + column .getColumn () + " = " + SqlHelper .getLogicDeletedValue (column , false );
253
247
}
254
248
}
255
249
}
You can’t perform that action at this time.
0 commit comments