lrj
5 天以前 6d519474e44855682043d3c40db2c86a6822caca
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.jdbc.core.JdbcTemplate;
import com.rongyichuang.RycBackendApplication;
 
import java.util.List;
import java.util.Map;
 
@SpringBootTest(classes = RycBackendApplication.class)
public class CheckRatingItemTableStructureTest2 {
 
    @Autowired
    private JdbcTemplate jdbcTemplate;
 
    @Test
    public void checkTableStructure() {
        try {
            // 查询表结构
            String sql = "DESCRIBE t_activity_player_rating_item";
            List<Map<String, Object>> columns = jdbcTemplate.queryForList(sql);
            
            System.out.println("=== t_activity_player_rating_item 表结构 ===");
            for (Map<String, Object> column : columns) {
                System.out.println("字段名: " + column.get("Field") + 
                                 ", 类型: " + column.get("Type") + 
                                 ", 是否为空: " + column.get("Null") + 
                                 ", 键: " + column.get("Key") + 
                                 ", 默认值: " + column.get("Default"));
            }
            
        } catch (Exception e) {
            System.err.println("查询表结构失败: " + e.getMessage());
            e.printStackTrace();
        }
    }
}