话不多说直接上 mybatis-generator.xml
<?xml version="1.0" encoding="UTF-8"?><context id="DB2Tables" targetRuntime="MyBatis3">
//忽略上述配置
<!--生成对应表及类名-->
<table tableName="TEST20190823_CITY" domainObjectName="CITY" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" enableSelectByPrimaryKey="true" enableUpdateByPrimaryKey="true" enableDeleteByPrimaryKey="true"></table>
</context>
加入这三个 再重新生成一下mapper跟xml文件就有了
enableSelectByPrimaryKey=“true” enableUpdateByPrimaryKey=“true” enableDeleteByPrimaryKey=“true”>