Public BaseResponse
Page
Page. SetPageNum (dto. GetPageNum ());
Page. SetPageSize (dto. GetPageSize ());
SpongeProBaseInfoExample example=new SpongeProBaseInfoExample ();
SpongeProBaseInfoExample. The Criteria the Criteria=example. CreateCriteria ();
//query condition
Desc example. SetOrderByClause (" id ");
If (StringUtils. IsNotEmpty (dto. GetProjectName ())) {
List
{if (CollectionUtils. IsEmpty (projectIds))
Return BaseResponse. BuildSuccessResponse (). The result (page);
}
Criteria. AndIdIn (projectIds);
}
If (StringUtils. IsNotEmpty (dto. GetProjectCategory ())) {
Criteria. AndProjectCategoryLike (" % "+ dto. GetProjectCategory () +" % ");
}
If (StringUtils. IsNotEmpty (dto. GetStatus ())) {
Criteria. AndStatusEqualTo (dto. GetStatus ());
}
If (StringUtils. IsNotEmpty (dto. GetProjectprogress ())) {
Criteria. AndStatusEqualTo (dto. GetProjectprogress ());
}
If (StringUtils. IsNotEmpty (dto. GetProjectconstrct ())) {
Criteria. AndStatusEqualTo (dto. GetProjectconstrct ());
}
//different types of queries (hint null pointer)
The switch (dto getSpongeType ()) {
Case "important_project" :
Criteria. AndConstructTypeNotLike (" % 4% ");
break;
Case "award_project" :
Criteria. AndAwardEqualTo (true);
break;
Default:
break;
}
Criteria. AndDeletedEqualTo (CommonConstants. UN_DELETED);
Com. Making. Pagehelper. Page