关于 多个值不同的处理 比如channelid 为空和非空的处理

[quote]

<update id="update" parameterType="com.zyd.orders.placeorder.model.SalesmanDO">
update
salesman
<set>
<if test="salesmanName != null and salesmanName != ''"> salesman_name = #{salesmanName}, </if>
<if test="idNo != null"> id_no = #{idNo}, </if>
<if test="idType != null"> id_type = #{idType}, </if>
<if test="status != null and status != ''"> status = #{status}, </if>
<if test="phoneNo != null and phoneNo != ''"> phone_no = #{phoneNo}, </if>
<if test="channelId != null "> channel_id = #{channelId}, </if>
<if test="channelId == null "> channel_id = null, </if>
<if test="profession != null and profession != ''"> profession = #{profession}, </if>
<if test="contactAddress != null and contactAddress != ''"> contact_address = #{contactAddress}, </if>
<if test="email != null and email != ''"> email = #{email}, </if>
<if test="memo != null and memo != ''"> memo = #{memo}, </if>
<if test="registerDate != null "> register_date = #{registerDate}, </if>
<if test="updateBy != null"> update_by = #{updateBy}, </if>
<if test="password != null"> password = #{password}, </if>
<if test="loginTotalTimes != null"> login_total_times = #{loginTotalTimes}, </if>
update_time = CURRENT_TIMESTAMP
</set>
where
salesman_id = #{salesmanId}

</update>


[/quote]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值