新增:

<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. 前端 —— SVG

    0. 简介 SVG:可缩放矢量图形: SVG 是代码,通过浏览器的解析而渲染成一种图形: 可缩放矢量图形是基于可扩展标记语言(XML),以描述二维矢量图形的一种图形格式,由万维网联盟( World W ...

  2. Python 傅里叶分析

    0. 一维序列卷积 np.convolve,注意 same/valid参数下(默认为 full),序列卷积出的结果的长度: >> np.convolve([1, 2, 3], [0, 1, ...

  3. Ubuntu用户管理

    本文主要介绍Ubuntu的用户管理,包括建立和删除用户,用户授权等 ================== 创建用户并授权================== sudo adduser xxx 会在ho ...

  4. ssh远程操作服务器

    登录方式 ssh account@192.168.xxx.xxx 输入密码 远程上传下载文件 上传: scp filepath acount@192.168.xxx.xxx:path filepath ...

  5. C语言extern关键字使用

    在chinaunix上看见一篇转载的文章,觉得特别好,关于extern使用的解释: 参考链接:http://doc.chinaunix.net/CPP/201206/2248432.shtml 在C语 ...

  6. coredns 代理consul 运行noamd 部署的应用

    nomad 是一个方便的应用调度平台,consul 一个很不错的服务发现工具,coredns 很不错, 扩展性比较强的dns 服务器,集成起来可能做很强大的事情 我的运行环境是mac,实际情况按需部署 ...

  7. PostgreSQL 9.6 keepalived主从部署

    ## 环境: PostgreSQL版:9.6 角色                     OS                    IPmaster                 CentOS7 ...

  8. CentOS 6.6下 BCM4312 802.11b/g无线网卡驱动安装

    1.目前www.broadcom.com网站上最新版本为hybrid-v35,但此版本与2.6.32不匹配,无法识别验证密码,搜索网上说是要求升级内核,后根据http://www.dadclab.co ...

  9. 显示列表控件(引用SourceGrid)

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; u ...

  10. 设置pip镜像源

    修改镜像源 vim ~/.pip/pip.conf windows 当前用户目录\pip\pip.ini 内容 [global] index-url=https://pypi.tuna.tsinghu ...