select * query the entire table all the fields in such bad writing, because the database along with business development, the field has also increased, to check what time look-up table, we can define sql labels such as:
<sql id="Base_Column_List">
id, username, password, email, phone, question, answer, role, create_time, update_time
</sql>
Then this
<select id="selectLogin" parameterType="map" resultMap="BaseResultMap">
SELECT
// 使用 include 标签重用重用mybatis的代码段
<include refid="Base_Column_List" />
from mmall_user
where username = #{username}
and password = #{password}
</select>
updateByPrimaryKeySelective and updateByPrimaryKey difference:
updateByPrimaryKeySelective field judge will then update (if you ignore Null update), if you want to update a field, you can use this method.
updateByPrimaryKey to update you inject all fields
Reproduced in: https: //www.jianshu.com/p/9a241ed8bedd