package com.fgkj.services;
|
|
import com.fgkj.dto.App_Param;
|
import com.fgkj.dto.ServiceModel;
|
import com.fgkj.mapper.impl.App_ParamMapper;
|
import org.springframework.stereotype.Service;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
@Service
|
public class App_ParamService {
|
|
@Resource
|
private App_ParamMapper mapper;;
|
|
ServiceModel model = new ServiceModel();
|
|
//根据discharge/charge/poweroff查询
|
@GetMapping("byInfo")
|
public ServiceModel serchByInfo(App_Param param) {
|
ServiceModel model = new ServiceModel();
|
List list=mapper.serchByInfo(param);
|
if(list!=null&&list.size()>0){
|
model.setCode(1);
|
model.setMsg("查询成功!");
|
model.setData(list);
|
}else{
|
model.setCode(0);
|
model.setMsg("查询失败!");
|
}
|
//System.out.println(model);
|
return model;
|
}
|
|
|
//修改参数
|
@PutMapping("/")
|
public ServiceModel update(List<App_Param> params) {
|
ServiceModel model = new ServiceModel();
|
boolean bl=mapper.updatePro(params)>0;
|
|
if(bl){
|
model.setCode(1);
|
model.setMsg("修改成功!");
|
}else{
|
model.setCode(0);
|
model.setMsg("修改失败!");
|
}
|
return model;
|
}
|
|
}
|