- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 spring配置文件详解-applicationContext.xml文件路劲
spring的配置文件applicationContext.xml的默认地址在WEB-INF下,只要在web.xml中加入代码 org.springframework.web.context.ContextLoaderListener spring就会被自动加载 但在实际的开发过程中,我们可能需要调整applicationContext.xml的位置,以使程序结构更加的清晰。在web.xml中,配...
2019-04-08 00:04:53 237
原创 MyBatis动态sql
1 if 元素 2 choose when otherwise元素 3 trim where set 1)where元素 2)trim元素 使用元素可以避免使用1=1这种很怪异的写法,使用也可以达到同样的效果 注:trim也用来清除or等字段 3)set元素 4 foreach元素 解释: collection:配置的roleNoList可以是一个数组、List、Set等集合 inde...
2019-04-08 00:00:42 89
原创 MyBatis存储过程的使用
1 存储过程的内容 create or replace PROCEDURE count_role( p_role_name in varchar, count_total out int, exec_date out date) IS BEGIN select count(*) into count_total from t_role where role_name like '%'||p_rol...
2019-04-07 23:52:41 273
转载 MyBatis #和$的区别
转:https://www.cnblogs.com/hellokitty1/p/6007801.html 1 #是将传入的值当做字符串的形式,eg:select id,name,age from student where id =#{id},当前端把id值1,传入到后台的时候,就相当于 select id,name,age from student where id ='1'. 2 $是将传入...
2019-04-07 23:44:08 139
原创 MyBatis sql标签元素的使用
<sql id="roleCols"> id,role_name,note </sql> <select id="getRoleUserResultMap" parameterType="long" resultMap="roleMap"> select <include refid='roleCols' /> from t_role wher...
2019-04-07 23:32:43 564
原创 MyBatis参数传递
1 使用map接口传递参数 public List<Role> findRolesByMap(Map<String,Object> parameterMap); <select id="findRoleByMap" parameterType="map" resultMap="role"> select id ,role_name,note from t_to...
2019-04-07 23:12:34 127
原创 MyBatis配置
1 自定义别名 <typeAliases><!-- 别名 --> <typeAlias alias="role" type="com.musi.pojo.Role"/> <typeAlias alias="role" type="com.musi.pojo.User"/> </typeAliases> 简化写法 <typeAl...
2019-04-07 22:44:46 421
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人