<UpdateID= "Updatedataketstate">Update ${tablespace}. Idea_datakey_state<Trimprefix= "Set"Suffixoverrides=","> <Trimprefix= "StateName = case"suffix= "End,"> <foreachCollection= "Datas"Item= "Data" > <ifTest= "Data.statename!=null and Data.statename! =" ">When Uuid=#{data.uuid} then #{data.statename}</if> </foreach> </Trim> <Trimprefix= "STATEINFO = case"suffix= "End,"> <foreachCollection= "Datas"Item= "Data" > <ifTest= "Data.stateinfo!=null">When Uuid=#{data.uuid} then #{data.stateinfo}</if> </foreach> </Trim> <Trimprefix= "Stateno = case"suffix= "End,"> <foreachCollection= "Datas"Item= "Data" > <ifTest= "Data.stateno!=null and Data.stateno! =" ">When Uuid=#{data.uuid} then #{data.stateno}</if> </foreach> </Trim> </Trim>where UUID in<foreachCollection= "Datas"Item= "Data"Open="("Close=")"Separator=",">#{data.uuid}</foreach> </Update>
<trim> Property Description
1.prefix,suffix means adding content before or after the part of the trim label package
2. If there is prefixoverrides,suffixoverrides, the content in the overrides will be overwritten with Prefix,suffix.
3. If only prefixoverrides,suffixoverrides represents the deletion of the specified content at the beginning or end of the Xxxoverides
MyBatis Bulk update of dynamic SQL