Commit 9d2a0dfc authored by xixinzhao's avatar xixinzhao

pms使用接口

parent 9e9ec502
...@@ -4,19 +4,20 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -4,19 +4,20 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce; import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map; import java.util.Map;
@Slf4j @Slf4j
...@@ -55,4 +56,11 @@ public class EquipmentSpecificIndexController extends AbstractBaseController { ...@@ -55,4 +56,11 @@ public class EquipmentSpecificIndexController extends AbstractBaseController {
return equipmentSpecificIndexService.getPage(page, bizOrgCode, systemId, equipName, startDate, endDate); return equipmentSpecificIndexService.getPage(page, bizOrgCode, systemId, equipName, startDate, endDate);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getIndexByCode")
@ApiOperation(httpMethod = "GET", value = "指标", notes = "指标")
public ResponseModel getIndexByCode(@RequestParam String indexs, @RequestParam(required = false) String bizOrgCode) {
return CommonResponseUtil.success(equipmentSpecificIndexService.getIndexDataByIndex(indexs, bizOrgCode));
}
} }
...@@ -130,4 +130,5 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif ...@@ -130,4 +130,5 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
@Param("startDate") String startDate, @Param("startDate") String startDate,
@Param("endDate") String endDate @Param("endDate") String endDate
); );
List<Map<String, Object>> getIndexDataByIndex(@Param("bizOrgCode") String bizOrgCode, @Param("list") List<String> list);
} }
...@@ -81,4 +81,6 @@ public interface IEquipmentSpecificIndexSerivce extends IService<EquipmentSpecif ...@@ -81,4 +81,6 @@ public interface IEquipmentSpecificIndexSerivce extends IService<EquipmentSpecif
List<EquipmentIndexVO> getEquipIndexByIdIn(List<Long> specificIndexIds); List<EquipmentIndexVO> getEquipIndexByIdIn(List<Long> specificIndexIds);
IPage<Map<String, Object>> getPage(Page<EquipmentSpecificIndex> page, String bizOrgCode, String systemId, String equipName, String startDate, String endDate); IPage<Map<String, Object>> getPage(Page<EquipmentSpecificIndex> page, String bizOrgCode, String systemId, String equipName, String startDate, String endDate);
List<Map<String, Object>> getIndexDataByIndex(String index, String bizOrgCode);
} }
...@@ -15,6 +15,8 @@ import org.springframework.stereotype.Service; ...@@ -15,6 +15,8 @@ import org.springframework.stereotype.Service;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -112,4 +114,9 @@ public class EquipmentSpecificIndexSerivceImpl extends ServiceImpl<EquipmentSpec ...@@ -112,4 +114,9 @@ public class EquipmentSpecificIndexSerivceImpl extends ServiceImpl<EquipmentSpec
}); });
return resultPage; return resultPage;
} }
@Override
public List<Map<String, Object>> getIndexDataByIndex(String index, String bizOrgCode) {
return this.baseMapper.getIndexDataByIndex(bizOrgCode, Arrays.asList(index.split(",")));
}
} }
...@@ -1660,6 +1660,10 @@ ...@@ -1660,6 +1660,10 @@
SELECT SELECT
wlesal.id, wlesal.id,
wlesal.biz_org_name AS bizOrgName, wlesal.biz_org_name AS bizOrgName,
wlesal.clean_time AS cleanTime,
wlesal.biz_org_code AS bizOrgCode,
wlesal.alarm_reason AS alarmReason,
wlesal.resolve_result AS resolveResult,
concat(wlesal.equipment_specific_name, wlesal.equipment_specific_index_name) AS alamContent, concat(wlesal.equipment_specific_name, wlesal.equipment_specific_index_name) AS alamContent,
IF (wlesal.confirm_type IS NULL, '未确认', '已确认') handleStatus, IF (wlesal.confirm_type IS NULL, '未确认', '已确认') handleStatus,
IF (wlesal.clean_time IS NOT NULL, '已消除', '未消除' ) cleanStatus, IF (wlesal.clean_time IS NOT NULL, '已消除', '未消除' ) cleanStatus,
......
...@@ -641,4 +641,26 @@ ...@@ -641,4 +641,26 @@
</where> </where>
ORDER BY wesi.update_date DESC ORDER BY wesi.update_date DESC
</select> </select>
<select id="getIndexDataByIndex" resultType="java.util.Map">
SELECT
wesi.id AS id, wesi.equipment_specific_id,
wesi.`value`,
wesi.equipment_index_key,
wesi.equipment_index_name,
wes.`name`
FROM
`wl_equipment_specific_index` wesi
LEFT JOIN wl_equipment_specific wes ON wesi.equipment_specific_id = wes.id
<where>
<if test="list != null and list.size > 0 and type = 'id'">
wesi.equipment_index_key IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
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