| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.RectifierPowerCtrlMapper; |
| | | import com.whyc.pojo.RectifierPowerControl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class RectifierPowerCtrlService { |
| | | |
| | | @Resource |
| | | private RectifierPowerCtrlMapper mapper; |
| | | |
| | | public Response<IPage<RectifierPowerControl>> getAll(int pageNum, int pageSize) { |
| | | IPage<RectifierPowerControl> rectifierPowerControlIPage = mapper.selectPage(new Page<>(pageNum, pageSize), null); |
| | | return new Response<IPage<RectifierPowerControl>>().set(1,rectifierPowerControlIPage); |
| | | } |
| | | |
| | | public Response<List<RectifierPowerControl>> getAll() { |
| | | List<RectifierPowerControl> rectifierPowerControlList = mapper.selectList(null); |
| | | return new Response<List<RectifierPowerControl>>().set(1,rectifierPowerControlList); |
| | | } |
| | | |
| | | public Response<RectifierPowerControl> getInfoByDevId(int devId) { |
| | | QueryWrapper<RectifierPowerControl> query = Wrappers.query(); |
| | | query.eq("dev_id",devId); |
| | | RectifierPowerControl rectifierPowerControl = mapper.selectOne(query); |
| | | return new Response<RectifierPowerControl>().set(1,rectifierPowerControl); |
| | | } |
| | | } |