zjs hace 3 semanas
padre
commit
36d6876dc5

+ 22 - 0
src/main/java/com/cn/esermis/controller/DataAcquisitionInstrumentController.java

@@ -21,6 +21,7 @@ import javax.annotation.Resource;
21 21
 
22 22
 import java.util.ArrayList;
23 23
 import java.util.List;
24
+import java.util.Map;
24 25
 
25 26
 import static com.cn.esermis.dpld.model.AjaxResult.success;
26 27
 
@@ -147,4 +148,25 @@ public class DataAcquisitionInstrumentController {
147 148
         }
148 149
         return success();
149 150
     }
151
+
152
+    @GetMapping(value = "getCompony")
153
+    public AjaxResult getCompony()
154
+    {
155
+        List<Map<String,Object>> list = dataAcquisitionInstrumentService.getCompony();
156
+        return success(list);
157
+    }
158
+
159
+
160
+    /**
161
+     * 部门
162
+     * @return
163
+     */
164
+    @GetMapping(value = "getDepartment/{componyid}")
165
+    public AjaxResult getDepartment(@PathVariable String componyid)
166
+    {
167
+        List<Map<String,Object>> list = dataAcquisitionInstrumentService.getDepartment(componyid);
168
+        return success(list);
169
+    }
170
+
171
+
150 172
 }

+ 5 - 0
src/main/java/com/cn/esermis/dpld/entity/DataAcquisitionInstrument.java

@@ -87,6 +87,11 @@ public class DataAcquisitionInstrument {
87 87
     @TableField(value = "company_code")
88 88
     private String companyCode;
89 89
     /**
90
+     * 单位编码
91
+     */
92
+    @TableField(value = "department_code")
93
+    private String departmentCode;
94
+    /**
90 95
      * 是否有排气筒 1是 0否
91 96
      */
92 97
     @TableField(value = "have_exhaust")

+ 4 - 0
src/main/java/com/cn/esermis/dpld/mapper/DataAcquisitionInstrumentMapper.java

@@ -6,10 +6,14 @@ import com.cn.esermis.dpld.model.OutletAndFactorVo;
6 6
 import org.apache.ibatis.annotations.Mapper;
7 7
 
8 8
 import java.util.List;
9
+import java.util.Map;
9 10
 
10 11
 @Mapper
11 12
 public interface DataAcquisitionInstrumentMapper extends BaseMapper<DataAcquisitionInstrument> {
12 13
 
13 14
     List<OutletAndFactorVo> selectListAll();
14 15
 
16
+    List<Map<String,Object>> getCompony();
17
+
18
+    List<Map<String, Object>> getDepartment(String componyid);
15 19
 }

+ 4 - 0
src/main/java/com/cn/esermis/dpld/service/IDataAcquisitionInstrumentService.java

@@ -6,6 +6,7 @@ import com.cn.esermis.dpld.model.OutletAndFactorVo;
6 6
 import org.springframework.stereotype.Service;
7 7
 
8 8
 import java.util.List;
9
+import java.util.Map;
9 10
 
10 11
 @Service
11 12
 public interface IDataAcquisitionInstrumentService extends IService<DataAcquisitionInstrument> {
@@ -13,4 +14,7 @@ public interface IDataAcquisitionInstrumentService extends IService<DataAcquisit
13 14
 
14 15
     List<OutletAndFactorVo> selectlist();
15 16
 
17
+    List<Map<String,Object>> getCompony();
18
+
19
+    List<Map<String, Object>> getDepartment(String componyid);
16 20
 }

+ 11 - 0
src/main/java/com/cn/esermis/dpld/service/impl/DataAcquisitionInstrumentServiceImpl.java

@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
10 10
 import javax.annotation.Resource;
11 11
 import java.util.Collections;
12 12
 import java.util.List;
13
+import java.util.Map;
13 14
 
14 15
 @Service
15 16
 public class DataAcquisitionInstrumentServiceImpl extends ServiceImpl<DataAcquisitionInstrumentMapper, DataAcquisitionInstrument> implements IDataAcquisitionInstrumentService {
@@ -22,4 +23,14 @@ public class DataAcquisitionInstrumentServiceImpl extends ServiceImpl<DataAcquis
22 23
     public List<OutletAndFactorVo> selectlist() {
23 24
         return mapper.selectListAll();
24 25
     }
26
+
27
+    @Override
28
+    public List<Map<String,Object>> getCompony() {
29
+        return mapper.getCompony();
30
+    }
31
+
32
+    @Override
33
+    public List<Map<String, Object>> getDepartment(String componyid) {
34
+        return mapper.getDepartment(componyid);
35
+    }
25 36
 }

+ 9 - 0
src/main/resources/static/mybatis/DataAcquisitionInstrumentMapper.xml

@@ -10,5 +10,14 @@
10 10
                  left join analytical_instruments b on a.id = b.data_acquisition_instrument_id
11 11
                  left join monitoring_factor c on b.id = c.analytical_instrument_id
12 12
     </select>
13
+    <select id="getCompony" resultType="java.util.Map">
14
+        SELECT t.companyid,t.companylongname
15
+        FROM company t
16
+    </select>
17
+    <select id="getDepartment" resultType="java.util.Map" parameterType="java.lang.String">
18
+        SELECT t.departmentid,t.departmentname
19
+        FROM department t
20
+        WHERE t.companyid = #{companyid}
21
+    </select>
13 22
 </mapper>
14 23