package kohgylw.model;
public class Department {
private Integer departmentId;
private String pId;
private String departmentName;
private String departmentTel;
private String departmentDesc;
private String departmentGer;
private String departmentType;
public Integer getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Integer departmentId) {
this.departmentId = departmentId;
}
public String getpId() {
return pId;
}
public void setpId(String pId) {
this.pId = pId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getDepartmentTel() {
return departmentTel;
}
public void setDepartmentTel(String departmentTel) {
this.departmentTel = departmentTel;
}
public String getDepartmentDesc() {
return departmentDesc;
}
public void setDepartmentDesc(String departmentDesc) {
this.departmentDesc = departmentDesc;
}
public String getDepartmentGer() {
return departmentGer;
}
public void setDepartmentGer(String departmentGer) {
this.departmentGer = departmentGer;
}
public String getDepartmentType() {
return departmentType;
}
public void setDepartmentType(String departmentType) {
this.departmentType = departmentType;
}
}
辅助分页插件
DepartmentPager.java
package kohgylw.model;
import java.util.List;
//辅助生成分页插件的
public class DepartmentPager {
private int total;//总页码
private int totalRecords;//总记录数
private List listDepartments;//分页记录集合
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public int getTotalRecords() {
return totalRecords;
}
public void setTotalRecords(int totalRecords) {
this.totalRecords = totalRecords;
}
public List getListDepartments() {
return listDepartments;
}
public void setListDepartments(List listDepartments) {
this.listDepartments = listDepartments;
}
@Override
public String toString() {
return "DepartmentPager [total=" + total + ", totalRecords=" + totalRecords + ", listDepartments="
+ listDepartments + "]";
}
}
kohgylw.mapper下建接口 DepartmentMapper.java
package kohgylw.mapper;
import java.util.List;
import java.util.Map;
import kohgylw.model.Department;
public interface DepartmentMapper {
int deleteByPrimaryKey(Integer departmentId);
int insert(Department record);
int insertSelective(Department record);
Department selectByPrimaryKey(Integer departmentId);
int updateByPrimaryKeySelective(Department record);
int updateByPrimaryKey(Department record);
//求部门总记录数
int queryDepartmentNum(Map totalMap);
List querydepartmentPage(Map map);
//根据部门名称查询单个信息
Department selectByDepartmentId(Integer departmentId);
}
kohgylw.mapper.xml下建接口实现类 DepartmentMapper.xml
department_id, p_id, department_name, department_tel, department_desc, department_ger,
department_type
delete from department
where department_id = #{departmentId,jdbcType=INTEGER}
insert into department (department_id, p_id, department_name,
department_tel, department_desc, department_ger,
department_type)
values (#{departmentId,jdbcType=INTEGER}, #{pId,jdbcType=VARCHAR}, #{departmentName,jdbcType=VARCHAR},
#{departmentTel,jdbcType=VARCHAR}, #{departmentDesc,jdbcType=VARCHAR}, #{departmentGer,jdbcType=VARCHAR},
#{departmentType,jdbcType=VARCHAR})
insert into department
department_id,
p_id,
department_name,
department_tel,
department_desc,
department_ger,
department_type,
#{departmentId,jdbcType=INTEGER},
#{pId,jdbcType=VARCHAR},
#{departmentName,jdbcType=VARCHAR},
#{departmentTel,jdbcType=VARCHAR},
#{departmentDesc,jdbcType=VARCHAR},
#{departmentGer,jdbcType=VARCHAR},
#{departmentType,jdbcType=VARCHAR},
update department
p_id = #{pId,jdbcType=VARCHAR},
department_name = #{departmentName,jdbcType=VARCHAR},
department_tel = #{departmentTel,jdbcType=VARCHAR},
department_desc = #{departmentDesc,jdbcType=VARCHAR},
department_ger = #{departmentGer,jdbcType=VARCHAR},
department_type = #{departmentType,jdbcType=VARCHAR},
where department_id = #{departmentId,jdbcType=INTEGER}
update department
set p_id = #{pId,jdbcType=VARCHAR},
department_name = #{departmentName,jdbcType=VARCHAR},
department_tel = #{departmentTel,jdbcType=VARCHAR},
department_desc = #{departmentDesc,jdbcType=VARCHAR},
department_ger = #{departmentGer,jdbcType=VARCHAR},
department_type = #{departmentType,jdbcType=VARCHAR}
where department_id = #{departmentId,jdbcType=INTEGER}
kohgylw.service.impl下建接口 DepartmentService.java
package kohgylw.service.impl;
import kohgylw.model.Department;
public interface DepartmentService {
//添加部门
int insertDepartment(Department department);
//删除部门
int deleteMember(Department department);
//实现查询所有以及默认分页
String getDepartmentServicePage(String pageNumber, String departmentType, String departmentName);
// 修改部门信息
int updateDepartment(Department department);
//根据部门名称查询单个信息
Department selectByDepartmentId(Integer departmentId);
}
终端仿真器是一款用其它显示架构重现可视终端的计算机程序。换句话说就是终端仿真器能使哑终端看似像一台连接上了服务器的客户机。终端仿真器允许最终用户用文本用户界面和命令行来访问控制台和应用程序。(LCTT 译注:终端仿真器原意指对大型机-哑终端方式的模拟,不过在当今的 Linux 环境中,常指通过远程或本地方式连接的伪终端,俗称“终端”。)
你能从开源世界中找到大量的终端仿真器,它们
功能:在控制台每秒输出一次
代码:
package Main;
import javax.swing.Timer;
import java.awt.event.*;
public class T {
private static int count = 0;
public static void main(String[] args){
1,获取样式属性值
top 与顶部的距离
left 与左边的距离
right 与右边的距离
bottom 与下边的距离
zIndex 层叠层次
例子:获取左边的宽度,当css写在body标签中时
<div id="adver" style="position:absolute;top:50px;left:1000p
spring data jpa 支持以方法名进行查询/删除/统计。
查询的关键字为find
删除的关键字为delete/remove (>=1.7.x)
统计的关键字为count (>=1.7.x)
修改需要使用@Modifying注解
@Modifying
@Query("update User u set u.firstna
项目中controller的方法跳转的到ModelAndView类,一直很好奇spring怎么实现的?
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* yo
(1)npm是什么
npm is the package manager for node
官方网站:https://www.npmjs.com/
npm上有很多优秀的nodejs包,来解决常见的一些问题,比如用node-mysql,就可以方便通过nodejs链接到mysql,进行数据库的操作
在开发过程往往会需要用到其他的包,使用npm就可以下载这些包来供程序调用
&nb
Controller层的拦截器继承于HandlerInterceptorAdapter
HandlerInterceptorAdapter.java 1 public abstract class HandlerInterceptorAdapter implements HandlerIntercep