XMTT 6 gadi atpakaļ
vecāks
revīzija
c0fc03c2d4

+ 7 - 10
src/main/java/com/ekexiu/project/bridge/envdata/EnvDataService.java

@ -228,29 +228,26 @@ public class EnvDataService {
228 228
        return map;
229 229
    }
230 230
231
    @Path("/server/typeahead")
231
    @Path("/server/typeCode")
232 232
    @Get
233 233
    public List<TypeaheadItem> get(@JdbcConn Connection con)throws SQLException {
234
        return JdbcUtil.queryList(con, "SELECT CODE,ID FROM ENV_SERVER", new ResultSetExtractor<TypeaheadItem>() {
234
        return JdbcUtil.queryList(con, "SELECT CODE,ID FROM ENV_SERVER ORDER BY CODE", new ResultSetExtractor<TypeaheadItem>() {
235 235
            @Override
236 236
            public TypeaheadItem extractData(ResultSet resultSet) throws SQLException {
237 237
                TypeaheadItem typeaheadItem = new TypeaheadItem();
238 238
                typeaheadItem.setCaption(resultSet.getString(1));
239
                typeaheadItem.setCaption(resultSet.getString(2));
239
                typeaheadItem.setCode(resultSet.getString(2));
240 240
                return typeaheadItem;
241 241
            }
242 242
        });
243 243
    }
244 244
245 245
    @Path("/transducer/position")
246
    public List<TypeaheadItem> getPosition(@JdbcConn Connection con)throws SQLException {
247
        return JdbcUtil.queryList(con, "SELECT POSITION FROM ENV_TRANSDUCER GROUP BY POSITION", new ResultSetExtractor<TypeaheadItem>() {
246
    public List<String> getPosition(@JdbcConn Connection con)throws SQLException {
247
        return JdbcUtil.queryList(con, "SELECT POSITION FROM ENV_TRANSDUCER GROUP BY POSITION ORDER BY POSITION", new ResultSetExtractor<String>() {
248 248
            @Override
249
            public TypeaheadItem extractData(ResultSet resultSet) throws SQLException {
250
                TypeaheadItem typeaheadItem = new TypeaheadItem();
251
                typeaheadItem.setCaption(resultSet.getString(1));
252
                typeaheadItem.setCaption(resultSet.getString(1));
253
                return typeaheadItem;
249
            public String extractData(ResultSet resultSet) throws SQLException {
250
                return resultSet.getString(1);
254 251
            }
255 252
        });
256 253
    }