获取项目设备台账信息接口
正在显示
7 个修改的文件
包含
124 行增加
和
3 行删除
1 | package com.skua.modules.equip.controller; | ||
2 | |||
3 | import com.skua.core.api.vo.Result; | ||
4 | import com.skua.core.aspect.annotation.AutoLog; | ||
5 | import com.skua.modules.equip.entity.EquipInfo; | ||
6 | import com.skua.modules.equip.service.IFmEquipInfoService; | ||
7 | import com.skua.modules.equip.vo.FmEquipResult; | ||
8 | import io.swagger.annotations.Api; | ||
9 | import io.swagger.annotations.ApiOperation; | ||
10 | import lombok.extern.slf4j.Slf4j; | ||
11 | import org.springframework.beans.factory.annotation.Autowired; | ||
12 | import org.springframework.web.bind.annotation.*; | ||
13 | |||
14 | import java.util.List; | ||
15 | |||
16 | /** | ||
17 | * 设备管理 | ||
18 | */ | ||
19 | @Slf4j | ||
20 | @Api(tags="设备管理") | ||
21 | @RestController | ||
22 | @RequestMapping("/3d/equip") | ||
23 | public class FmEquipInfoController { | ||
24 | @Autowired | ||
25 | private IFmEquipInfoService fmEquipInfoService; | ||
26 | |||
27 | /** | ||
28 | * 设备列表查询 | ||
29 | * @param projectId | ||
30 | * @return | ||
31 | */ | ||
32 | @AutoLog(value = "设备管理列表查询") | ||
33 | @ApiOperation(value="设备管理列表查询", notes="设备管理列表查询") | ||
34 | @GetMapping(value = "/list") | ||
35 | public Result<List<FmEquipResult>> queryList(String projectId) { | ||
36 | Result<List<FmEquipResult>> result = new Result<List<FmEquipResult>>(); | ||
37 | List<FmEquipResult> pageList = fmEquipInfoService.queryList(projectId); | ||
38 | result.setSuccess(true); | ||
39 | result.setResult(pageList); | ||
40 | return result; | ||
41 | } | ||
42 | |||
43 | } |
1 | package com.skua.modules.equip.mapper; | 1 | package com.skua.modules.equip.mapper; |
2 | 2 | ||
3 | import java.util.List; | ||
4 | |||
5 | import org.apache.ibatis.annotations.Param; | ||
6 | import com.skua.modules.equip.entity.EquipInfo; | 3 | import com.skua.modules.equip.entity.EquipInfo; |
7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
8 | 5 | ... | ... |
1 | package com.skua.modules.equip.mapper; | ||
2 | |||
3 | import com.skua.modules.equip.vo.FmEquipResult; | ||
4 | import org.apache.ibatis.annotations.Param; | ||
5 | |||
6 | import java.util.List; | ||
7 | |||
8 | /** | ||
9 | * 设备管理 | ||
10 | */ | ||
11 | public interface FmEquipInfoMapper { | ||
12 | |||
13 | List<FmEquipResult> queryListForView(@Param("projectId") String projectId); | ||
14 | } |
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | <mapper namespace="com.skua.modules.equip.mapper.FmEquipInfoMapper"> | ||
4 | |||
5 | <select id="queryListForView" resultType="com.skua.modules.equip.vo.FmEquipResult"> | ||
6 | select * from view_equipment where project_id = #{projectId} | ||
7 | </select> | ||
8 | |||
9 | </mapper> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | package com.skua.modules.equip.service.impl; | ||
2 | |||
3 | import com.skua.modules.equip.mapper.FmEquipInfoMapper; | ||
4 | import com.skua.modules.equip.service.IFmEquipInfoService; | ||
5 | import com.skua.modules.equip.vo.FmEquipResult; | ||
6 | import org.springframework.beans.factory.annotation.Autowired; | ||
7 | import org.springframework.stereotype.Service; | ||
8 | |||
9 | import java.util.List; | ||
10 | |||
11 | /** | ||
12 | * 设备管理 | ||
13 | */ | ||
14 | @Service | ||
15 | public class FmEquipInfoServiceImpl implements IFmEquipInfoService { | ||
16 | |||
17 | @Autowired | ||
18 | private FmEquipInfoMapper fmEquipInfoMapper; | ||
19 | |||
20 | @Override | ||
21 | public List<FmEquipResult> queryList(String projectId) { | ||
22 | List<FmEquipResult> list = fmEquipInfoMapper.queryListForView(projectId); | ||
23 | return list; | ||
24 | } | ||
25 | } |
1 | package com.skua.modules.equip.vo; | ||
2 | |||
3 | import lombok.Data; | ||
4 | |||
5 | /** | ||
6 | * 设备管理 | ||
7 | */ | ||
8 | @Data | ||
9 | public class FmEquipResult { | ||
10 | |||
11 | /**设备台账id*/ | ||
12 | private String equipId; | ||
13 | /**设备类别*/ | ||
14 | private String equipType; | ||
15 | /**设备名称*/ | ||
16 | private String equipName; | ||
17 | /**所属项目*/ | ||
18 | private String projectId; | ||
19 | |||
20 | } |
-
请 注册 或 登录 后发表评论