From 486428358c6a2252a48630df300873cb4c71a93c Mon Sep 17 00:00:00 2001
From: 沈斌 <bluelazysb@hotmail.com>
Date: Tue, 30 Jan 2018 22:37:45 +0800
Subject: [PATCH] updated

---
 src/main/java/com/moral/service/impl/MonitorPointServiceImpl.java |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/moral/service/impl/MonitorPointServiceImpl.java b/src/main/java/com/moral/service/impl/MonitorPointServiceImpl.java
index 8e2d6ce..fc0db0d 100644
--- a/src/main/java/com/moral/service/impl/MonitorPointServiceImpl.java
+++ b/src/main/java/com/moral/service/impl/MonitorPointServiceImpl.java
@@ -18,6 +18,7 @@
 import com.moral.mapper.MonitorPointMapper;
 import com.moral.service.MonitorPointService;
 import tk.mybatis.mapper.entity.Example;
+import tk.mybatis.mapper.entity.Example.Criteria;
 
 @Service
 public class MonitorPointServiceImpl implements MonitorPointService {
@@ -29,7 +30,10 @@
         ValidateUtil.notNull(parameters.get("areaName"), "param.is.null");
         return monitorPointMapper.getMonitorPointsByAreaName(parameters);
     }
-
+    @Override
+    public List<MonitorPoint> queryWithStateByMap(Map<String, Object> params){
+        return monitorPointMapper.selectWithStateByMap(params);
+    }
     @Override
     public PageBean queryByPageBean(PageBean pageBean) {
         Example example = ExampleUtil.generateExample(ENTITY_CLASS,pageBean);
@@ -46,7 +50,7 @@
         return new PageBean(monitorPointList);
     }
     @Override
-   public MonitorPoint selectWithRelationById(Integer id){
+   public MonitorPoint queryWithRelationById(Integer id){
          Example example = new Example(ENTITY_CLASS);
          example.or().andEqualTo("id",id);
          List<MonitorPoint> monitorPointList = monitorPointMapper.selectWithAreaNameByExample(example);
@@ -56,6 +60,7 @@
     public void addOrModify(MonitorPoint monitorPoint) {
         try{
             if(monitorPoint.getId()==null){
+                monitorPoint.setIsDelete(Constants.IS_DELETE_FALSE);
                 monitorPointMapper.insertSelective(monitorPoint);
             }else{
                 monitorPointMapper.updateByPrimaryKeySelective(monitorPoint);
@@ -83,4 +88,15 @@
         }
     }
 
+	@Override
+	public List<MonitorPoint> getMonitorPointsByName(String name) {
+		Example example = new Example(MonitorPoint.class);
+		Criteria criteria = example.createCriteria();
+
+		criteria.andEqualTo("isDelete", Constants.IS_DELETE_FALSE).andLike("name", "%" + name + "%");
+		example.or().andEqualTo("isDelete", Constants.IS_DELETE_FALSE).andCondition("getPY(name) like ", "%" + name + "%");
+
+		List<MonitorPoint> monitorPoints = monitorPointMapper.selectByExample(example);
+		return monitorPoints;
+	}
 }

--
Gitblit v1.8.0