场景:为满足自定义客户管理系统CRM需求
mybatis 中我们想数据库插入数据都会通过实体类承载实体
1.没有实体
所以我们采用key-value方式 即使用map集合来承载需要插入的数据
<insert id="addCustomer" parameterType="cn.tq.workos.crm.vo.AddCustomerVO" >
insert into
${table}
<if test="keyList != null">
<foreach collection="keyList" index="index" item="key" open="(" close=")" separator=",">
${key}
</foreach>
</if>
values
<if test="valueList != null">
<foreach collection="valueList" index="index" item="value" open="(" close=")" separator=",">
'${value}'
</foreach>
</if>
&l