mybatis oracle批量修改
2016-07-19 00:00
369 查看
摘要: mybatis oracle批量修改
<update id="batchUpdateOrder" parameterType="java.util.List">
begin
<foreach collection="list" item="item" index="index" separator=";">
update mp_order
<set>
<if test="item.orderPostcode != null and item.orderPostcode != ''">
ORDER_POSTCODE = #{item.orderPostcode,jdbcType=VARCHAR},
</if>
<if test="item.customerName != null and item.customerName != ''">
CUSTOMER_NAME = #{item.customerName,jdbcType=VARCHAR},
</if>
<if test="item.credentialsType != null and item.credentialsType != ''">
CREDENTIALS_TYPE = #{item.credentialsType,jdbcType=VARCHAR},
</if>
<if test="item.credentialsNo != null and item.credentialsNo != ''">
CREDENTIALS_NO = #{item.credentialsNo,jdbcType=VARCHAR},
</if>
<if test="item.storeOrderType != null and item.storeOrderType != ''">
STORE_ORDER_TYPE = #{item.storeOrderType,jdbcType=VARCHAR},
</if>
<if test="item.orderSource != null and item.orderSource != ''">
ORDER_SOURCE = #{item.orderSource,jdbcType=VARCHAR},
</if>
<if test="item.totalTariff != null and item.totalTariff != ''">
TOTAL_TARIFF = #{item.totalTariff,jdbcType=DECIMAL},
</if>
</set>
WHERE ORDER_NO = #{item.orderNo,jdbcType=VARCHAR}
</foreach>
;end;
</update>
<update id="batchUpdateOrder" parameterType="java.util.List">
begin
<foreach collection="list" item="item" index="index" separator=";">
update mp_order
<set>
<if test="item.orderPostcode != null and item.orderPostcode != ''">
ORDER_POSTCODE = #{item.orderPostcode,jdbcType=VARCHAR},
</if>
<if test="item.customerName != null and item.customerName != ''">
CUSTOMER_NAME = #{item.customerName,jdbcType=VARCHAR},
</if>
<if test="item.credentialsType != null and item.credentialsType != ''">
CREDENTIALS_TYPE = #{item.credentialsType,jdbcType=VARCHAR},
</if>
<if test="item.credentialsNo != null and item.credentialsNo != ''">
CREDENTIALS_NO = #{item.credentialsNo,jdbcType=VARCHAR},
</if>
<if test="item.storeOrderType != null and item.storeOrderType != ''">
STORE_ORDER_TYPE = #{item.storeOrderType,jdbcType=VARCHAR},
</if>
<if test="item.orderSource != null and item.orderSource != ''">
ORDER_SOURCE = #{item.orderSource,jdbcType=VARCHAR},
</if>
<if test="item.totalTariff != null and item.totalTariff != ''">
TOTAL_TARIFF = #{item.totalTariff,jdbcType=DECIMAL},
</if>
</set>
WHERE ORDER_NO = #{item.orderNo,jdbcType=VARCHAR}
</foreach>
;end;
</update>
相关文章推荐
- mybatis oracle批量插入
- oracle11g 拆分字符串的详细技巧
- Oracle 11g R2 DBA 操作指南(1)
- BestCoder 2nd Anniversary Oracle
- oracle 的绑定变量
- ORA-12560: TNS: 协议适配器错误
- oracle_sql的用法?
- 5.oracle建表的时候同时创建主键,外键,注释,约束,索引
- Oracle SQL性能优化
- oracle rac禁止开机自启动
- HDU-5718 Oracle
- ORACLE和MYSQL查询表字段信息的sql
- BestCoder 2nd Anniversary 1001/hdu5718 Oracle
- oracle数据库如何备份一张表
- HDU 5718 Oracle
- oracle表设计汇总
- Oracle10g_杂
- HDU 5718 Oracle
- Oracle从设计上优化性能汇总
- oracle 高端 必备掌握语句