用法:
<selectid="selectUser"resultType="com.example.YourUser">
SELECT
<includerefid="Base_Column_List"/>
FROM your_table_name
</select>
2.动态sql语句更新表
//mapper:intupdateUser(List<UserPo> userList);
<!--不需要进行条件判断时--><updateid="updateUser"><foreachcollection="list"separator=";"item="item"index="index">
update user_table set
user_password=#{item.userPassword}, user_name=#{item.userName}, user_level=#{item.userLevel} where id=#{item.id}
</foreach></update>
<!--需要进行条件判断时--><updateid="updateUser"><foreachcollection="list"separator=";"item="item"index="index">
update user_table
<set><iftest="item.userPassword!=null">user_password=#{item.userPassword},</if><iftest="item.userName!=null">user_name=#{item.userName},</if><iftest="item.userLevel!=null">user_level=#{item.userLevel},</if></set>
where id=#{item.id}
</foreach></update>