| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Page; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.DisplayConfigMapper; |
| | | import com.whyc.pojo.DisplayConfig; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DisplayConfigService { |
| | |
| | | public Response addOrUpdate(DisplayConfig config) { |
| | | boolean bl=false; |
| | | if(config.getId()==0){ |
| | | config.setUserId(ActionUtil.getUser().getUId().intValue()); |
| | | bl=mapper.addDisplay(config); |
| | | }else{ |
| | | bl=mapper.updateDisplay(config); |
| | | } |
| | | return new Response().set(1,bl,bl==true?"新增或者更新电源图形显示成功!":"新增或者更新电源图形显示失败!"); |
| | | } |
| | | //查询电源图形列表 |
| | | public Response getList() { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("user_id",ActionUtil.getUser().getUId().intValue()); |
| | | List list=mapper.selectList(wrapper); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().set(1,pageInfo); |
| | | } |
| | | } |