From d7fb9e92779e971954ca59b86848569592f6185b Mon Sep 17 00:00:00 2001 From: whycxzp <perryhsu@163.com> Date: 星期四, 07 一月 2021 10:48:35 +0800 Subject: [PATCH] update basic --- src/main/java/com/whyc/service/MotorSystemInfService.java | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/whyc/service/MotorSystemInfService.java b/src/main/java/com/whyc/service/MotorSystemInfService.java index 1e1a762..2541d6f 100644 --- a/src/main/java/com/whyc/service/MotorSystemInfService.java +++ b/src/main/java/com/whyc/service/MotorSystemInfService.java @@ -1,9 +1,42 @@ package com.whyc.service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.whyc.dto.Response; +import com.whyc.mapper.MotorSystemInfMapper; +import com.whyc.pojo.MotorSystemInf; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + /** * */ +@Service public class MotorSystemInfService { + @Resource + private MotorSystemInfMapper mapper; + public Response getAll() { + try { + List<MotorSystemInf> motorSystemInfs = mapper.selectList(null); + return new Response<>().set(1,motorSystemInfs); + }catch (Exception e){ + e.printStackTrace(); + return new Response<>().setCode(0); + } + } + + public Response<List<MotorSystemInf>> getDevBySysId(int sysId) { + try{ + QueryWrapper<MotorSystemInf> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("sys_id",sysId); + List<MotorSystemInf> motorSystemInfs = mapper.selectList(queryWrapper); + return new Response<List<MotorSystemInf>>().set(1,motorSystemInfs); + }catch (Exception e){ + e.printStackTrace(); + return new Response<List<MotorSystemInf>>().setCode(0); + } + } } -- Gitblit v1.9.1