新增:

<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. scikit-learn 学习笔记-- Generalized Linear Models (一)

    scikit-learn 是非常优秀的一个有关机器学习的 Python Lib,包含了除深度学习之外的传统机器学习的绝大多数算法,对于了解传统机器学习是一个很不错的平台.每个算法都有相应的例子,既可以 ...

  2. guake terminal

    类是gnome的终端,超级棒. F11可以全屏/半屏,F12可以显示/隐藏.右键--首选项可以设置配置信息.

  3. 中南林业科技大学第十一届程序设计大赛- I:背包问题

    链接:https://www.nowcoder.com/acm/contest/124/I来源:牛客网 时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 131072K,其他语言26214 ...

  4. Oracle 通过dblink和job方式实现两个数据库表之间数据同步

    需求是需要将Database_A中的dev_test表中的数据同步到Database_B中的dev_test表中. 因为是通过Database_B去同步Database_A库中的数据,所以操作都建立在 ...

  5. [BZOJ4802]欧拉函数

    bzoj description 给出\(n\),求\(\varphi(n)\).\(n\le10^{18}\) sol \(Pollard\ Rho\),存个代码. code #include< ...

  6. USB gadget学习笔记

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

  7. mysql学习--基本使用

    一旦安装完毕,MySQL 服务器应该自己主动启动. sudo start mysql #手动的话这样启动 sudo stop mysql #手动停止 当你改动了配置文件后,你须要重新启动 mysqld ...

  8. php fwrite写入文件bom头导致的乱码问题解决

    最近导出文件遇到fwrite导出乱码,而且中英文都乱码,很费解.折腾了一番之后终于找到问题所在了,mark下. UTF-8 BOM 又叫 UTF-8 签名,其实 UTF-8 的 BOM 对 UFT-8 ...

  9. SpringCloud初体验:三、Feign 服务间调用(FeignClient)、负载均衡(Ribbon)、容错/降级处理(Hystrix)

    FeignOpenFeign Feign是一种声明式.模板化的HTTP客户端. 看了解释过后,可以理解为他是一种 客户端 配置实现的策略,它实现 服务间调用(FeignClient).负载均衡(Rib ...

  10. 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题(转载)

    最近新装好的mysql在进入mysql工具时,总是有错误提示:# mysql -u root -pEnter password:ERROR 1045 (28000): Access denied fo ...