Metrics
0
Watch 2.7K Star 5.5K Fork 2.8K

ThinkGem / JeeSite 4.xJavaAGPL-3.0

代码生成器生成树表若数据库中无status字段则在增加二级节点时报错

Closed
hh0024  Created at

版本4.1.3

重现步骤

使用代码生成器以树表为模板,对数据库表生成代码,文档说对于树表status等字段是可选字段(https://jeesite.gitee.io/docs/tree-table-use/),实际数据库表没有status字段,生成代码成功,添加第一个节点时成功,但以第一个节点为父节点生成下级节点时报错

报错信息

UPDATE custom_tree_test SET tree_leaf = ( SELECT tree_leaf FROM ( SELECT (case when count(1) > 0 then '0' else '1' end) tree_leaf FROM custom_tree_test WHERE status = '0' AND parent_code = ? ) a ) WHERE tree_code = ?

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'status' in 'where clause'

6732_thinkgem total 3 participants

Comments (3)

前去 2019-03-14 09:16

需要加上status

hh0024 2019-03-15 15:09

加上status可以解决问题,但此时status就应该是必选字段了,而且似乎只能逻辑删除,不能物理删除

6732_thinkgem
ThinkGem 2019-03-18 22:36 owner

谢谢反馈,v4.1.4中加入这个特性。

Sign in and comment

Assignee
Labels
Not set
Project
Milestone
Branch
Scheduled start
Not set
Scheduled end
Not set
Top level
Priority

Help Search

Gitee_you_jiang_zheng_wen Zheng_wen_close