Summary of MySQL and MyBatisPlus issues
filter duplicate data
You can use group by to query duplicate data, and use having to limit conditions.
That is, use group by to count count and then use subquery for conditional filtering.
The conditional index in the join is invalid
When left join query, the conditional index in the join becomes invalid –> encoding consistency problem, change the encoding and sorting rules of several tables to be consistent.
alter TABLE 表名 CONVERT TO CHARACTER set utf8mb4 COLLATE utf8mb4_general_ci;
Integer 0 is invalid in query in mybatis
For the reason analysis, see ==> mybatis passes in xml when the integer parameter is 0, and the query condition fails.
Summary: it will be considered as a null character, and the non-null character will be judged !=''
and deleted .
The problem of all humpbacks in SQL statements in mybatisPlus
mybatis-plus.configuration.map-underscore-to-camel-case=false
Open and close in the configuration file