File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,12 @@ public class Test {
349349 .andDelFlagEqualTo(Tb . DEL_FLAG )
350350 .example()
351351 );
352+
353+ // 4. 逻辑删除和未删除常量
354+ Tb tb = new Tb .Builder ()
355+ .delFlag(Tb . DEL_FLAG_OFF ) // 删除
356+ .delFlag(Tb . DEL_FLAG_ON ) // 未删除
357+ .build();
352358 }
353359}
354360```
@@ -437,7 +443,7 @@ public class Test {
437443 Tb tb = new Tb .Builder ()
438444 .field1(1 )
439445 .field2(" xx0" )
440- .delFlag(( short ) 0 )
446+ .delFlag(Tb . DEL_FLAG_ON )
441447 .build();
442448 int k0 = this . tbMapper. upsert(tb);
443449 // 2. 已入库数据再次入库,执行update(!!需要注意如触发update其返回的受影响行数为2)
@@ -458,7 +464,7 @@ public class Test {
458464 .field1(1 )
459465 .field2(" xx0" )
460466 .field3(1003 )
461- .delFlag(( short ) 0 )
467+ .delFlag(Tb . DEL_FLAG_ON )
462468 .build();
463469 int k4 = this . tbMapper. upsertByExample(tb2,
464470 new TbExample ()
@@ -499,7 +505,7 @@ public class Test {
499505 .field3(1 )
500506 .field4(new Date ())
501507 .createTime(new Date ())
502- .delFlag(Tb . DEL_FLAG )
508+ .delFlag(Tb . DEL_FLAG_ON )
503509 .build();
504510 // 只插入或者更新field1,field2字段
505511 this . tbMapper. insertSelective(tb. selective(Tb . Column . field1, Tb . Column . field2));
You can’t perform that action at this time.
0 commit comments