ZebinHong / ailunBill-backend

多功能记账微信小程序-后端代码
11 stars 0 forks source link

sql是否完整 #4

Open joeba-sea opened 11 months ago

joeba-sea commented 11 months ago

你好,请问sql文件是否不太完整?整个项目运行起来时常常报错,并且tag分类图标等也没能在小程序中正常显示出来。

ZebinHong commented 11 months ago

项目有点忘了,sql是哪里有问题?tag图标是用 阿里图标库,当时是图标导入使用了代码链接好像(久了可能失效),你可以网上查一下如何导入图标哈,这是毕设项目基本没维护了

joeba-sea commented 11 months ago

项目有点忘了,sql是哪里有问题?tag图标是用 阿里图标库,当时是图标导入使用了代码链接好像(久了可能失效),你可以网上查一下如何导入图标哈,这是毕设项目基本没维护了

sql文件创建的数据库表好像是不太完整的,运行时会报错比如说java.sql.SQLSyntaxErrorException: Unknown column 'icon_class' in 'field list',缺少一些属性,我在表里面加上属性就不会报这个错了。想请问一下是否有更完整的sql文件呢?

ZebinHong commented 11 months ago

CREATE TABLE dc_tag ( id int NOT NULL AUTO_INCREMENT, name varchar(50) NOT NULL, icon_class varchar(20) NOT NULL COMMENT '标签的图标类', user_id int NOT NULL DEFAULT '1' COMMENT '标签所属者,默认是1(管理员)', gmt_create datetime NOT NULL, gmt_modified datetime DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB; 你把dc_tag表换成这个试试

Noah-aaa commented 4 months ago

数据库好像还是不全

Noah-aaa commented 4 months ago

2024-06-12 12:39:39.678 ERROR 25276 --- [nio-8081-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:

Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column 'record_time' in 'field list'

The error may exist in file [C:\Users\longteng\Desktop\person\ailunBill-backend-main\ailunBill-backend-main\target\classes\mybatis\mapper\BillMapper.xml]

The error may involve defaultParameterMap

The error occurred while setting parameters

SQL: select year(record_time) year, month(record_time) month, day(record_time) day, round(sum(money),1) total from dc_bill where user_id = ? and record_time >= ? and record_time < ? and type = ? and deleted = 0 group by day order by day

Cause: java.sql.SQLSyntaxErrorException: Unknown column 'record_time' in 'field list'

; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'record_time' in 'field list'] with root cause