解决的方法很简单
先说第一种
DAO层的函数方法
Public
User
selectUser(String
imgURL
,String id);
对应的Mapper.xml
<sql id="updateByPo1">
<trim prefix="set" suffixOverrides=",">
<if test="_parameter!= null">
imgURL = #{imgURL
},
</if>
</trim>
</sql>
update customer_account_info//表名
<include refid="updateByPo1"/>
where id = #{id}
</update>
修改后
<sql id="updateByPo1">
<trim prefix="set" suffixOverrides=",">
<if test="_parameter!= null">
imgURL = #{0
},
</if>
</trim>
</sql>
update customer_account_info//表名
<include refid="updateByPo1"/>
where id = #{1}
</update>
其中,#{0}代表接收的是dao层中的第一个参数,#{1}代表dao层中第二参数,更多参数一致往后加即可。