mybatis 与oracle
mybatis 单个和批量插入mysql与oracle配置说明
1. mysql
[html] view plain copy
type="cn.mysql.entity.BlackListDO">
insert into
black_list(uuid,type,value,delete_flag,gmt_create,gmt_modified)
values
(#{uuid:VARCHAR},#{type:VARCHAR},#{value:VARCHAR},
#{deleteFlag:INTEGER},#{gmtCreate:DATE},#{gmtModified:DATE})
insert into black_list
(uuid,type,value,delete_flag,gmt_create,gmt_modified) values
separator=",">
(#{item.uuid},#{item.type},#{item.value}
#{item.deleteFlag},#{item.gmtCreate},#{item.gmtModified})
2. oracle
[html] view plain copy
type="cn.oracle.entity.BlackListDO">
select seq_black_list.nextval from dual
insert into
black_list(id,uuid,type,value,delete_flag,gmt_create,gmt_modified)
values
(#{id:DECIMAL},#{uuid:VARCHAR},#{type:VARCHAR},#{value:VARCHAR},
#{deleteFlag:INTEGER},#{gmtCreate:DATE},#{gmtModified:DATE})
select seq_black_list.nextval as id from dual
insert into black_list
(id,uuid,type,value,delete_flag,gmt_create,gmt_modified)
select seq_black_list.nextval, A.* FROM (
separator="union all">
select
#{item.uuid,jdbcType=VARCHAR},
#{item.type,jdbcType=VARCHAR},
#{item.value,jdbcType=VARCHAR},
#{item.deleteFlag,jdbcType=INTEGER},
#{item.gmtCreate,jdbcType=DATE},
#{item.gmtModified,jdbcType=DATE}
from
dual
) A
模糊匹配查询
[html] view plain copy
select * from table_name
AND description like CONCAT(CONCAT('%', #{description}), '%')
0
0
0
0
评论(0)
“还没有人发表评论,快去抢占沙发吧”