| | |
| | | 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 {
|
| | |
| | | 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);
|
| | |
| | | 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);
|
| | |
| | | public void addOrModify(MonitorPoint monitorPoint) {
|
| | | try{
|
| | | if(monitorPoint.getId()==null){
|
| | | monitorPoint.setIsDelete(Constants.IS_DELETE_FALSE);
|
| | | monitorPointMapper.insertSelective(monitorPoint);
|
| | | }else{
|
| | | monitorPointMapper.updateByPrimaryKeySelective(monitorPoint);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @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;
|
| | | }
|
| | | }
|