Commit 1db86881 authored by 竹天卫's avatar 竹天卫

设备隐患 有个设备下面可以有多条隐患记录

parent c6bcb672
...@@ -33,21 +33,41 @@ public class TEquipmentTroubleController { ...@@ -33,21 +33,41 @@ public class TEquipmentTroubleController {
private ITEquipmentTroubleService equipmentTroubleService; private ITEquipmentTroubleService equipmentTroubleService;
@ApiOperation(value = "设备隐患分页") @ApiOperation(value = "设备隐患分页-设备")
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
@ApiImplicitParam(name = "EquipmentName", value = "设备名称", paramType = "query", dataType = "EquipmentName") @ApiImplicitParam(name = "EquipmentName", value = "设备名称", paramType = "query", dataType = "String")
}) })
@GetMapping("/getPage") @GetMapping("/getPage")
public R getPage(PageQuery pageQuery, String EquipmentName) { public R getPage(PageQuery pageQuery, String EquipmentName) {
return equipmentTroubleService.getPage(pageQuery, EquipmentName); return equipmentTroubleService.getPage(pageQuery, EquipmentName);
} }
@ApiOperation(value = "设备隐患分页-隐患")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "EquipmentID", value = "设备编号", paramType = "query", dataType = "String")
})
@GetMapping("/getTroublePage")
public R getTroublePage(PageQuery pageQuery, String EquipmentID) {
return equipmentTroubleService.getTroublePage(pageQuery, EquipmentID);
}
@ApiOperation(value = "设备隐患详情") @ApiOperation(value = "设备隐患详情")
@GetMapping("/getDetail/{EquipmentID}") @GetMapping("/getDetail/{EquipmentID}")
public R getDetail(@PathVariable @NotBlank String EquipmentID) { public R getDetail(@PathVariable @NotBlank String EquipmentID) {
return equipmentTroubleService.getDetail(EquipmentID); return equipmentTroubleService.getDetail(EquipmentID);
} }
@ApiOperation(value = "设备隐患详情-根据设备隐患id查询")
@GetMapping("/getDetailNew/{Uid}")
public R getDetailNew(@PathVariable @NotBlank String Uid) {
return equipmentTroubleService.getDetailNew(Uid);
}
@ApiOperation(value = "保存设备隐患结果") @ApiOperation(value = "保存设备隐患结果")
@PostMapping("/trouble") @PostMapping("/trouble")
public R trouble(@RequestBody TEquipmentTroubleQuery query) { public R trouble(@RequestBody TEquipmentTroubleQuery query) {
......
...@@ -22,5 +22,6 @@ public interface TEquipmentTroubleMapper extends BaseMapper<TEquipmentTrouble> { ...@@ -22,5 +22,6 @@ public interface TEquipmentTroubleMapper extends BaseMapper<TEquipmentTrouble> {
IPage<TEquipmentTroubleVo> getPage(@Param("page") Page page, @Param("params") Map<String, Object> params); IPage<TEquipmentTroubleVo> getPage(@Param("page") Page page, @Param("params") Map<String, Object> params);
IPage<TEquipmentTroubleVo> getTroublePage(@Param("page") Page page, @Param("EquipmentID") String EquipmentID);
} }
...@@ -23,4 +23,13 @@ ...@@ -23,4 +23,13 @@
</if> </if>
</where> </where>
</sql> </sql>
<select id="getTroublePage" resultType="cn.wise.sc.acquisition.business.model.vo.TEquipmentTroubleVo">
select tet.EquipmentID,tet.EquipmentName,
tet.Uid,tet.Fxr,tet.Fxrq,tet.Yhms,tet.Clcs,tet.Clrq,tet.Txr,tet.Txrq,tet.Clzt
from T_Equipment_Trouble tet
where tet.EquipmentID = #{EquipmentID}
order by tet.Txrq ASC
</select>
</mapper> </mapper>
...@@ -20,8 +20,12 @@ public interface ITEquipmentTroubleService extends IService<TEquipmentTrouble> { ...@@ -20,8 +20,12 @@ public interface ITEquipmentTroubleService extends IService<TEquipmentTrouble> {
R<IPage<TEquipmentTroubleVo>> getPage(PageQuery pageQuery, String EquipmentName); R<IPage<TEquipmentTroubleVo>> getPage(PageQuery pageQuery, String EquipmentName);
R<IPage<TEquipmentTroubleVo>> getTroublePage(PageQuery pageQuery, String EquipmentID);
R<TEquipmentTrouble> getDetail(String EquipmentID); R<TEquipmentTrouble> getDetail(String EquipmentID);
R<TEquipmentTrouble> getDetailNew(String Uid);
R trouble(TEquipmentTroubleQuery query); R trouble(TEquipmentTroubleQuery query);
} }
...@@ -47,7 +47,7 @@ public class TEquipmentTroubleServiceImpl extends ServiceImpl<TEquipmentTroubleM ...@@ -47,7 +47,7 @@ public class TEquipmentTroubleServiceImpl extends ServiceImpl<TEquipmentTroubleM
@Autowired @Autowired
private ITSysUserService userService; private ITSysUserService userService;
/** /**
* 设备隐患分页 * 设备隐患分页-设备
* @param pageQuery * @param pageQuery
* @param EquipmentName * @param EquipmentName
* @return * @return
...@@ -70,6 +70,21 @@ public class TEquipmentTroubleServiceImpl extends ServiceImpl<TEquipmentTroubleM ...@@ -70,6 +70,21 @@ public class TEquipmentTroubleServiceImpl extends ServiceImpl<TEquipmentTroubleM
return R.ok(pages); return R.ok(pages);
} }
/**
* 设备隐患分页-隐患
* @param pageQuery
* @param EquipmentID
* @return
*/
@Override
public R<IPage<TEquipmentTroubleVo>> getTroublePage(PageQuery pageQuery, String EquipmentID) {
Page<TEquipmentTroubleVo> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize());
IPage<TEquipmentTroubleVo> pages = equipmentTroubleMapper.getTroublePage(page, EquipmentID);
return R.ok(pages);
}
/** /**
* 设备隐患详情 * 设备隐患详情
...@@ -95,6 +110,20 @@ public class TEquipmentTroubleServiceImpl extends ServiceImpl<TEquipmentTroubleM ...@@ -95,6 +110,20 @@ public class TEquipmentTroubleServiceImpl extends ServiceImpl<TEquipmentTroubleM
return R.ok(trouble); return R.ok(trouble);
} }
/**
* 设备隐患详情-根据设备隐患id查询
* @param Uid
* @return
*/
@Override
public R<TEquipmentTrouble> getDetailNew(String Uid) {
Rcode.NOT_PARAM.assertNotNull(Uid);
TEquipmentTrouble trouble = equipmentTroubleMapper.selectById(Uid);
Rcode.NOT_FOUND.assertNotNull(trouble);
return R.ok(trouble);
}
/** /**
* 保存设备隐患结果 * 保存设备隐患结果
* @param query * @param query
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment