mybatis使用@param("xxx")注解传参和不使用的区别
public interface SystemParameterMapper {
int deleteByPrimaryKey(Integer id);
int insert(SystemParameterDO record);
SystemParameterDO selectByPrimaryKey(Integer id);//不使用注解
List<SystemParameterDO> selectAll();
int updateByPrimaryKey(SystemParameterDO record);
SystemParameterDO getByParamID(@Param("paramID") String paramID);//使用注解
}
跟映射的xml
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select id, paramID, paramContent, paramType, memo
from wh_system_parameter
where id = #{id,jdbcType=INTEGER}
</select> <select id="getByParamID" resultMap="BaseResultMap">
select id, paramID, paramContent, paramType, memo
from wh_system_parameter
where paramID = #{paramID}
</select>
区别是:使用注解可以不用加parameterType
mybatis使用@param("xxx")注解传参和不使用的区别的更多相关文章
- Mybatis 中在传参时,${} 和#{} 的区别
介绍 MyBatis中使用parameterType向SQL语句传参,parameterType后的类型可以是基本类型int,String,HashMap和java自定义类型. 在SQL中引用这些参数 ...
- vue-router路由动态传参query和params的区别
1.query方式传参和接收参数 //路由 { path: '/detail', //这里不需要参入参数 name: "detail", component: detail//这个 ...
- vue路由传参的三种方式区别(params,query)
最近在做一个项目涉及到列表到详情页的参数的传递,网上搜索一下路由传参,结合自己的写法找到一种适合自己的,不过也对三种写法都有了了解,在此记录一下 <ul class="table_in ...
- 小程序页面跳转传参-this和that的区别-登录流程-下拉菜单-实现画布自适应各种手机尺寸
小程序页面跳转传参 根目录下的 app.json 文件 页面文件的路径.窗口表现.设置网络超时时间.设置多 tab { "pages": [ "pages/index/i ...
- (转)vue router 如何使用params query传参,以及有什么区别
写在前面: 传参是前端经常需要用的一个操作,很多场景都会需要用到上个页面的参数,本文将会详细介绍vue router 是如何进行传参的,以及一些小细节问题.有需要的朋友可以做一下参考,喜欢的可以点波赞 ...
- vue路由传参query和params的区别(详解!)
1.query使用path和name传参都可以,而params只能使用name传参. query传参: 页面: this.$router.push({ path:'/city',name:'City' ...
- vue router 如何使用params query传参,以及有什么区别
写在前面: 传参是前端经常需要用的一个操作,很多场景都会需要用到上个页面的参数,本文将会详细介绍vue router 是如何进行传参的,以及一些小细节问题.有需要的朋友可以做一下参考,喜欢的可以点波赞 ...
- React跳转路由传参3种方法和区别
1.params传参 路由表配置:参数地址栏显示 路由页面:<Route path='/demo/:id' component={Demo}></Route> //配置 /:i ...
- mybatis多个参数时传参方式
第一种方案 DAO层的函数方法 Lecture getLecture(Integer id, Integer parentId); 对应的mapper.xml <select id=" ...
随机推荐
- it做形式主语的句子
1. it was considerate of you to visit my mother every day and (to) bring me your notes to help me wi ...
- HDU 5649 DZY Loves Sorting(二分答案+线段树/线段树合并+线段树分割)
题意 一个 \(1\) 到 \(n\) 的全排列,\(m\) 种操作,每次将一段区间 \([l,r]\) 按升序或降序排列,求 \(m\) 次操作后的第 \(k\) 位. \(1 \leq n \le ...
- 51nod1057-N的阶乘(大数乘法巧解)
这道大数乘法开始我是想套板子模拟的..然后就发现2/3的例子都wa了.(惊了).然后在思考后发现n2的板子的确过不了这么多的大数.(不看题的下场).所以,我在网上发现了分块求大数的方法.%%% 思路来 ...
- Ubuntu下codeblocks不能自动缩进的问题
如果在codeblocks中设置了自动缩进但是没有效果的话,在终端中执行sudo apt-get install codeblocks-contrib命令.
- Python 爬虫入门3种方法
Python 2.0 url = "http://www.baidu.com" print '第一种方法' response1 = urllib2.urlopen(url) pri ...
- 【RFT】【环境配置】Mac
参考地址:http://blog.csdn.net/u010044052/article/details/70858015?utm_source=itdadao&utm_medium=refe ...
- Codeforces 786 B. Legacy
题目链接:http://codeforces.com/contest/786/problem/B 典型线段树优化连边,线段树上的每一个点表示这个区间的所有点,然后边数就被优化为了至多${nlogn}$ ...
- Codeforces Round #271 (Div. 2) F. Ant colony 线段树
F. Ant colony time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- 读书笔记《Spring Boot实战 —— Java EE 开发的颠覆者》
Spring框架是轻量级的企业级开发一站式解决方案 Spring使用简单的POJO Plain Old Java Object 无限制的普通Java对象 Spring Framework Runtim ...
- 【教程】手写简易web服务器
package com.littlepage.testjdbc; import java.io.BufferedReader; import java.io.FileReader; import ja ...