Parcourir la source

mqtt指令发布

李进 il y a 2 ans
Parent
commit
5afd3b107e

+ 15 - 0
device-api-service/src/main/java/com/xy/mapper/entity/DeviceInfoQueryPage.java

@@ -47,4 +47,19 @@ public class DeviceInfoQueryPage extends DeviceInfo {
      * 距离
      */
     private Integer m;
+
+    /**
+     * 点位名称
+     */
+    private String placeName;
+
+    /**
+     * 线路名称
+     */
+    private String placeLineName;
+
+    /**
+     * 区域名称
+     */
+    private String districtName;
 }

+ 2 - 2
device-api-service/src/main/java/com/xy/service/DeviceInfoServiceImpl.java

@@ -134,14 +134,14 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
     @ApiOperation("分页查询")
     public R<PageBean<DeviceInfoDto.Vo2>> page(@RequestBody DeviceInfoDto.Page page) {
         //数据鉴权
-        /*boolean authByData = AuthorizeUtils.authByData(AuthorizeUtils.getSysId(), AuthorizeUtils.getUri());
+        boolean authByData = AuthorizeUtils.authByData(AuthorizeUtils.getSysId(), AuthorizeUtils.getUri());
         if (!authByData) {
             //todo 授权处理
             boolean deviceAuth = true;
             if (deviceAuth) {
                 page.setMerc(String.valueOf(AuthorizeUtils.getLoginId(Long.class)));
             }
-        }*/
+        }
         return queryPage(page);
     }
 

+ 11 - 2
device-api-service/src/main/resources/mapper/DeviceInfoMapper.xml

@@ -8,7 +8,10 @@
         info.*,
         sysinfo.android_version, sysinfo.device_sn,
         status.net_state, status.net_type, status.net_dbm, status.device_state,
-        mr.name as mercName
+        mr.name as merc_name,
+        mp.place_name,
+        ml.line_name as place_line_name,
+        sr.name as district_name
         <if test="queryPage.lon != null and queryPage.lon != ''">
             ,ROUND(
                 6378.138 * 2 * ASIN(
@@ -36,8 +39,14 @@
         join device_sysinfo sysinfo on(info.device_id = sysinfo.device_id)
         join device_status status on(info.device_id = status.device_id)
         left join merc mr on(info.merc_id = mr.id)
+        left join merc_place mp on(info.place_id = mp.id)
+        left join merc_line ml on(info.place_line_id = ml.id)
+        left join sys_region sr on(info.district_id = sr.id)
         where
-        info.show_status = #{queryPage.showStatus}
+        1 = 1
+        <if test="queryPage.showStatus != null and queryPage.showStatus != ''">
+            and info.show_status = #{queryPage.showStatus}
+        </if>
         <if test="queryPage.no != null and queryPage.no != ''">
             and (
                 LOCATE(#{queryPage.no}, info.device_id) > 0 or LOCATE(#{queryPage.no}, info.merc_device_code) > 0 or LOCATE(#{queryPage.no}, sysinfo.device_sn) > 0

+ 9 - 0
device-api/src/main/java/com/xy/dto/DeviceInfoDto.java

@@ -193,5 +193,14 @@ public class DeviceInfoDto {
 
         @ApiModelProperty("距离")
         private Integer m;
+
+        @ApiModelProperty("点位名称")
+        private String placeName;
+
+        @ApiModelProperty("线路名称")
+        private String placeLineName;
+
+        @ApiModelProperty("区域名称")
+        private String districtName;
     }
 }