标签:set 内容 tst close key dea class foreach rri
<update id="updateDataKetState"> update ${tablespace}.IDEA_DATAKEY_STATE <trim prefix="set" suffixOverrides=","> <trim prefix="STATENAME = case" suffix="end,"> <foreach collection="datas" item="data" > <if test="data.stateName !=null and data.stateName !=‘‘"> when UUID=#{data.uuid} then #{data.stateName} </if> </foreach> </trim> <trim prefix="STATEINFO = case" suffix="end,"> <foreach collection="datas" item="data" > <if test="data.stateInfo !=null"> when UUID=#{data.uuid} then #{data.stateInfo} </if> </foreach> </trim> <trim prefix="STATENO = case" suffix="end,"> <foreach collection="datas" item="data" > <if test="data.stateNo !=null and data.stateNo !=‘‘"> when UUID=#{data.uuid} then #{data.stateNo} </if> </foreach> </trim> </trim> where UUID in <foreach collection="datas" item="data" open="(" close=")" separator=","> #{data.uuid} </foreach> </update>
<trim>属性说明
1.prefix,suffix 表示在trim标签包裹的部分的前面或者后面添加内容
2.如果同时有prefixOverrides,suffixOverrides 表示会用prefix,suffix覆盖Overrides中的内容。
3.如果只有prefixOverrides,suffixOverrides 表示删除开头的或结尾的xxxOverides指定的内容
标签:set 内容 tst close key dea class foreach rri
原文地址:https://www.cnblogs.com/jagng951014/p/9462447.html