将id写成 <composite-id>然后把配置写在下面就可以了
<composite-id>
<key-property name="code" type="java.lang.String">
<column name="chirasi_code" length="50"></column>
</key-property>
<key-property name="name" type="java.lang.String">
<column name="block_name" length="50"></column>
</key-property>
</composite-id>