撒科打诨
mybatis支持foreach语句,语法大致如下:<update id="batchUpdate">update tblsupertitleresult<trim prefix="set" suffixOverrides=","><trim prefix="checkState =case" suffix="end,"><foreach collection="list" item="i" index="index"><if test="i.checkState!=null">when (userHhCode=#{i.userHhCode} and titleId=#{i.titleId}) then #{i.checkState}</if></foreach></trim><trim prefix=" correctDate =case" suffix="end,"><foreach collection="list" item="i" index="index"><if test="i.correctDate!=null">when (userHhCode=#{i.userHhCode} and titleId=#{i.titleId}) then #{i.correctDate}</if></foreach></trim><trim prefix="result =case" suffix="end," ><foreach collection="list"item="i" index="index"><if test="i.result!=null">when (userHhCode=#{i.userHhCode} and titleId=#{i.titleId}) then #{i.result}</if></foreach></trim></trim>where<foreach collection="list" separator="or"item="i" index="index" >(userHhCode =#{i.userHhCode} andtitleId=#{i.titleId})</foreach></update>