Commit ed8343b3 authored by caotao's avatar caotao

修改智能分析健康指数、权重等权限过滤

parent c2cdd554
...@@ -84,9 +84,9 @@ public class TdInfoQueryController extends BaseController { ...@@ -84,9 +84,9 @@ public class TdInfoQueryController extends BaseController {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String userId = reginParams.getUserModel().getUserId(); String userId = reginParams.getUserModel().getUserId();
StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH")); StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH"));
String orgCode = "86"; String orgCode = "86"+"%";
if (!ObjectUtils.isEmpty(stdUserEmpower)) { if (!ObjectUtils.isEmpty(stdUserEmpower)) {
orgCode = stdUserEmpower.getAmosOrgCode().get(0); orgCode = stdUserEmpower.getAmosOrgCode().get(0)+"%";
} }
dto.setOrgCode(orgCode); dto.setOrgCode(orgCode);
if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) { if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) {
...@@ -160,9 +160,9 @@ public class TdInfoQueryController extends BaseController { ...@@ -160,9 +160,9 @@ public class TdInfoQueryController extends BaseController {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String userId = reginParams.getUserModel().getUserId(); String userId = reginParams.getUserModel().getUserId();
StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH")); StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH"));
String orgCode = "86"; String orgCode = "86"+"%";
if (!ObjectUtils.isEmpty(stdUserEmpower)) { if (!ObjectUtils.isEmpty(stdUserEmpower)) {
orgCode = stdUserEmpower.getAmosOrgCode().get(0); orgCode = stdUserEmpower.getAmosOrgCode().get(0)+"%";
} }
dto.setOrgCode(orgCode); dto.setOrgCode(orgCode);
if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) { if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) {
...@@ -219,9 +219,9 @@ public class TdInfoQueryController extends BaseController { ...@@ -219,9 +219,9 @@ public class TdInfoQueryController extends BaseController {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String userId = reginParams.getUserModel().getUserId(); String userId = reginParams.getUserModel().getUserId();
StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH")); StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH"));
String orgCode = "86"; String orgCode = "86"+"%";
if (!ObjectUtils.isEmpty(stdUserEmpower)) { if (!ObjectUtils.isEmpty(stdUserEmpower)) {
orgCode = stdUserEmpower.getAmosOrgCode().get(0); orgCode = stdUserEmpower.getAmosOrgCode().get(0)+"%";
} }
dto.setOrgCode(orgCode); dto.setOrgCode(orgCode);
if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) { if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) {
...@@ -277,9 +277,9 @@ public class TdInfoQueryController extends BaseController { ...@@ -277,9 +277,9 @@ public class TdInfoQueryController extends BaseController {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String userId = reginParams.getUserModel().getUserId(); String userId = reginParams.getUserModel().getUserId();
StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH")); StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH"));
String orgCode = "86"; String orgCode = "86"+"%";
if (!ObjectUtils.isEmpty(stdUserEmpower)) { if (!ObjectUtils.isEmpty(stdUserEmpower)) {
orgCode = stdUserEmpower.getAmosOrgCode().get(0); orgCode = stdUserEmpower.getAmosOrgCode().get(0)+"%";
} }
dto.setOrgCode(orgCode); dto.setOrgCode(orgCode);
if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) { if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) {
......
...@@ -301,6 +301,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -301,6 +301,7 @@ public class HealthStatusIndicatorServiceImpl {
pvWarningRecord.setRecDate(format); pvWarningRecord.setRecDate(format);
pvWarningRecord.setTs(timestamp); pvWarningRecord.setTs(timestamp);
pvWarningRecord.setHealthIndex(String.format(CommonConstans.Onedecimalplaces,idxBizPvHealthIndices.get(0).getHealthIndex())); pvWarningRecord.setHealthIndex(String.format(CommonConstans.Onedecimalplaces,idxBizPvHealthIndices.get(0).getHealthIndex()));
pvWarningRecord.setOrgCode(idxBizPvHealthIndices.get(0).getOrgCode());
tdPvWarningRecordList.add(pvWarningRecord); tdPvWarningRecordList.add(pvWarningRecord);
// idxBizPvWarningRecordMapper.insert(idxBizPvWarningRecord); // idxBizPvWarningRecordMapper.insert(idxBizPvWarningRecord);
} }
......
...@@ -181,10 +181,11 @@ ...@@ -181,10 +181,11 @@
<if test="dto.subSystem!= null and dto.subSystem!= ''">AND sub_system = #{dto.subSystem} </if> <if test="dto.subSystem!= null and dto.subSystem!= ''">AND sub_system = #{dto.subSystem} </if>
<if test="dto.equipmentName!= null and dto.equipmentName!= ''">AND equipment_name = #{dto.equipmentName} <if test="dto.equipmentName!= null and dto.equipmentName!= ''">AND equipment_name = #{dto.equipmentName}
</if> </if>
</where>
<if test="dto.orgCode != null and dto.orgCode != ''"> <if test="dto.orgCode != null and dto.orgCode != ''">
org_code like CONCAT(#{dto.orgCode},'%') and org_code like #{dto.orgCode}
</if> </if>
</where>
<if test="dto.orderColumns != null and dto.orderColumns != ''"> <if test="dto.orderColumns != null and dto.orderColumns != ''">
order by ${dto.orderColumns} order by ${dto.orderColumns}
</if> </if>
...@@ -209,10 +210,11 @@ ...@@ -209,10 +210,11 @@
<if test="dto.subSystem!= null and dto.subSystem!= ''">AND sub_system = #{dto.subSystem} </if> <if test="dto.subSystem!= null and dto.subSystem!= ''">AND sub_system = #{dto.subSystem} </if>
<if test="dto.equipmentName!= null and dto.equipmentName!= ''">AND equipment_name = #{dto.equipmentName} <if test="dto.equipmentName!= null and dto.equipmentName!= ''">AND equipment_name = #{dto.equipmentName}
</if> </if>
</where>
<if test="dto.orgCode != null and dto.orgCode != ''"> <if test="dto.orgCode != null and dto.orgCode != ''">
org_code like CONCAT(#{dto.orgCode},'%') and org_code like #{dto.orgCode}
</if> </if>
</where>
</select> </select>
<select id="saveBatchHealthIndexLatestInfo" resultType="int"> <select id="saveBatchHealthIndexLatestInfo" resultType="int">
......
...@@ -241,10 +241,10 @@ ...@@ -241,10 +241,10 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
</where>
<if test="dto.orgCode != null and dto.orgCode != ''"> <if test="dto.orgCode != null and dto.orgCode != ''">
org_code like concat(#{dto.orgCode},'%') and org_code like #{dto.orgCode}
</if> </if>
</where>
<if test="dto.orderColumns != null and dto.orderColumns != ''"> <if test="dto.orderColumns != null and dto.orderColumns != ''">
order by ${dto.orderColumns} order by ${dto.orderColumns}
</if> </if>
...@@ -271,10 +271,10 @@ ...@@ -271,10 +271,10 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
</where>
<if test="dto.orgCode != null and dto.orgCode != ''"> <if test="dto.orgCode != null and dto.orgCode != ''">
org_code like concat(#{dto.orgCode},'%') and org_code like #{dto.orgCode}
</if> </if>
</where>
</select> </select>
<select id="getInfoByTs" resultType="com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord"> <select id="getInfoByTs" resultType="com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord">
......
...@@ -212,10 +212,11 @@ ...@@ -212,10 +212,11 @@
<if test="dto.healthLevel!= null and dto.healthLevel!= ''">AND health_level = #{dto.healthLevel} </if> <if test="dto.healthLevel!= null and dto.healthLevel!= ''">AND health_level = #{dto.healthLevel} </if>
<if test="dto.equipmentName!= null and dto.equipmentName!= ''">AND equipment_name = #{dto.equipmentName} <if test="dto.equipmentName!= null and dto.equipmentName!= ''">AND equipment_name = #{dto.equipmentName}
</if> </if>
</where>
<if test="dto.orgCode != null and dto.orgCode != ''"> <if test="dto.orgCode != null and dto.orgCode != ''">
org_code like CONCAT(#{dto.orgCode},'%') and org_code like #{dto.orgCode}
</if> </if>
</where>
<if test="dto.orderColumns != null and dto.orderColumns != ''"> <if test="dto.orderColumns != null and dto.orderColumns != ''">
order by ${dto.orderColumns} order by ${dto.orderColumns}
</if> </if>
...@@ -239,10 +240,11 @@ ...@@ -239,10 +240,11 @@
<if test="dto.healthLevel!= null and dto.healthLevel!= ''">AND health_level = #{dto.healthLevel} </if> <if test="dto.healthLevel!= null and dto.healthLevel!= ''">AND health_level = #{dto.healthLevel} </if>
<if test="dto.equipmentName!= null and dto.equipmentName!= ''">AND equipment_name = #{dto.equipmentName} <if test="dto.equipmentName!= null and dto.equipmentName!= ''">AND equipment_name = #{dto.equipmentName}
</if> </if>
</where>
<if test="dto.orgCode != null and dto.orgCode != ''"> <if test="dto.orgCode != null and dto.orgCode != ''">
org_code like CONCAT(#{dto.orgCode},'%') and org_code like #{dto.orgCode}
</if> </if>
</where>
</select> </select>
<select id="saveBatchHealthIndexLatestInfo" resultType="int"> <select id="saveBatchHealthIndexLatestInfo" resultType="int">
......
...@@ -260,10 +260,11 @@ ...@@ -260,10 +260,11 @@
<if test="dto.disposotionState!= null and dto.disposotionState!= ''">AND disposotion_state = #{dto.disposotionState} </if> <if test="dto.disposotionState!= null and dto.disposotionState!= ''">AND disposotion_state = #{dto.disposotionState} </if>
<if test="dto.endDate!= null and dto.endDate!= '' "> and ts &lt;= #{dto.endDate} </if> <if test="dto.endDate!= null and dto.endDate!= '' "> and ts &lt;= #{dto.endDate} </if>
<if test="dto.startDate!= null and dto.startDate!= ''"> and ts &gt;= #{dto.startDate} </if> <if test="dto.startDate!= null and dto.startDate!= ''"> and ts &gt;= #{dto.startDate} </if>
</where>
<if test="dto.orgCode != null and dto.orgCode != ''"> <if test="dto.orgCode != null and dto.orgCode != ''">
org_code like concat(#{dto.orgCode},'%') and org_code like #{dto.orgCode}
</if> </if>
</where>
<if test="dto.orderColumns != null and dto.orderColumns != ''"> <if test="dto.orderColumns != null and dto.orderColumns != ''">
order by ${dto.orderColumns} order by ${dto.orderColumns}
</if> </if>
...@@ -285,10 +286,11 @@ ...@@ -285,10 +286,11 @@
<if test="dto.disposotionState!= null and dto.disposotionState!= ''">AND disposotion_state = #{dto.disposotionState} </if> <if test="dto.disposotionState!= null and dto.disposotionState!= ''">AND disposotion_state = #{dto.disposotionState} </if>
<if test="dto.endDate!= null and dto.endDate!= '' "> and ts &lt;= #{dto.endDate} </if> <if test="dto.endDate!= null and dto.endDate!= '' "> and ts &lt;= #{dto.endDate} </if>
<if test="dto.startDate!= null and dto.startDate!= ''"> and ts &gt;= #{dto.startDate} </if> <if test="dto.startDate!= null and dto.startDate!= ''"> and ts &gt;= #{dto.startDate} </if>
</where>
<if test="dto.orgCode != null and dto.orgCode != ''"> <if test="dto.orgCode != null and dto.orgCode != ''">
org_code like concat(#{dto.orgCode},'%') and org_code like #{dto.orgCode}
</if> </if>
</where>
</select> </select>
<select id="getInfoByTs" resultType="com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord"> <select id="getInfoByTs" resultType="com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord">
......
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