Commit d6894817 authored by zhangsen's avatar zhangsen

公用API参数修改

parent f3215d30
...@@ -19,12 +19,12 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato ...@@ -19,12 +19,12 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato
//批量修改 //批量修改
void UpdateMonitorFanIndicator(@Param(value = "list") List<IndexDto> list); void UpdateMonitorFanIndicator(@Param(value = "list") List<IndexDto> list);
Integer queryByPageTotal(@Param("fanCode") String fanCode, Integer queryByPageTotal(@Param("equipmentNumber") String equipmentNumber,
@Param("gateway") String gateway, @Param("gateway") String gateway,
@Param("frontModule") String frontModule); @Param("frontModule") String frontModule);
Page<MonitorFanIndicator> queryByPage(@Param("size") long size, List<MonitorFanIndicator> queryByPage(@Param("size") long size,
@Param("fanCode") String fanCode, @Param("equipmentNumber") String equipmentNumber,
@Param("gateway") String gateway, @Param("gateway") String gateway,
@Param("frontModule") String frontModule, @Param("frontModule") String frontModule,
@Param("offset") int offset); @Param("offset") int offset);
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
<select id="queryByPage" resultType="com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator"> <select id="queryByPage" resultType="com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator">
select * from monitor_fan_indicator select * from monitor_fan_indicator
<where> <where>
<if test="fanCode != null and fanCode !=''"> <if test="equipmentNumber != null and equipmentNumber !=''">
fan_code like concat('%', #{fanCode},'%') equipment_number = #{equipmentNumber}
</if> </if>
<if test="gateway != null and gateway !=''"> <if test="gateway != null and gateway !=''">
AND gateway = #{gateway} AND gateway = #{gateway}
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
<select id="queryByPageTotal" resultType="java.lang.Integer"> <select id="queryByPageTotal" resultType="java.lang.Integer">
select count(1) from monitor_fan_indicator select count(1) from monitor_fan_indicator
<where> <where>
<if test="fanCode != null and fanCode !=''"> <if test="equipmentNumber != null and equipmentNumber !=''">
fan_code like concat('%', #{fanCode},'%') equipment_number = #{equipmentNumber}
</if> </if>
<if test="gateway != null and gateway !=''"> <if test="gateway != null and gateway !=''">
AND gateway = #{gateway} AND gateway = #{gateway}
......
...@@ -34,14 +34,14 @@ public class MonitorFanIdxController extends BaseController { ...@@ -34,14 +34,14 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据风机编码、网关ID、前段展示模块查询表数据") @ApiOperation(value = "根据设备编号、网关ID、前段展示模块查询表数据")
@GetMapping("/getFanIdxInfoByPage") @GetMapping("/getFanIdxInfoByPage")
public ResponseModel<IPage<MonitorFanIndicator>> getFanIdxInfoByPage(@RequestParam(value = "fanCode", required = false) String fanCode, public ResponseModel<IPage<MonitorFanIndicator>> getFanIdxInfoByPage(@RequestParam(value = "equipmentNumber", required = false) String equipmentNumber,
@RequestParam(value = "gateway", required = false) String gateway, @RequestParam(value = "gateway", required = false) String gateway,
@RequestParam(value = "frontModule", required = false) String frontModule, @RequestParam(value = "frontModule", required = false) String frontModule,
@RequestParam(value = "current", required = false) int current, @RequestParam(value = "current", required = false) int current,
@RequestParam(value = "size", required = false) int size) { @RequestParam(value = "size", required = false) int size) {
return ResponseHelper.buildResponse(monitorFanIndicator.getFanIdxInfoByPage(fanCode, gateway, frontModule, current, size)); return ResponseHelper.buildResponse(monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber, gateway, frontModule, current, size));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
......
...@@ -51,12 +51,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -51,12 +51,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
public IPage<MonitorFanIndicator> getFanIdxInfoByPage(String fanCode, String gateway, String frontModule, int current, int size) { public IPage<MonitorFanIndicator> getFanIdxInfoByPage(String equipmentNumber, String gateway, String frontModule, int current, int size) {
Page<MonitorFanIndicator> page = new Page<>(current, size); Page<MonitorFanIndicator> page = new Page<>(current, size);
Integer integer = monitorFanIndicatorregionMapper.queryByPageTotal(fanCode, gateway, frontModule); Integer integer = monitorFanIndicatorregionMapper.queryByPageTotal(equipmentNumber, gateway, frontModule);
Page<MonitorFanIndicator> monitorFanIndicators = monitorFanIndicatorregionMapper.queryByPage(page.getSize(), fanCode, gateway, frontModule, (current - 1) * size); List<MonitorFanIndicator> monitorFanIndicators = monitorFanIndicatorregionMapper.queryByPage(page.getSize(), equipmentNumber, gateway, frontModule, (current - 1) * size);
monitorFanIndicators.setTotal(integer); page.setTotal(integer);
return monitorFanIndicators; page.setRecords(monitorFanIndicators);
return page;
} }
public TreeDto getTreeInfo(String sequenceNbr) { public TreeDto getTreeInfo(String sequenceNbr) {
......
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