Procházet zdrojové kódy

线路下拉 添加工务段

sunhh před 1 rokem
rodič
revize
031755d6d7

+ 5 - 1
business-service/src/main/java/com/ozs/service/entity/BaseRailwayManagement.java

@@ -32,7 +32,11 @@ import lombok.NoArgsConstructor;
 public class BaseRailwayManagement extends BaseEntity implements Serializable ,Comparable<BaseRailwayManagement>{
 
     private static final long serialVersionUID = 1L;
-
+    /**
+     * 工务段名称
+     */
+    @TableField(exist = false)
+    private String deptName;
     /**
      * 主键ID
      */

+ 4 - 0
business-service/src/main/java/com/ozs/service/mapper/BaseRailwayManagementMapper.java

@@ -5,6 +5,8 @@ import com.ozs.service.entity.BaseRailwayManagement;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * <p>
  *   线路管理表 Mapper 接口
@@ -17,4 +19,6 @@ import org.apache.ibatis.annotations.Param;
 public interface BaseRailwayManagementMapper extends BaseMapper<BaseRailwayManagement> {
 
     String getCameraNameByCameraCode(@Param("cameraCode") String cameraCode);
+
+    List<BaseRailwayManagement> listRailway();
 }

+ 2 - 0
business-service/src/main/java/com/ozs/service/service/BaseRailwayManagementService.java

@@ -25,4 +25,6 @@ public interface BaseRailwayManagementService extends IService<BaseRailwayManage
     String importBaseLineManagement(List<BaseRailwayManagement> accountManageList, boolean updateSupport,String userId);
 
     String getCameraNameByCameraCode(String cameraCode);
+
+    List<BaseRailwayManagement> listRailway();
 }

+ 5 - 0
business-service/src/main/java/com/ozs/service/service/impl/BaseRailwayManagementServiceImpl.java

@@ -102,4 +102,9 @@ public class BaseRailwayManagementServiceImpl extends ServiceImpl<BaseRailwayMan
     public String getCameraNameByCameraCode(String cameraCode) {
         return baseRailwayManagementMapper.getCameraNameByCameraCode(cameraCode);
     }
+
+    @Override
+    public List<BaseRailwayManagement> listRailway() {
+        return baseRailwayManagementMapper.listRailway();
+    }
 }

+ 8 - 0
business-service/src/main/resources/mapper/service/BaseRailwayManagementMapper.xml

@@ -5,4 +5,12 @@
     <select id="getCameraNameByCameraCode" resultType="java.lang.String" parameterType="java.lang.String">
         select railway_name railwayName from base_railway_management where railway_code = #{cameraCode}
     </select>
+
+    <select id="listRailway" resultType="com.ozs.service.entity.BaseRailwayManagement">
+        select a.dept_id, a.dept_name, c.* from
+            (select dept_id, dept_name from sys_dept) a JOIN
+            (select dept_id, railway_code from base_camera_management) b on a.dept_id = b.dept_id join
+            (select * from base_railway_management) c on b.railway_code = c.railway_code
+        group by c.railway_code, a.dept_id
+    </select>
 </mapper>

+ 2 - 1
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseRailwayManagementController.java

@@ -301,7 +301,8 @@ public class BaseRailwayManagementController extends BaseController {
     @GetMapping("/query")
     @Log(title = "线路台账管理", businessType = BusinessType.SELECT)
     public AjaxResult query() {
-        List<BaseRailwayManagement> list = baseRailwayManagementService.list();
+        // List<BaseRailwayManagement> list = baseRailwayManagementService.list();
+        List<BaseRailwayManagement> list = baseRailwayManagementService.listRailway();
         list.sort(new Comparator<BaseRailwayManagement>() {
             @Override
             public int compare(BaseRailwayManagement o1, BaseRailwayManagement o2) {