suntianwu 3 anni fa
parent
commit
6da88f8ac0

+ 23 - 2
src/main/java/com/care/bigscreen/controller/StStationController.java

@@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
 
 
 /**
@@ -86,9 +87,9 @@ public class StStationController {
     }
 
     /**
-     * 根据经纬度查询
+     * 根据经纬度查询统计值
      */
-    @ApiOperation(value = "根据经纬度查询", notes = "根据经纬度查询")
+    @ApiOperation(value = "根据经纬度查询统计值", notes = "根据经纬度查询统计值")
     @GetMapping("/selectBigScreenStatisticsByLongitudeLatitude")
     @ApiImplicitParams(
             {
@@ -109,4 +110,24 @@ public class StStationController {
         }
     }
 
+    /**
+     * 站点列表查询
+     */
+    @ApiOperation(value = "站点列表查询", notes = "站点列表查询")
+    @GetMapping("/selectBigScreenStationList")
+    @ApiImplicitParams(
+            {
+                    @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class)
+            }
+    )
+    public Result<List<BigScreenStatisticsVO>> selectBigScreenStationList(Long orgId) {
+        try {
+            List<BigScreenStatisticsVO> bigScreenStatisticsVOList =  stStationService.selectBigScreenStationList(orgId);
+            return Result.success(bigScreenStatisticsVOList);
+        } catch (Exception e) {
+            log.error("站点列表查询出现异常",e);
+            return Result.error("系统错误,站点列表查询失败");
+        }
+    }
+
 }

+ 4 - 0
src/main/java/com/care/bigscreen/mapper/StStationMapper.java

@@ -29,4 +29,8 @@ public interface StStationMapper extends BaseMapper<StStation> {
      */
     BigScreenStatisticsVO selectBigScreenStatisticsByLongitudeLatitude(@Param("longitudeLeftUp") String longitudeLeftUp,@Param("latitudeLeftUp") String latitudeLeftUp,@Param("longitudeRightDown") String longitudeRightDown,@Param("latitudeRightDown")String latitudeRightDown,@Param("orgId") Long orgId);
 
+    /**
+     * 站点列表查询
+     */
+    List<BigScreenStatisticsVO> selectBigScreenStationList(@Param("orgId") Long orgId);
 }

+ 5 - 0
src/main/java/com/care/bigscreen/service/StStationService.java

@@ -2,6 +2,7 @@ package com.care.bigscreen.service;
 
 import com.care.bigscreen.vo.BigScreenStatisticsVO;
 
+import java.util.List;
 
 
 /**
@@ -23,4 +24,8 @@ public interface StStationService {
      */
     BigScreenStatisticsVO selectBigScreenStatisticsByLongitudeLatitude(String longitudeLeftUp,String latitudeLeftUp,String longitudeRightDown,String latitudeRightDown,Long orgId);
 
+    /**
+     * 站点列表查询
+     */
+    List<BigScreenStatisticsVO> selectBigScreenStationList(Long orgId);
 }

+ 9 - 1
src/main/java/com/care/bigscreen/service/impl/StStationServiceImpl.java

@@ -7,7 +7,7 @@ import com.care.bigscreen.vo.BigScreenStatisticsVO;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-
+import java.util.List;
 
 
 /**
@@ -39,4 +39,12 @@ public class StStationServiceImpl implements StStationService {
     public BigScreenStatisticsVO selectBigScreenStatisticsByLongitudeLatitude(String longitudeLeftUp,String latitudeLeftUp,String longitudeRightDown,String latitudeRightDown,Long orgId) {
         return stStationMapper.selectBigScreenStatisticsByLongitudeLatitude(longitudeLeftUp,latitudeLeftUp,longitudeRightDown,latitudeRightDown,orgId);
     }
+
+    /**
+     * 站点列表查询
+     */
+    @Override
+    public List<BigScreenStatisticsVO> selectBigScreenStationList(Long orgId) {
+        return stStationMapper.selectBigScreenStationList(orgId);
+    }
 }

+ 37 - 0
src/main/java/com/care/bigscreen/vo/BigScreenStationVO.java

@@ -0,0 +1,37 @@
+package com.care.bigscreen.vo;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+
+/**
+ * 大屏站点响应类
+ *
+ * @author stw
+ * @since 2021-05-20
+ */
+@Data
+@ApiModel(value = "大屏站点响应类", description = "大屏站点响应类")
+public class BigScreenStationVO {
+
+    @ApiModelProperty(value = "站点ID")
+    private Long stationId;
+
+    @ApiModelProperty(value = "服务站名称")
+    private String stationName;
+
+    @ApiModelProperty(value = "机构ID")
+    private Long orgId;
+
+    @ApiModelProperty(value = "经度")
+    private BigDecimal longitude;
+
+    @ApiModelProperty(value = "纬度")
+    private BigDecimal latitude;
+
+
+}

+ 16 - 0
src/main/resources/mybatis/StStationMapper.xml

@@ -74,4 +74,20 @@
             </if>
         </where>
     </select>
+
+    <select id="selectBigScreenStationList" resultType="com.care.bigscreen.vo.BigScreenStationVO">
+        SELECT
+        station_id stationId,
+        station_name stationName,
+        org_id orgId,
+        longitude,
+        latitude
+        FROM st_station t
+        <where>
+           1 = 1
+            <if test="orgId != null and orgId != ''">
+                AND t.org_id = #{orgId}
+            </if>
+        </where>
+    </select>
 </mapper>