新增:

<insert id="insertSelective" parameterType="map" >
insert into BS_CHNGROUP_DICT
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="groupName != null" >
GROUP_NAME,
</if>
<if test="hasChild != null" >
HAS_CHILD,
</if>
<if test="queryIndex != null" >
QUERY_INDEX,
</if>
<if test="activeTime != null" >
ACTIVE_TIME,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="groupName != null" >
#{groupName,jdbcType=VARCHAR},
</if>
<if test="hasChild != null" >
#{hasChild,jdbcType=CHAR},
</if>
<if test="queryIndex != null" >
#{queryIndex,jdbcType=DECIMAL},
</if>
<if test="activeTime != null" >
#{activeTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>

修改:

  1.

 <update id="updateByPrimaryKeySelective" parameterType="map" >
update BS_STAFF_STATUS
<set >
<if test="status != null" >
STATUS = #{status,jdbcType=VARCHAR},
</if>
<if test="enterTime != null" >
ENTER_TIME = #{enterTime,jdbcType=TIMESTAMP},
</if>
<if test="insertTime != null" >
INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
</if>
<if test="deptId != null" >
DEPT_ID = #{deptId,jdbcType=VARCHAR},
</if>
<if test="phoneNo != null" >
PHONE_NO = #{phoneNo,jdbcType=VARCHAR},
</if>
</set>
where STAFF_ID = #{staffId,jdbcType=VARCHAR}
</update>

查询

  1.

  

<select id="selectSelective" resultType="map" parameterType="map" >
select
<include refid="Base_Column_List" />
from BS_QUESTION_TRACE_INFO a
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="questionId != null" >
and QUESTION_ID = #{questionId,jdbcType=CHAR}
</if>
<if test="preStatus != null">
and PRE_STATUS = #{preStatus,jdbcType=CHAR}
</if>
<if test="curStatus != null">
and CUR_STATUS = #{curStatus,jdbcType=CHAR}
</if>
<if test="oprType != null">
and OPR_TYPE = #{oprType,jdbcType=CHAR}
</if>
<if test="questionOwnerId != null">
and QUESTION_OWNER_ID = #{questionOwnerId,jdbcType=CHAR}
</if>
</trim>
</select>

  

mybatis xml中常见配置demo的更多相关文章

  1. web.xml中常见配置解读

    文章转自:http://blog.csdn.net/sdyy321/article/details/5838791 有一般XML都必须有的版本.编码.DTD <web-app>下子元素&l ...

  2. SpringMVC(十六):如何使用编程方式替代/WEB-INF/web.xml中的配置信息

    在构建springmvc+mybatis项目时,更常用的方式是采用web.xml来配置,而且一般情况下会在web.xml中使用ContextLoaderListener加载applicationCon ...

  3. 【转】MyBatis学习总结(三)——优化MyBatis配置文件中的配置

    [转]MyBatis学习总结(三)——优化MyBatis配置文件中的配置 一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写在了MyBatis的con ...

  4. Mybatis系列(二):优化MyBatis配置文件中的配置和解决字段名与实体类属性名不相同的冲突

    原文链接:http://www.cnblogs.com/xdp-gacl/p/4264301.html     http://www.cnblogs.com/xdp-gacl/p/4264425.ht ...

  5. web.xml中JSP配置及 EL表达式

    web.xml 中JSP配置.servlet配置 及 EL表达式 [摘要] servlet 基本配置 <servlet> <servlet-name>LoginServlet& ...

  6. J2EE进阶(五)Spring在web.xml中的配置

     J2EE进阶(五)Spring在web.xml中的配置 前言 在实际项目中spring的配置文件applicationcontext.xml是通过spring提供的加载机制自动加载到容器中.在web ...

  7. Spring中,applicationContext.xml 配置文件在web.xml中的配置详解

    一.首先写一下代码结构. 二.再看web.xml中的配置情况. <?xml version="1.0" encoding="UTF-8"?> < ...

  8. 使用Spring时web.xml中的配置

    使用Spring时web.xml中的配置: <?xml version="1.0" encoding="UTF-8"?> <web-app x ...

  9. Struts在Web.xml中的配置及Struts1和Struts2的区别

    (1)配置Struts的ActionServlet     <servlet>元素来声明ActionServlet    <servlet-name>元素:用来定义Servle ...

随机推荐

  1. python的继承顺序

    python的继承顺序 python 创建类时分为新式类和旧式类 class A: # 经典类 def __init__(self): pass # 新类,可以在这里加 __metaclass__ = ...

  2. 复利计算5.0(改成Java版本)与 单元测试

    //由于C语言版本不方便单元测试,所以改成了java版本,部分代码如下:import java.util.Scanner; public class FuLi{ public static void ...

  3. CH3401 石头游戏

    题意 3401 石头游戏 0x30「数学知识」例题 描述 石头游戏在一个 n 行 m 列 (1≤n,m≤8) 的网格上进行,每个格子对应一种操作序列,操作序列至多有10种,分别用0~9这10个数字指明 ...

  4. 设计模式(Python)-单例模式

    本系列文章是希望将软件项目中最常见的设计模式用通俗易懂的语言来讲解清楚,并通过Python来实现,每个设计模式都是围绕如下三个问题: 为什么?即为什么要使用这个设计模式,在使用这个模式之前存在什么样的 ...

  5. USB gadget学习笔记

    1.usb-OTG-ADP-HNP-SRP https://blog.csdn.net/xiongjiao0610/article/details/44150849

  6. 使用caddy 进行nodejs web应用近实时编译更新

    caddy 相比nginx 是一个不错的轻量代理服务器,支持的功能也是比较多的, 同时插件也挺多 demo 测试的是通过git 插件进行一个使用spec-md 编写的文档近实时编译以及预览 项目使用d ...

  7. 什么是HBase(二) 关于HFile分割

    关于HFile的分割,是首先要从HFile的合并说起,上回书讲到memstore会不定期刷HFile,然后这些HFile将会被不定过期的被监控程序进行小合并+大合并(所有的文件,不分column fa ...

  8. column count of mysql.proc is wrong. expected 20,found 16. the table is probably corruptd.

    1558 1547 column count of mysql.proc is wrong. expected 20,found 16. the table is probably corruptd. ...

  9. kettle环境变量的设置和获取

    1. 变量的类型Kettle 的早期版本中的变量只有系统环境变量目前版本中(3.1) 变量包括系统环境变量, "Kettle变量" 和内部变量三种 系统环境变量的影响范围很广,凡是 ...

  10. Python 中函数和方法

    函数与方法 class Foo(object): def __init__(self): self.name = 'lcg' def func(self): print(self.name) obj ...