区域报告接口
This commit is contained in:
@@ -844,24 +844,21 @@
|
||||
(t.statisValue)/t.flowMeal flowProportion
|
||||
from (
|
||||
SELECT
|
||||
a.id,
|
||||
a.Name name,
|
||||
device.Name name,
|
||||
sub.Name substation,
|
||||
a.level,
|
||||
m.Time_Id updateTime,
|
||||
b.run_flag runFlag,
|
||||
b.com_flag comFlag,
|
||||
b.id deviceId,
|
||||
ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
||||
ROUND(ifnull(m.Actual_Value,0)/1024/1024,2) statisValue
|
||||
FROM pq_line a
|
||||
INNER JOIN pq_line sub ON sub.id = a.pid
|
||||
INNER JOIN pq_device b ON a.id = b.id
|
||||
LEFT JOIN cld_month_flow m ON b.id = m.Dev_Id
|
||||
FROM cld_month_flow m
|
||||
INNER JOIN pq_line device ON device.id=m.Dev_Id
|
||||
INNER JOIN pq_device b ON device.id=b.id
|
||||
INNER JOIN pq_line sub ON device.pid = sub.id
|
||||
LEFT JOIN cld_dev_meal c ON b.id = c.line_id
|
||||
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
|
||||
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
|
||||
where a.id in
|
||||
where device.id in
|
||||
<foreach item="item" collection="devs" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
SELECT
|
||||
ptm.Time_Id AS time,
|
||||
IFNULL(COUNT(ptm.Dev_Id),3.14159)AS deviceAbnormalNum
|
||||
FROM pq_line line
|
||||
INNER JOIN pq_line vol ON line.pid=vol.id
|
||||
INNER JOIN pq_line device ON vol.pid=device.id
|
||||
LEFT JOIN pqs_top_msg ptm ON ptm.Dev_Id = device.Id
|
||||
LEFT JOIN pq_line_detail pld ON pld.Id=line.Id
|
||||
FROM pqs_top_msg ptm
|
||||
INNER JOIN pq_line device ON ptm.Dev_Id = device.Id
|
||||
INNER JOIN pq_line vol ON vol.pid = device.Id
|
||||
INNER JOIN pq_line line ON line.pid = vol.id
|
||||
INNER JOIN pq_line_detail pld ON pld.Id=line.Id
|
||||
WHERE
|
||||
ptm.State=1
|
||||
AND
|
||||
@@ -19,7 +19,6 @@
|
||||
AND pld.Line_Grade=#{lineGrade}
|
||||
</if>
|
||||
GROUP BY ptm.Time_Id
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getTopMsgDetail" resultType="com.njcn.device.pq.pojo.po.TopMsgPO">
|
||||
|
||||
@@ -62,5 +62,14 @@ public class EventDictParam {
|
||||
private String id;
|
||||
|
||||
|
||||
/**
|
||||
* 0.监测点模板 1.区域模板
|
||||
*/
|
||||
@ApiModelProperty("type")
|
||||
@NotBlank(message = ValidMessage.DICT_TYPE_ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String type;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,4 +33,6 @@ public class EventReportDictVO implements Serializable {
|
||||
@ApiModelProperty("子级")
|
||||
List<EventReportDictVO> children;
|
||||
|
||||
private Boolean flag;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.EventTemplateParam;
|
||||
import com.njcn.system.pojo.po.EventTemplate;
|
||||
import com.njcn.system.pojo.vo.EventReportDictVO;
|
||||
import com.njcn.system.pojo.vo.EventTemplateVO;
|
||||
import com.njcn.system.service.IEventTemplateService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -155,4 +156,23 @@ public class EventTemplateController extends BaseController{
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.DELETE_PID_UNEXIST, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据模板id查询关系
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/selectReleation")
|
||||
@ApiOperation("根据模板id查询关系")
|
||||
@ApiImplicitParam(name = "id", value = "角色索引", required = true)
|
||||
public HttpResult<List<EventReportDictVO>> selectReleation(@RequestParam @Validated String id) {
|
||||
String methodDescribe = getMethodDescribe("selectReleation");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, id);
|
||||
List<EventReportDictVO> res = iEventTemplateService.selectReleation(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,11 @@ public interface TemplateRelMapper extends BaseMapper<TemplateRel> {
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<TemplateRel> selectRelevance(@Param("ids") List<String> ids);
|
||||
List<TemplateRel> selectRelevance (@Param("ids") List<String> ids);
|
||||
|
||||
boolean batchInsert(@Param("list") List<TemplateRel> list);
|
||||
boolean batchInsert (@Param("list") List<TemplateRel> list);
|
||||
|
||||
boolean deleteByRtId(@Param("rtId") String id);
|
||||
boolean deleteByRtId (@Param("rtId") String id);
|
||||
|
||||
List<String> selectReleation (@Param("id") String id);
|
||||
}
|
||||
|
||||
@@ -25,4 +25,11 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectReleation" resultType="java.lang.String">
|
||||
SELECT
|
||||
rd.Name
|
||||
FROM report_relevancy rr
|
||||
INNER JOIN report_dict rd ON rr.Rd_Id = rd.Id
|
||||
WHERE rr.Rt_Id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.param.EventTemplateParam;
|
||||
import com.njcn.system.pojo.po.EventTemplate;
|
||||
import com.njcn.system.pojo.vo.EventReportDictVO;
|
||||
import com.njcn.system.pojo.vo.EventTemplateVO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -51,4 +52,6 @@ public interface IEventTemplateService extends IService<EventTemplate> {
|
||||
* @return
|
||||
*/
|
||||
Boolean selectRelevance(List<String> ids);
|
||||
|
||||
List<EventReportDictVO> selectReleation (String id);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public class EventDictServiceImpl extends ServiceImpl<EventDictMapper, ReportDic
|
||||
queryWrapper.orderBy(true, true, "report_dict.update_time");
|
||||
}
|
||||
}
|
||||
queryWrapper.eq("report_dict.state", DataStateEnum.ENABLE.getCode());
|
||||
queryWrapper.eq("report_dict.state", DataStateEnum.ENABLE.getCode()).eq("report_dict.Type",dictQueryParam.getType());
|
||||
List<ReportDict> reportAllDicts = this.baseMapper.selectList(queryWrapper);
|
||||
List<ReportDict> reportDicts = new ArrayList<>();
|
||||
reportAllDicts.stream().filter(reportDict -> reportDict.getId().equals(dictQueryParam.getId())).forEach(reportDict -> {
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.njcn.system.pojo.param.EventTemplateParam;
|
||||
import com.njcn.system.pojo.po.EventTemplate;
|
||||
import com.njcn.system.pojo.po.ReportTemplate;
|
||||
import com.njcn.system.pojo.po.TemplateRel;
|
||||
import com.njcn.system.pojo.vo.EventReportDictVO;
|
||||
import com.njcn.system.pojo.vo.EventTemplateVO;
|
||||
import com.njcn.system.service.IEventTemplateService;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
@@ -168,10 +169,23 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EventReportDictVO> selectReleation(String id) {
|
||||
List<EventReportDictVO> list = new ArrayList<>();
|
||||
List<String> configs = templateRelMapper.selectReleation(id);
|
||||
configs.forEach(config -> {
|
||||
EventReportDictVO eventReportDictVO = new EventReportDictVO();
|
||||
eventReportDictVO.setName(config);
|
||||
eventReportDictVO.setFlag(true);
|
||||
list.add(eventReportDictVO);
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 名称重复校验
|
||||
*/
|
||||
private void checkName(EventTemplateParam eventTemplateParam,boolean flag){
|
||||
private void checkName(EventTemplateParam eventTemplateParam,boolean flag) {
|
||||
LambdaQueryWrapper<EventTemplate> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(EventTemplate::getName,eventTemplateParam.getName())
|
||||
.eq(EventTemplate::getType,eventTemplateParam.getType());
|
||||
|
||||
Reference in New Issue
Block a user