lrj
5 天以前 4fa9591629721797386fc11836e3a9deb69cd58c
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.rongyichuang.tools;
 
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 java.util.List;
import java.util.Map;
 
@SpringBootTest
public class RatingTemplateVerifier {
 
    @Autowired
    private JdbcTemplate jdbcTemplate;
 
    @Test
    public void verifyRatingTemplateData() {
        System.out.println("=== 验证评分模板数据 ===");
        
        // 查询评分模板
        String schemeSql = "SELECT * FROM t_rating_scheme WHERE id = 1";
        List<Map<String, Object>> schemes = jdbcTemplate.queryForList(schemeSql);
        
        System.out.println("评分模板数据:");
        for (Map<String, Object> scheme : schemes) {
            System.out.println(scheme);
        }
        
        // 查询所有评分项目
        String allItemSql = "SELECT * FROM t_rating_item ORDER BY id";
        List<Map<String, Object>> allItems = jdbcTemplate.queryForList(allItemSql);
        
        System.out.println("\n所有评分项目数据:");
        for (Map<String, Object> item : allItems) {
            System.out.println(item);
        }
        
        // 查询特定scheme_id的评分项目
        String itemSql = "SELECT * FROM t_rating_item WHERE scheme_id = 1 ORDER BY order_no";
        List<Map<String, Object>> items = jdbcTemplate.queryForList(itemSql);
        
        System.out.println("\nscheme_id=1的评分项目数据:");
        for (Map<String, Object> item : items) {
            System.out.println(item);
        }
        
        // 查询活动的评分模板配置
        String activitySql = "SELECT id, name, rating_scheme_id FROM t_activity WHERE id = 1";
        List<Map<String, Object>> activities = jdbcTemplate.queryForList(activitySql);
        
        System.out.println("\n活动评分模板配置:");
        for (Map<String, Object> activity : activities) {
            System.out.println(activity);
        }
        
        System.out.println("\n✅ 评分模板数据验证完成!");
    }
}