mybatis之<trim prefix="" suffix="" suffixOverrides="" prefixOverrides=""></trim>的含义
- <insert id="insert" parameterType="com.tortuousroad.groupon.cart.entity.Cart">
- insert into cart
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="userId != null">
- user_id,
- </if>
- <if test="dealId != null">
- deal_id,
- </if>
- <if test="dealSkuId != null">
- deal_sku_id,
- </if>
- <if test="count != null">
- count,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="updateTime != null">
- update_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=BIGINT},
- </if>
- <if test="userId != null">
- #{userId,jdbcType=BIGINT},
- </if>
- <if test="dealId != null">
- #{dealId,jdbcType=BIGINT},
- </if>
- <if test="dealSkuId != null">
- #{dealSkuId,jdbcType=BIGINT},
- </if>
- <if test="count != null">
- #{count,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- suffixOverrides=","
执行的sql语句也许是这样的:insert into cart (id,user_id,deal_id,) values(1,2,1,);显然是错误的
mybatis之<trim prefix="" suffix="" suffixOverrides="" prefixOverrides=""></trim>的含义的更多相关文章
- mybatis之<trim prefix="" suffix="" suffixOverrides="" prefixOverrides=""></trim>
1.<trim prefix="" suffix="" suffixOverrides="" prefixOverrides=&quo ...
- <trim>: prefix+prefixOverrides+suffix+suffixOverrides
<trim prefix="where" prefixOverrides="where" suffixOverrides="and"& ...
- Mybatis学习笔记11 - 动态sql之trim标签
trim标签体中是整个字符串拼串后的结果.prefix="" 前缀: prefix给拼串后的整个字符串加一个前缀prefixOverrides="" 前缀覆盖: ...
- CSAcademy Prefix Suffix Counting 题解
CSAcademy Prefix Suffix Counting 题解 目录 CSAcademy Prefix Suffix Counting 题解 题意 思路 做法 程序 题意 给你两个数字\(N\ ...
- mybatis之<trim
1.<trim prefix="" suffix="" suffixOverrides="" prefixOverrides=&quo ...
- MyBatis-动态SQL的if、choose、when、otherwise、trim、where、set、foreach使用(各种标签详解), 以及实体间关系配置
比较全的文档:https://www.cnblogs.com/zhizhao/p/7808880.html 或 https://blog.csdn.net/zhll3377/article/detai ...
- mybatics之trim
1.<trim prefix="" suffix="" suffixOverrides="" prefixOverrides=&quo ...
- MyBatis的动态sql小练习,小回顾
关键字if+trim trim可以去除多余的关键字,是where和set的组合 trim标记是一个格式化的标记,可以完成set或者是where标记的功能,如下代码: <trim prefix=& ...
- mapper的前后缀
1.<trim prefix="" suffix="" suffixOverrides="" prefixOverrides=&quo ...
随机推荐
- Postman-CI集成Jenkins(3)
Postman-CI集成Jenkins(3) Postman-简单使用 Postman-进阶使用 Postman-CI集成Jenkins Newman 官方说明:Postman's command-l ...
- DDT驱动
下载ddt并安装 Pip install ddt 或者官网下载安装 http://ddt.readthedocs.io/en/latest/ https://github.com/txels/ddt ...
- Python全栈工程师(数值类型、运算符)
ParisGabriel Python 入门基础 python的应用领域: 1.系统运维 2.网络编程(如:网络爬虫,搜索引擎,服务器编程) 3.科学计算 4.航空领域(如:卫星, ...
- PHP连接mysql数据库进行增删改查--修稿数据
<?php $id = $_GET['id']; $db = new Mysqli("localhost","root","root" ...
- 团队项目-任务分解[Alpha0]
团队项目-任务分解[Alpha0] 标签(空格分隔): 团队博客 适用范围: 本文档 适用对象 团队全体成员 适用时间 alpha阶段第一周计划 10.24-10.28 适用内容 目标.分工.时长估计 ...
- 团队冲刺Alpha(九)
目录 组员情况 组员1(组长):胡绪佩 组员2:胡青元 组员3:庄卉 组员4:家灿 组员5:凯琳 组员6:翟丹丹 组员7:何家伟 组员8:政演 组员9:黄鸿杰 组员10:刘一好 组员11:何宇恒 展示 ...
- spring 配置问题记录1-@ResponseBody和favorPathExtension
在搭建springmvc+easyui的项目时,有一个地方参照网上说的方法一直没实现出来, 就是前台的datagrid的数据渲染不上去, 尝试了好多种方法,包括也找了目前手里的项目来进行比较,也没发现 ...
- 软考——(5)计算机系统之CPU组成
其实我们很早就接触过计算机系统方面的知识,但是还是出现印象不深,理解不清楚的现象,丢分很严重.这部分的知识需要我们花功夫去理解,因为很多东西我们接触不到,比如校验码.码制等,如果你不去理解而是去记,就 ...
- 如何将查询到的数据显示在DataGridView中
背景介绍: 数据库中的T_Line_Info表中存放着学生上机的记录,也就是我们需要查询上机记录的表,其中具体内容为: 界面设计如下: 右击DataGridView控件,选择编辑列,设计它的列名. 代 ...
- nginx限速白名单配置
在<nginx限制连接数ngx_http_limit_conn_module模块>和<nginx限制请求数ngx_http_limit_req_module模块>中会对所有的I ...