| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.AFERectifierHistoryMapper; |
| | | import com.whyc.mapper.AFERectifierMapper; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.AFEInverterState; |
| | | import com.whyc.pojo.AFERectifierState; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.sql.Wrapper; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class AFERectifierService { |
| | | |
| | | @Resource |
| | | private AFERectifierMapper mapper; |
| | | |
| | | @Resource |
| | | private AFERectifierHistoryMapper historyMapper; |
| | | |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | /**分页*/ |
| | | public Response<IPage<AFERectifierState>> getAll(int pageNum,int pageSize) { |
| | |
| | | AFERectifierState afeRectifierState = mapper.selectOne(query); |
| | | return new Response<AFERectifierState>().set(1,afeRectifierState); |
| | | } |
| | | |
| | | public Response<PageInfo<AFERectifierState>> getHistory(int pageNum, int pageSize, int devId) { |
| | | List<String> tableNames = commonMapper.getTableName("db_3.5mw_motor_history", "tb_afe_rectifier_state_" + devId); |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<AFERectifierState> afeInverterStates = historyMapper.getHistory(tableNames); |
| | | PageInfo<AFERectifierState> afeInverterStatePageInfo = new PageInfo<>(afeInverterStates); |
| | | return new Response<PageInfo<AFERectifierState>>().set(1,afeInverterStatePageInfo); |
| | | } |
| | | } |