|
|
|
@ -1,8 +1,6 @@ |
|
|
|
|
package com.community.pocket.repository.android; |
|
|
|
|
|
|
|
|
|
import com.community.pocket.entity.po.android.Garbage; |
|
|
|
|
import com.community.pocket.entity.vo.android.GarbageCateGory; |
|
|
|
|
import com.community.pocket.entity.vo.android.GarbageVo; |
|
|
|
|
import com.community.pocket.entity.vo.android.QueryGarbageForm; |
|
|
|
|
import com.community.pocket.repository.BaseDao; |
|
|
|
|
import com.community.pocket.util.MessageService; |
|
|
|
@ -13,7 +11,6 @@ import org.springframework.data.mongodb.core.query.Criteria; |
|
|
|
|
import org.springframework.data.mongodb.core.query.Query; |
|
|
|
|
import org.springframework.stereotype.Repository; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
|
|
|
|
@ -27,7 +24,9 @@ public class GarbageDao extends BaseDao<Garbage> { |
|
|
|
|
|
|
|
|
|
//查询垃圾分类信息
|
|
|
|
|
public List<Garbage> query(QueryGarbageForm garbageForm) { |
|
|
|
|
return mongoTemplate.find(new Query(Criteria.where("name").regex(Pattern.compile(".*" + garbageForm.getName() + ".*"))), entityClass()); |
|
|
|
|
return mongoTemplate.find(new Query(new Criteria() |
|
|
|
|
.orOperator(Criteria.where("englishName").regex(Pattern.compile(".*" + garbageForm.getName())), |
|
|
|
|
Criteria.where("name").regex(Pattern.compile(".*" + garbageForm.getName() + ".*")))), entityClass()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|