zoukankan      html  css  js  c++  java
  • 入职第一个项目学习内容

    知识点学习

    实体类

    @Data       
    //注在类上,提供类的get、set、equals、hashCode、canEqual、toString方法
    @EqualsAndHashCode(callSuper = false)  
    //注在类上,提供对应的 equals 和 hashCode 方法
    @Accessors(chain = true)    
    //用于配置getter和setter方法的生成结果,下面介绍三个属性
    @ApiModel(value = "Subject对象", description = "项目列表")    
    //提供有关swagger模型的其它信息,类将在操作中用作类型时自动内省
    public class Subject implements Serializable {
       //Serializable序列化
       private static final long serialVersionUID = 1L;
    //定义序列化id
       @ApiModelProperty(value = "编号 项目编号")        
       //添加和操作模型属性的数据
       @TableId(value = "id", type = IdType.AUTO)          
       //这个注解表示表的主键(value主键字段名,type主键类型)
       private Integer id;
    }

     

    Mapper层

    extends BaseMapper<T>

    提供了一系列的CRUD的基础方法,兵器开发人员对这些基础操作不需要手写SQL进行处理操作.

    insert:插入一条记录

    deleteById:根据ID删除

    deleteByMap:根据 columnMap 条件,删除记录

    delete:根据 entity 条件,删除记

    deleteBatchIds:删除(根据ID 批量删除)

    updateById:根据 ID 修改

    update:根据 whereEntity 条件,更新记录

    selectById:根据 ID 查询

    selectBatchIds:查询(根据ID 批量查询)

    selectByMap:查询(根据 columnMap 条件)

    selectOne:根据 entity 条件,查询一条记录

    selectCount:根据 Wrapper 条件,查询总记录数

    selectList:根据 entity 条件,查询全部记录

    selectMaps:根据 Wrapper 条件,查询全部记录

    selectObjs:根据 Wrapper 条件,查询全部记录

    selectPage:根据 entity 条件,查询全部记录(并翻页)

    selectMapsPage:根据 Wrapper 条件,查询全部记录(并翻页)

     

    Controller

    @RestController             //@Controller和@ResponseBody的结合,返回json数据
    @RequestMapping("/qtmanage/subject") //注解映射请求路径
    @Resource //由J2EE提供,默认按照byName自动注入
    @PathVariable //接收请求路径中占位符的值
       @RequestMapping("show5/{id}/{name}")
       public ModelAndView test5(@PathVariable("id") Long ids,      @PathVariable("name") String names){}

     

    StringUtils

    StringUtils.isEmpty 判断某字符串是否为空

    StringUtils.isNotEmpty 判断某字符串是否非空

    StringUtils.isBlank 判断某字符串是否为空或长度为0或由空白符(whitespace) 构成

    StringUtils.isNotBlank 判断某字符串是否不为空且长度不为0且不由空白符(whitespace) 构成

    StringUtils.trim 去掉字符串两端的控制符 , 如果输入为 null 则返回null

    StringUtils.trimToNull 去掉字符串两端的控制符 ,如果变为 null 或"",则返回 null

    StringUtils.trimToEmpty 去掉字符串两端的控制符,如果变为 null 或 "" ,则返回 ""

    StringUtils.strip 去掉字符串两端的空白符(whitespace) ,如果输入为 null 则返回 null

    StringUtils.stripToNull 去掉字符串两端的空白符(whitespace) ,如果变为 null 或"",则返回 null

    StringUtils.stripToNull 去掉字符串两端的空白符(whitespace) ,如果变为 null 或"" ,则返回""

    控制符("", " ", " ", " "等)

    空白符(""不属于空白符)

     

  • 相关阅读:
    CentOS 压缩(打包)和解压
    CentOS 文件及目录等
    CentOS 文本操作命令(cat more less head tail tr wc state cut diff touch)
    CentOS 显示历史执行过的命令以及用户历史命令缓存文件
    CentOS 查看系统内核和版本
    CentOS 设置环境变量
    迅雷thunder://协议解密
    Office2016自定义安装
    Windows 10中设置自动登录
    Linux安装aMule下载eDonkey200网络共享文件
  • 原文地址:https://www.cnblogs.com/wjmmt/p/12746101.html
Copyright © 2011-2022 走看看