| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.AppParamMapper; |
| | | import com.whyc.pojo.db_param.AppParam; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | wrapper.orderByAsc("id"); |
| | | return mapper.selectList(wrapper); |
| | | } |
| | | //读取权重(1.2.16) |
| | | public Response getHehavior() { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("category_id",2); |
| | | wrapper.orderByAsc("id"); |
| | | List<AppParam> list=mapper.selectList(wrapper); |
| | | return new Response().setII(1,list!=null,list,"读取权重"); |
| | | } |
| | | //设置权重(1.2.16) |
| | | public Response setHehavior(List<AppParam> list) { |
| | | for (AppParam param:list) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | wrapper.eq("param_name_psx",param.getParamNamePsx()); |
| | | wrapper.eq("param_value",param.getParamValue()); |
| | | mapper.update(param,wrapper); |
| | | } |
| | | return new Response().set(1,true,"设置权重(1.2.16)"); |
| | | } |
| | | } |