6 changed files with 89 additions and 1 deletions
@ -0,0 +1,51 @@ |
|||||||
|
创建表命令: |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
|
||||||
|
``` |
||||||
|
# 创建管理员表 |
||||||
|
create table uses ( |
||||||
|
id int (10) auto_increment primary key not null, |
||||||
|
number char(5) comment '账号', |
||||||
|
iphone int(11) comment '手机号', |
||||||
|
workType varchar(4) comment '工作岗位', |
||||||
|
loginDate datetime, |
||||||
|
loginNumber int(255) |
||||||
|
); |
||||||
|
# 查看表结构 |
||||||
|
desc uses; |
||||||
|
# 查看表数据 |
||||||
|
select * from uses; |
||||||
|
|
||||||
|
# 创建部门表 |
||||||
|
create table work( |
||||||
|
id int(255) auto_increment primary key, |
||||||
|
workId char(10) not null comment '部门ID', |
||||||
|
workName varchar(5) comment '部门名称', |
||||||
|
workCreate datetime, |
||||||
|
workDescription varchar(255) comment '部门简介' |
||||||
|
); |
||||||
|
|
||||||
|
# 查询表 |
||||||
|
show tables; |
||||||
|
|
||||||
|
# 删除表 |
||||||
|
drop table uses; |
||||||
|
|
||||||
|
# 资产管理表 |
||||||
|
create table AssetInfo( |
||||||
|
id int(255) auto_increment primary key comment '索引字段', |
||||||
|
AssetId char(5) comment '资产编号', |
||||||
|
AssetName varchar(10) comment '资产名称', |
||||||
|
AssetType varchar(10) comment '资产类型', |
||||||
|
AssetSupplier varchar(20) comment '供应商', |
||||||
|
AssetBrand varchar(20) comment '品牌', |
||||||
|
AssetMethod varchar(20) comment '取得方式', |
||||||
|
AssetDate datetime comment '资产时间', |
||||||
|
AssetAddress varchar(40) comment '存放地址', |
||||||
|
AssetStatus char(10) comment '资产状态' |
||||||
|
); |
||||||
|
# 查看表结构 |
||||||
|
desc AssetInfo; |
||||||
|
``` |
||||||
@ -0,0 +1,22 @@ |
|||||||
|
package co.depsystem.application2.DAO; |
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Insert; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
import org.apache.ibatis.annotations.Select; |
||||||
|
import org.springframework.stereotype.Repository; |
||||||
|
|
||||||
|
@Repository |
||||||
|
@Mapper |
||||||
|
public interface Useinfo { |
||||||
|
|
||||||
|
/** 查询 */ |
||||||
|
@Select("select * from uses where number = #usernumber") |
||||||
|
public void getUserName(@Param("usernumber")String usernumber); |
||||||
|
|
||||||
|
@Insert("insert into depsystem.uses values (#o)") |
||||||
|
public void setUser(@Param("o") Object o); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,4 @@ |
|||||||
|
package co.depsystem.application2.DAO.mapper; |
||||||
|
|
||||||
|
public interface UserMapper{ |
||||||
|
} |
||||||
Loading…
Reference in new issue