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

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

parent c6bcb672
......@@ -33,21 +33,41 @@ public class TEquipmentTroubleController {
private ITEquipmentTroubleService equipmentTroubleService;
@ApiOperation(value = "设备隐患分页")
@ApiOperation(value = "设备隐患分页-设备")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "EquipmentName", value = "设备名称", paramType = "query", dataType = "EquipmentName")
@ApiImplicitParam(name = "EquipmentName", value = "设备名称", paramType = "query", dataType = "String")
})
@GetMapping("/getPage")
public R getPage(PageQuery pageQuery, String 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 = "设备隐患详情")
@GetMapping("/getDetail/{EquipmentID}")
public R getDetail(@PathVariable @NotBlank String EquipmentID) {
return equipmentTroubleService.getDetail(EquipmentID);
}
@ApiOperation(value = "设备隐患详情-根据设备隐患id查询")
@GetMapping("/getDetailNew/{Uid}")
public R getDetailNew(@PathVariable @NotBlank String Uid) {
return equipmentTroubleService.getDetailNew(Uid);
}
@ApiOperation(value = "保存设备隐患结果")
@PostMapping("/trouble")
public R trouble(@RequestBody TEquipmentTroubleQuery query) {
......
......@@ -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> getTroublePage(@Param("page") Page page, @Param("EquipmentID") String EquipmentID);
}
......@@ -23,4 +23,13 @@
</if>
</where>
</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>
......@@ -20,8 +20,12 @@ public interface ITEquipmentTroubleService extends IService<TEquipmentTrouble> {
R<IPage<TEquipmentTroubleVo>> getPage(PageQuery pageQuery, String EquipmentName);
R<IPage<TEquipmentTroubleVo>> getTroublePage(PageQuery pageQuery, String EquipmentID);
R<TEquipmentTrouble> getDetail(String EquipmentID);
R<TEquipmentTrouble> getDetailNew(String Uid);
R trouble(TEquipmentTroubleQuery query);
}
......@@ -47,7 +47,7 @@ public class TEquipmentTroubleServiceImpl extends ServiceImpl<TEquipmentTroubleM
@Autowired
private ITSysUserService userService;
/**
* 设备隐患分页
* 设备隐患分页-设备
* @param pageQuery
* @param EquipmentName
* @return
......@@ -70,6 +70,21 @@ public class TEquipmentTroubleServiceImpl extends ServiceImpl<TEquipmentTroubleM
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
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
......
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