@@ -234,8 +234,8 @@ public void d6_selectList() {
234
234
@ Test
235
235
@ SuppressWarnings ("unchecked" )
236
236
public void d7_1_selectListForNoLogic () {
237
- // 1. 只有 entity
238
237
MysqlData data = new MysqlData ().setOrder (1 );
238
+ // 1. 只有 entity
239
239
Assert .assertTrue (CollectionUtils .isNotEmpty (mysqlMapper .selectList (Wrappers .query (data ))));
240
240
// 2. 有 entity 也有 where 条件
241
241
Assert .assertTrue (CollectionUtils .isNotEmpty (mysqlMapper .selectList (Wrappers .query (data ).eq (MysqlData ::getGroup , 1 ))));
@@ -247,6 +247,12 @@ public void d7_1_selectListForNoLogic() {
247
247
// 5. 只有 order by 或者 last
248
248
Assert .assertTrue (CollectionUtils .isNotEmpty (mysqlMapper .selectList (Wrappers .<MysqlData >query ()
249
249
.lambda ().orderByDesc (MysqlData ::getOrder ).last ("limit 1" ))));
250
+ // 6. 什么都没有情况
251
+ Assert .assertTrue (CollectionUtils .isNotEmpty (mysqlMapper .selectList (Wrappers .emptyWrapper ())));
252
+ // 7. 只有 where 条件
253
+ Assert .assertTrue (CollectionUtils .isNotEmpty (mysqlMapper .selectList (Wrappers .query (new MysqlData ()).eq (MysqlData ::getGroup , 1 ))));
254
+ // 8. 有 where 条件 也有 last 条件
255
+ Assert .assertTrue (CollectionUtils .isNotEmpty (mysqlMapper .selectList (Wrappers .query (new MysqlData ()).eq (MysqlData ::getGroup , 1 ).last ("limit 1" ))));
250
256
}
251
257
252
258
@ Test
@@ -265,6 +271,12 @@ public void d7_2_selectListForLogic() {
265
271
// 5. 只有 order by 或者 last
266
272
Assert .assertTrue (CollectionUtils .isNotEmpty (commonLogicMapper .selectList (Wrappers .<CommonLogicData >query ()
267
273
.lambda ().orderByAsc (CommonLogicData ::getTestInt ).last ("limit 1" ))));
274
+ // 6. 什么都没有情况
275
+ Assert .assertTrue (CollectionUtils .isNotEmpty (commonLogicMapper .selectList (Wrappers .emptyWrapper ())));
276
+ // 7. 只有 where 条件
277
+ Assert .assertTrue (CollectionUtils .isNotEmpty (commonLogicMapper .selectList (Wrappers .query (new CommonLogicData ()).eq (CommonLogicData ::getId , 11 ))));
278
+ // 8. 有 where 条件 也有 last 条件
279
+ Assert .assertTrue (CollectionUtils .isNotEmpty (commonLogicMapper .selectList (Wrappers .query (new CommonLogicData ()).eq (CommonLogicData ::getId , 11 ).last ("limit 1" ))));
268
280
}
269
281
270
282
@ Test
0 commit comments