Procházet zdrojové kódy

告警类型查询修改

hym před 3 roky
rodič
revize
80a17cd4f2

+ 3 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/AreaMapper.java

@@ -1,5 +1,6 @@
 package com.zcxk.rmcp.core.dao;
 
+import com.zcxk.rmcp.api.dto.DeviceAreaDto;
 import com.zcxk.rmcp.api.vo.AreaVo;
 import com.zcxk.rmcp.core.entity.Area;
 import org.apache.ibatis.annotations.Mapper;
@@ -14,4 +15,6 @@ import java.util.List;
 @Mapper
 public interface AreaMapper {
     List<AreaVo> getList();
+
+    DeviceAreaDto findAreas(Integer communityId);
 }

+ 2 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/ProductMapper.java

@@ -22,4 +22,6 @@ public interface ProductMapper {
     Product findById(Integer id);
 
     Product getByName(@Param("productName") String productName, @Param("productModel") String productModel);
+
+    ProductVo findProduct(Integer productId);
 }

+ 7 - 6
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/AlarmTypeMapper.xml

@@ -43,30 +43,31 @@ rt.type_desc, rt.tenant_id, rt.alarm_status    </sql>
     <select id="selectList" resultType="com.zcxk.rmcp.api.dto.alarm.AlarmTypeDto">
         select
         <include refid="Base_Column_List"/>,ifnull(rule.numberOfWaterMeters,0)numberOfWaterMeters
-               ,b.product_name,c.name categoryName
+               ,CONCAT_ws("/",e.name,b.product_model,b.product_name) product_name,c.name categoryName
         from rmcp_alarm_type  rt left join (select count(*) numberOfWaterMeters,alarm_type_id
         from rmcp_device_alarm_rule group by alarm_type_id ) rule on rt.id=rule.alarm_type_id
         join rmcp_product b on rt.device_type_id=b.id
         join rmcp_product_category c on rt.product_categroy_id=c.id
+        join rmcp_manufacturer e on b.manufacturer_id=e.id
         <where>
         rt.status=1
 
 
             <if test="deviceTypeId != null">
-                and device_type_id = #{deviceTypeId}
+                and rt.device_type_id = #{deviceTypeId}
             </if>
             <if test="productCategroyId != null">
-                and product_category_id = #{productCategroyId}
+                and rt.product_category_id = #{productCategroyId}
             </if>
             <if test="name != null and name != ''">
-                and name  like concat('%',#{name} ,'%')
+                and rt.name  like concat('%',#{name} ,'%')
             </if>
 
             <if test="typeDesc != null and typeDesc != ''">
-                and type_desc =  like concat('%',#{typeDesc} ,'%')
+                and rt.type_desc   like concat('%',#{typeDesc} ,'%')
             </if>
             <if test="tenantId != null and tenantId != ''">
-                and tenant_id = #{tenantId}
+                and rt.tenant_id = #{tenantId}
             </if>
 
         </where>

+ 5 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/AreaMapper.xml

@@ -29,4 +29,9 @@
   <select id="getList" resultType="com.zcxk.rmcp.api.vo.AreaVo">
     select id as code,parent_id as pid,name from rmcp_area
   </select>
+    <select id="findAreas" resultType="com.zcxk.rmcp.api.dto.DeviceAreaDto">
+      select province.id provinceId,city.id cityId,region.id regionId from rmcp_area province join rmcp_area city on province.id=city.parent_id
+        join rmcp_area region on city.id=region.parent_id join rmcp_community a on (city.id=a.city and region.id=a.region)
+        where a.id=#{communityId} and a.status=1
+    </select>
 </mapper>

+ 4 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/ProductMapper.xml

@@ -182,4 +182,8 @@
   <select id="getByName" resultMap="BaseResultMap">
     select id,product_category_id,manufacturer_id from rmcp_product where status = 1 and product_name = #{productName} and product_model = #{productModel}
     </select>
+    <select id="findProduct" resultType="com.zcxk.rmcp.api.dto.product.ProductVo">
+      select a.product_model,b.name manufacturerName from rmcp_product a join rmcp_manufacturer b on a.manufacturer_id=b.id
+      where a.id=#{productId}
+    </select>
 </mapper>

+ 1 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/AlarmTypeServiceImpl.java

@@ -27,6 +27,7 @@ public class AlarmTypeServiceImpl implements AlarmTypeService {
     @Override
     public Pagination<AlarmTypeDto> getAlarmTypePage(AlarmTypePageDto alarmTypePageDto) {
         PageMethod.startPage(alarmTypePageDto.getPageNum(),alarmTypePageDto.getPageSize());
+        alarmTypePageDto.setTenantId(UserUtil.getCurrentUser().getTenantId());
         List<AlarmTypeDto> alarmTypes = alarmTypeMapper.selectList(alarmTypePageDto);
         if (CollectionUtils.isEmpty(alarmTypes)){
             return new Pagination<>();