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=" ...
随机推荐
- Spring核心简介
Spring简介 Spring是一个开源.轻量级框架.在诞生之初,创建Spring的主要目的是用来替代更加重量级的企业级Java技术,尤其是EJB(Enterprise JavaBean).从最初的挑 ...
- Unsupervised Image-to-Image Translation Networks --- Reading Writing
Unsupervised Image-to-Image Translation Networks --- Reading Writing 2017.03.03 Motivations: most ex ...
- MS-Windows中的Git命令行
Git command line for MS-Windows Inhalt 1 Download and install, or copy the git command line suite fo ...
- 【译】第17节---数据注解-Column
原文:http://www.entityframeworktutorial.net/code-first/column-dataannotations-attribute-in-code-first. ...
- 改变input中的placeholder样式
1.input[placeholder]{ color:#d5d5d5; } 2.input::-moz-placeholder { color: #d5d5d5; } input:-ms-input ...
- 【BZOJ】2815: [ZJOI2012]灾难
简要题意: 给一个有向无环图,问每个节点删掉之后会导致多少个点不可达. 似乎以前拿来考过.... 我们定义一棵树,它满足对应点造成的灭绝值即为当点的子树大小-1 按照被捕食者--->捕食者的关系 ...
- c语言关键字的区分
const int a;//声明一个常整型数 int const a;//声明一个常整型数 const int *a;//声明指向常整型数的指针,整型数不可修改,指针可以修改 int * const ...
- Java——文件及目录File操作
API file.listFiles(); //列出目录下所有文件及子目录fileList[i].isFile() //判断是否为文件 fileList[i].isDirectory() //判断是否 ...
- Spring 的@Required注释
本例子源于:W3Cschool,在此做一个记录 @Required注释为为了保证所对应的属性必须被设置,@Required 注释应用于 bean 属性的 setter 方法,它表明受影响的 bean ...
- Spring Cloud 入门教程(四): 分布式环境下自动发现配置服务
前一章, 我们的Hello world应用服务,通过配置服务器Config Server获取到了我们配置的hello信息“hello world”. 但自己的配置文件中必须配置config serve ...