Commit 3d73e199 authored by chenzhao's avatar chenzhao

修改代码

parent cab05cb6
......@@ -15,6 +15,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
*
......@@ -116,8 +117,14 @@ public class IdxBizFanHealthIndexController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测风机层左侧列表", notes = "预警监测风机层左侧列表")
@GetMapping(value = "/tableLeftList")
public ResponseModel<List<IdxBizFanHealthIndexDto>> queryForLeftTableList(String STATION,String HEALTHLEVEL) {
return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.queryForLeftTableList(STATION,HEALTHLEVEL));
public ResponseModel<Page<Map<String,Object>>> queryForLeftTableList(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,Integer current,Integer size) {
Page<Map<String,Object>> page = new Page<Map<String,Object>>();
page.setCurrent(current);
page.setSize(size);
int total = idxBizFanHealthIndexServiceImpl.queryForLeftTableListCount(STATION, HEALTHLEVEL, EQUIPMENTNAME);
page.setTotal(Long.valueOf(total));
page.setRecords(idxBizFanHealthIndexServiceImpl.queryForLeftTableList(STATION,HEALTHLEVEL,EQUIPMENTNAME,(current-1)*size,size));
return ResponseHelper.buildResponse(page);
}
}
......@@ -99,5 +99,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<String> getAddressInfo();
List<IdxBizFanHealthIndexDto> queryForLeftTableList(String STATION,String HEALTHLEVEL);
List<Map<String,Object>> queryForLeftTableList(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,Integer current,Integer size);
int queryForLeftTableListCount(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME);
}
......@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
import java.util.Map;
/**
* 服务实现类
......@@ -32,7 +33,11 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
return this.queryForList("" , false);
}
public List<IdxBizFanHealthIndexDto> queryForLeftTableList(String STATION,String HEALTHLEVEL){
return this.getBaseMapper().queryForLeftTableList(STATION,HEALTHLEVEL);
public List<Map<String,Object>> queryForLeftTableList(String STATION, String HEALTHLEVEL, String EQUIPMENTNAME, Integer current, Integer size){
return this.getBaseMapper().queryForLeftTableList(STATION,HEALTHLEVEL,EQUIPMENTNAME,current,size);
}
public int queryForLeftTableListCount(String STATION, String HEALTHLEVEL, String EQUIPMENTNAME){
return this.getBaseMapper().queryForLeftTableListCount(STATION,HEALTHLEVEL,EQUIPMENTNAME);
}
}
\ No newline at end of file
......@@ -854,7 +854,7 @@
select index_address from wl_equipment_specific_index where gateway_id = '1668801435891929089' and data_type = 'analog' limit 100
</select>
<select id="queryForLeftTableList" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanHealthIndexDto">
<select id="queryForLeftTableList" resultType="map">
SELECT
b.*,
IFNULL( ibfhi.HEALTH_INDEX, 100 ) as HEALTH_INDEX ,
......@@ -887,9 +887,44 @@
<if test="HEALTH_LEVEL != '' AND HEALTH_LEVEL != null">
AND HEALTH_LEVEL = #{HEALTHLEVEL}
</if>
<if test="EQUIPMENTNAME != '' AND EQUIPMENTNAME != null">
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
</where>
limit ${current},${size}
</select>
<select id="queryForLeftTableListCount" resultType="int">
SELECT
count(1)
FROM
(
SELECT
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
`idx_biz_fan_point_process_variable_classification`.`STATION` AS `STATION`
FROM
`idx_biz_fan_point_process_variable_classification`
WHERE
`idx_biz_fan_point_process_variable_classification`.`TAG_CODE` = '分析变量'
GROUP BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME`
ORDER BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` ASC
) b
LEFT JOIN `idx_biz_fan_health_index` `ibfhi` ON ( ( `b`.`EQUIPMENT_NAME` = `ibfhi`.`EQUIPMENT_NAME` ) )
AND ibfhi.ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_TYPE = '按天' AND DATE_FORMAT(ibfhi.REC_DATE,"%Y-%m-%d") = DATE_FORMAT(NOW(),"%Y-%m-%d")
<where>
<if test="STATION != '' AND STATION != null">
b.STATION = #{STATION}
</if>
<if test="HEALTH_LEVEL != '' AND HEALTH_LEVEL != null">
AND HEALTH_LEVEL = #{HEALTHLEVEL}
</if>
<if test="EQUIPMENTNAME != '' AND EQUIPMENTNAME != null">
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
</where>
</select>
</mapper>
......@@ -116,7 +116,7 @@
<select id="queryForLeftTableListByPointCount"
resultType="int">
SELECT
COUNT(b.*) as value
COUNT(1) as value
FROM
(
SELECT
......
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