• 小知识点1


    (1)在springMvc中,使用@Controller注解表示控制器时,在请求处理的方法返回值是String时,String字符串与spring的配置文件applicationContext.xml中的配置的视图视图解析器一起构建出跳转的路径。

      这个路径一般是据对路径,直接是在在项目名之后开始构建跳转的访问路径,http://localhost:8080/hk(项目名)/customInfo/toRegister.do

      例如:视图解析器是配置的

      

      那么return register;  跳转的页面路劲就是:http://localhost:8080/hk/register.jsp

     

    (2)Mybatis配置文件中构建模糊查询,where条件之一

    <if test="name!=null and !''.equals(name)">
        and name like concat(concat('%',#{name}),'%')
    </if>
    

    (3)Mybatis的sql语句的传入值是list或者array时,书写sql语句

    <!-- 批量删除信息 -->
    <delete id="deleteCustomInfoList" parameterType="java.util.List">
    	delete from customInfo where openId in
    	<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
    		#{item.openId}
    	</foreach>
    </delete>
    

      

     

  • 相关阅读:
    2018级软件秋季总结
    对我影响最大的三位老师
    自我介绍
    Js中的一个日期处理格式化函数
    SQL update语句加减乘除运算
    用css让一个容器水平垂直
    position:absolute 的深入探讨
    java正则表达式
    Session
    使用Cookie进行会话管理
  • 原文地址:https://www.cnblogs.com/gangbalei/p/6184904.html
Copyright © 2020-2023  润新知