浏览代码

修改函数命名

liutong3 5 年之前
父节点
当前提交
3c19b1222f

+ 6 - 6
ipu-db-example/src/test/java/com/ai/ipu/example/db/IpuDatabaseExample.java

47
        System.out.println("--------------------");
47
        System.out.println("--------------------");
48
        IpuDbDemoDto ipuDbDemoDto = new IpuDbDemoDto();
48
        IpuDbDemoDto ipuDbDemoDto = new IpuDbDemoDto();
49
        ipuDbDemoDto.setPk(pk);
49
        ipuDbDemoDto.setPk(pk);
50
        ipuDbDemoDto.setString_type("测试新增");
51
        ipuDbDemoDto.setInt_type(10);
52
        ipuDbDemoDto.setDecimal_type(new BigDecimal(10.10));
53
        ipuDbDemoDto.setDate_type(new Date());
54
        ipuDbDemoDto.setDatetime_type(new Date());
55
        ipuDbDemoDto.setNull_type("");
50
        ipuDbDemoDto.setStringType("测试新增");
51
        ipuDbDemoDto.setIntType(10);
52
        ipuDbDemoDto.setDecimalType(new BigDecimal(10.10));
53
        ipuDbDemoDto.setDateType(new Date());
54
        ipuDbDemoDto.setDatetimeType(new Date());
55
        ipuDbDemoDto.setNullType("");
56
        System.out.println(service.insert(ipuDbDemoDto));
56
        System.out.println(service.insert(ipuDbDemoDto));
57
        System.out.println("--------------------");
57
        System.out.println("--------------------");
58
        System.out.println(service.selectById(pk));
58
        System.out.println(service.selectById(pk));

+ 17 - 17
ipu-db-example/src/test/java/com/ai/ipu/example/db/dao/IpuDbDemoDao.java

25
        for (Map<String, Object> obj : result) {
25
        for (Map<String, Object> obj : result) {
26
            IpuDbDemoDto ipuDbDemoDto = new IpuDbDemoDto();
26
            IpuDbDemoDto ipuDbDemoDto = new IpuDbDemoDto();
27
            ipuDbDemoDto.setPk((Integer) obj.get("pk"));
27
            ipuDbDemoDto.setPk((Integer) obj.get("pk"));
28
            ipuDbDemoDto.setString_type((String) obj.get("string_type"));
29
            ipuDbDemoDto.setInt_type((Integer) obj.get("int_type"));
30
            ipuDbDemoDto.setDecimal_type((BigDecimal) obj.get("decimal_type"));
31
            ipuDbDemoDto.setDate_type((Date) obj.get("date_type"));
32
            ipuDbDemoDto.setDatetime_type((Date) obj.get("datetime_type"));
33
            ipuDbDemoDto.setNull_type((String) obj.get("null_type"));
28
            ipuDbDemoDto.setStringType((String) obj.get("string_type"));
29
            ipuDbDemoDto.setIntType((Integer) obj.get("int_type"));
30
            ipuDbDemoDto.setDecimalType((BigDecimal) obj.get("decimal_type"));
31
            ipuDbDemoDto.setDateType((Date) obj.get("date_type"));
32
            ipuDbDemoDto.setDatetimeType((Date) obj.get("datetime_type"));
33
            ipuDbDemoDto.setNullType((String) obj.get("null_type"));
34
            list.add(ipuDbDemoDto);
34
            list.add(ipuDbDemoDto);
35
        }
35
        }
36
        return list;
36
        return list;
47
            Map<String, Object> obj = result.get(0);
47
            Map<String, Object> obj = result.get(0);
48
            IpuDbDemoDto ipuDbDemoDto = new IpuDbDemoDto();
48
            IpuDbDemoDto ipuDbDemoDto = new IpuDbDemoDto();
49
            ipuDbDemoDto.setPk((Integer) obj.get("pk"));
49
            ipuDbDemoDto.setPk((Integer) obj.get("pk"));
50
            ipuDbDemoDto.setString_type((String) obj.get("string_type"));
51
            ipuDbDemoDto.setInt_type((Integer) obj.get("int_type"));
52
            ipuDbDemoDto.setDecimal_type((BigDecimal) obj.get("decimal_type"));
53
            ipuDbDemoDto.setDate_type((Date) obj.get("date_type"));
54
            ipuDbDemoDto.setDatetime_type((Date) obj.get("datetime_type"));
55
            ipuDbDemoDto.setNull_type((String) obj.get("null_type"));
50
            ipuDbDemoDto.setStringType((String) obj.get("string_type"));
51
            ipuDbDemoDto.setIntType((Integer) obj.get("int_type"));
52
            ipuDbDemoDto.setDecimalType((BigDecimal) obj.get("decimal_type"));
53
            ipuDbDemoDto.setDateType((Date) obj.get("date_type"));
54
            ipuDbDemoDto.setDatetimeType((Date) obj.get("datetime_type"));
55
            ipuDbDemoDto.setNullType((String) obj.get("null_type"));
56
            return ipuDbDemoDto;
56
            return ipuDbDemoDto;
57
        }
57
        }
58
    }
58
    }
62
        Map<String, Object> param = new HashMap<String, Object>();
62
        Map<String, Object> param = new HashMap<String, Object>();
63
        param.put("pk", ipuDbDemoDto.getPk());
63
        param.put("pk", ipuDbDemoDto.getPk());
64
        param.put("string_type", ipuDbDemoDto.getPk());
64
        param.put("string_type", ipuDbDemoDto.getPk());
65
        param.put("int_type", ipuDbDemoDto.getInt_type());
66
        param.put("decimal_type", ipuDbDemoDto.getDecimal_type());
67
        param.put("date_type", ipuDbDemoDto.getDate_type());
68
        param.put("datetime_type", ipuDbDemoDto.getDatetime_type());
69
        param.put("null_type", ipuDbDemoDto.getNull_type());
65
        param.put("int_type", ipuDbDemoDto.getIntType());
66
        param.put("decimal_type", ipuDbDemoDto.getDecimalType());
67
        param.put("date_type", ipuDbDemoDto.getDateType());
68
        param.put("datetime_type", ipuDbDemoDto.getDatetimeType());
69
        param.put("null_type", ipuDbDemoDto.getNullType());
70
        return dao.executeInsert(sql, param);
70
        return dao.executeInsert(sql, param);
71
    }
71
    }
72
72

+ 12 - 12
ipu-db-example/src/test/java/com/ai/ipu/example/db/model/IpuDbDemoDto.java

28
        this.pk = pk;
28
        this.pk = pk;
29
    }
29
    }
30
30
31
    public void setString_type(String string_type) {
31
    public void setStringType(String string_type) {
32
        this.string_type = string_type;
32
        this.string_type = string_type;
33
    }
33
    }
34
34
35
    public void setInt_type(int int_type) {
35
    public void setIntType(int int_type) {
36
        this.int_type = int_type;
36
        this.int_type = int_type;
37
    }
37
    }
38
38
39
    public void setDecimal_type(BigDecimal decimal_type) {
39
    public void setDecimalType(BigDecimal decimal_type) {
40
        this.decimal_type = decimal_type;
40
        this.decimal_type = decimal_type;
41
    }
41
    }
42
42
43
    public void setDate_type(Date date_type) {
43
    public void setDateType(Date date_type) {
44
        this.date_type = date_type;
44
        this.date_type = date_type;
45
    }
45
    }
46
46
47
    public void setDatetime_type(Date datetime_type) {
47
    public void setDatetimeType(Date datetime_type) {
48
        this.datetime_type = datetime_type;
48
        this.datetime_type = datetime_type;
49
    }
49
    }
50
50
51
    public void setNull_type(String null_type) {
51
    public void setNullType(String null_type) {
52
        this.null_type = null_type;
52
        this.null_type = null_type;
53
    }
53
    }
54
54
56
        return pk;
56
        return pk;
57
    }
57
    }
58
58
59
    public String getString_type() {
59
    public String getStringType() {
60
        return string_type;
60
        return string_type;
61
    }
61
    }
62
62
63
    public int getInt_type() {
63
    public int getIntType() {
64
        return int_type;
64
        return int_type;
65
    }
65
    }
66
66
67
    public BigDecimal getDecimal_type() {
67
    public BigDecimal getDecimalType() {
68
        return decimal_type;
68
        return decimal_type;
69
    }
69
    }
70
70
71
    public Date getDate_type() {
71
    public Date getDateType() {
72
        return date_type;
72
        return date_type;
73
    }
73
    }
74
74
75
    public Date getDatetime_type() {
75
    public Date getDatetimeType() {
76
        return datetime_type;
76
        return datetime_type;
77
    }
77
    }
78
78
79
    public String getNull_type() {
79
    public String getNullType() {
80
        return null_type;
80
        return null_type;
81
    }
81
    }
82
82