1
This commit is contained in:
@@ -5,14 +5,22 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import com.cym.bean.Page;
|
||||
import com.cym.model.Example;
|
||||
import com.cym.utils.ConditionAndWrapper;
|
||||
import com.cym.utils.JpaHelper;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
@Service
|
||||
public class ExampleService {
|
||||
@Autowired
|
||||
JpaHelper jpaHelper;
|
||||
|
||||
public Page search(Page page) {
|
||||
public Page search(Page page, String keyword) {
|
||||
ConditionAndWrapper conditionAndWrapper = new ConditionAndWrapper();
|
||||
if (StrUtil.isNotEmpty(keyword)) {
|
||||
conditionAndWrapper.like(Example::getName, keyword);
|
||||
}
|
||||
|
||||
page = jpaHelper.findPageByQuery(page, Example.class);
|
||||
|
||||
return page;
|
||||
|
||||
Reference in New Issue
Block a user