<update id="updateOperApplyExam" parameterType="com.gl.exam.operApplyExam.entity.OperApplyExam"> update sys_oper_applyexam <set> <if test="theoryScore != null and theoryScore != ''"> TheoryScore = #{theoryScore}, </if> <if test="tSRepair != null and tSRepair != ''"> TSRepair = #{tSRepair}, </if> <if test="operScore != null and operScore != ''"> OperScore = #{operScore}, </if> </set> <where> AND ApplyId = #{applyId} </where> </update>
使用<set>标签可以去掉最后一个动态sql拼接的,号