| | |
| | | |
| | | System.out.println("是否存在rating_scheme_id字段: " + hasRatingSchemeId); |
| | | } |
| | | |
| | | @Test |
| | | public void checkRatingItemTable() { |
| | | System.out.println("=== 检查 t_rating_item 表结构 ==="); |
| | | |
| | | try { |
| | | String sql = "DESCRIBE t_rating_item"; |
| | | List<Map<String, Object>> columns = jdbcTemplate.queryForList(sql); |
| | | |
| | | for (Map<String, Object> column : columns) { |
| | | System.out.println("字段: " + column.get("Field") + |
| | | ", 类型: " + column.get("Type") + |
| | | ", 是否为空: " + column.get("Null") + |
| | | ", 键: " + column.get("Key") + |
| | | ", 默认值: " + column.get("Default")); |
| | | } |
| | | |
| | | System.out.println("\n=== 检查 t_rating_scheme 表结构 ==="); |
| | | sql = "DESCRIBE t_rating_scheme"; |
| | | columns = jdbcTemplate.queryForList(sql); |
| | | |
| | | for (Map<String, Object> column : columns) { |
| | | System.out.println("字段: " + column.get("Field") + |
| | | ", 类型: " + column.get("Type") + |
| | | ", 是否为空: " + column.get("Null") + |
| | | ", 键: " + column.get("Key") + |
| | | ", 默认值: " + column.get("Default")); |
| | | } |
| | | |
| | | System.out.println("\n=== 检查评分项数据 ==="); |
| | | sql = "SELECT * FROM t_rating_item LIMIT 5"; |
| | | List<Map<String, Object>> items = jdbcTemplate.queryForList(sql); |
| | | |
| | | for (Map<String, Object> item : items) { |
| | | System.out.println("评分项: " + item); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | System.out.println("检查表结构失败: " + e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |