更新多条记录的操作,这里ids是一个数组
<sqltemplate id = "disableBuildLabourer"> <![CDATA[ UPDATE build_labourer SET status = 0 WHERE id IN ( <#list ids as num> ${num} <#if num_has_next>,</#if> </#list> ) ]]> </sqltemplate>
插入多条记录的操作,这里buildLabourerList是一个List<BuildLabourer>的集合
<sqltemplate id="batchImportBuildLabourer"> <![CDATA[ INSERT INTO build_labourer ( realname, sex, id_card, work_type, nation, address, phone )VALUES <#list buildLabourerList as buildLabourer> ( '${buildLabourer.realname}', '${buildLabourer.sex}', '${buildLabourer.idCard}', '${buildLabourer.workType}', '${buildLabourer.nation}', '${buildLabourer.address}', '${buildLabourer.phone}' ) <#if buildLabourer_has_next>,</#if> </#list> ]]> </sqltemplate>