Commit 2833c1e7 by shenjinzhu

修改部分查询

parent ad7561f8
...@@ -133,7 +133,7 @@ public class TemplateDaoImpl implements TemplateDao { ...@@ -133,7 +133,7 @@ public class TemplateDaoImpl implements TemplateDao {
return null; return null;
} }
DBObject query=new BasicDBObject(); DBObject query=new BasicDBObject();
query.put("templateName", new BasicDBObject("$regex",templateName)); query.put("tempName", new BasicDBObject("$regex",templateName));
query.put("pt", pt); query.put("pt", pt);
DBCursor cursor=con.find(query).sort(new BasicDBObject("createDate",-1)).skip((pageNo-1)*pageSize).limit(pageSize); DBCursor cursor=con.find(query).sort(new BasicDBObject("createDate",-1)).skip((pageNo-1)*pageSize).limit(pageSize);
while(cursor.hasNext()){ while(cursor.hasNext()){
...@@ -211,7 +211,7 @@ public class TemplateDaoImpl implements TemplateDao { ...@@ -211,7 +211,7 @@ public class TemplateDaoImpl implements TemplateDao {
if (con == null) { if (con == null) {
return 0; return 0;
} }
return (int) con.count(new BasicDBObject("templateName",new BasicDBObject("$regex",templateName)) return (int) con.count(new BasicDBObject("tempName",new BasicDBObject("$regex",templateName))
.append("pt", pt)); .append("pt", pt));
} }
......
...@@ -37,7 +37,7 @@ public class MessageConteoller { ...@@ -37,7 +37,7 @@ public class MessageConteoller {
return JSON.toJSONString(result); return JSON.toJSONString(result);
} else { } else {
PageEty page = msgService.findByTmpName(tempName, pageNo, pageSize, pt); PageEty page = msgService.findByTmpName(tempName, pageNo, pageSize, pt);
JsonResult result = new JsonResult(true, 200, "请求成功", 1); JsonResult result = new JsonResult(true, 200, "请求成功", page);
return JSON.toJSONString(result); return JSON.toJSONString(result);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment