Re: The sql in the mapper.xml file changed when it was executed.
Well, you know what they say about "never say never", but this is a pretty fundamental flaw, and seems like it would have come up before now given how widely used MyBatis is. For those who can't see the itsy-bitsy type in the included image, here is what it says:
### The error occurred while setting parameters ### SQL: SELECT dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark FROM sys_dict_data
WHERE status = '0' AND dict_type = ? order by detail_id desc LIMIT ?
### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'detail_id' in 'order clause
Notice that in addition to the order by clause changing from "dict_sort asc" to "detail_id desc", other changes appear in the SQL. Keywords SELECT, FROM, WHERE and AND have been capitalized, but not "order by". And the order by clause also has a LIMIT added. The logging function in MyBatis does not change capitalization when logging SQL statements.
I'm suspicious that the SQL file being used is not the same as the one you are looking at. Either a different version ended up in the netcat-system-0.0.1-SNAPSHOT.jar, or the SQL is being picked up from another location. Start by unzipping the deployed JAR file and inspecting the included SysDictDataMapper.xml file, and also look for another copy of this file somewhere in that deployment.