mybatis 新增判断空
2016-03-09 15:11
405 查看
mybatis 动态新增
<insert id="insertSelective" parameterType="com.yimayhd.snscenter.client.domain.ComentDO" useGeneratedKeys="true" keyProperty="id" >
insert into com_coment
<trim prefix="(" suffix=")" suffixOverrides="," >
domain,
status,
<if test="gmtCreated != null" >
gmt_created,
</if>
<if test="gmtModified != null" >
gmt_modified,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
#{domain,jdbcType=INTEGER},
#{status,jdbcType=INTEGER},
<if test="gmtCreated != null" >
#{gmtCreated,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null" >
#{gmtModified,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<insert id="insertSelective" parameterType="com.yimayhd.snscenter.client.domain.ComentDO" useGeneratedKeys="true" keyProperty="id" >
insert into com_coment
<trim prefix="(" suffix=")" suffixOverrides="," >
domain,
status,
<if test="gmtCreated != null" >
gmt_created,
</if>
<if test="gmtModified != null" >
gmt_modified,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
#{domain,jdbcType=INTEGER},
#{status,jdbcType=INTEGER},
<if test="gmtCreated != null" >
#{gmtCreated,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null" >
#{gmtModified,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
相关文章推荐
- 19. Remove Nth Node From End of List
- waf实现扫描器识别
- 【bzoj1251】【序列终结者】【splay】
- UIApplication详解(转载)
- 获取文件类型
- storm文档(10)----容错
- 移动应用-使用tcpdump抓包
- 231. Power of Two
- redis configuration
- storm文档(9)----消息处理保证机制
- printf格式输出数字,位数不够前面补0,适用与输出编号
- 一文看懂大数据的技术生态圈,Hadoop,hive,spark都有了
- nGrinder源码分析:详细报告页数据展示
- LeetCode : Divide Two Integers [java]
- #ifdef和#ifndef和#if
- python只引入模块并不能直接调用该模块的函数
- IBM MQ消息中间件jms消息中RHF2消息头的处理
- lstm-思想
- linux与windows的文本文件之间的转换
- 各主板U盘启动热键