<!-- 批量更新已存在的会员信息 begin -->
<update id="batchUpdateOmemBean" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="" separator=";" close="">
update omem
<set>
<if test="item.logname != null and item.logname != ''">
LogName = #{item.logname},
</if>
<if test="item.orgid != null">
OrgId = #{item.orgid},
</if>
<if test="item.memid != null ">
MemId = #{item.memid},
</if>
<if test="item.memname != null and item.memname != ''">
MemName = #{item.memname},
</if>
<if test="item.gender != null and item.gender != ''">
Gender = #{item.gender},
</if>
<if test="item.birthdate != null and item.birthdate != ''">
BirthDate = #{item.birthdate},
</if>
<if test="item.tel != null and item.tel != ''">
Tel = #{item.tel},
</if>
<if test="item.email != null and item.email != ''">
Email = #{item.email},
</if>
<if test="item.idcard != null and item.idcard != ''">
IdCard = #{item.idcard},
</if>
<if test="item.nativeaddr != null and item.nativeaddr != ''">
NativeAddr = #{item.nativeaddr},
</if>
<if test="item.address != null and item.address != ''">
Address = #{item.address},
</if>
<if test="item.marrystatus != null and item.marrystatus != ''">
MarryStatus = #{item.marrystatus},
</if>
<if test="item.educationstatus != null and item.educationstatus != ''">
EducationStatus = #{item.educationstatus},
</if>
<if test="item.occupation != null ">
Occupation = #{item.occupation},
</if>
<if test="item.docid != null">
Docid = #{item.docid},
</if>
<if test="item.docname != null and item.docname != ''">
DocName = #{item.docname},
</if>
<if test="item.usetag != null">
UseTag = #{item.usetag},
</if>
<if test="item.createtime != null and item.createtime != ''">
CreateTime = #{item.createtime},
</if>
<if test="item.headimg != null and item.headimg != ''">
headImg = #{item.headimg},
</if>
<if test="item.headaddress != null and item.headaddress != ''">
HeadAddress = #{item.headaddress},
</if>
<if test="item.status != null">
status = #{item.status},
</if>
<if test="item.source != null ">
source = #{item.source},
</if>
<if test="item.uniqueId != null and item.uniqueId != ''">
unique_id = #{item.uniqueId}
</if>
</set>
where Memberid = #{item.memberid}
</foreach>
</update>
<!-- 批量更新已存在的会员信息 end -->
mybatis批量和更新(mysql)
最新推荐文章于 2023-04-26 10:47:52 发布