数据库操作
`
CREATE TABLE ter_businessapply(
id VARCHAR(8) PRIMARY KEY,
name VARCHAR(50) NOT NULL,
position VARCHAR(50) NOT NULL,
department VARCHAR(50) NOT NULL,
destination VARCHAR(100) NOT NULL,
departure_date varchar(30) NOT NULL,
return_date varchar(30) NOT NULL,
type varchar(30) NOT NULL,
type_content VARCHAR(255),
reason varchar(100) NOT NULL,
state VARCHAR(30) NOT NULL,
state_reason varchar(100),
applytime varchar(30)
);
create TABLE ter_reimburse(
id VARCHAR(8) PRIMARY KEY,
name VARCHAR(50) NOT NULL,
position VARCHAR(50) NOT NULL,
yearsold int NOT NULL,
department VARCHAR(50) NOT NULL,
destination VARCHAR(100) NOT NULL,
departure_date varchar(30) NOT NULL,
return_date varchar(30) NOT NULL,
reason varchar(100) NOT NULL,
start_fare DOUBLE NOT NULL,
return_fare DOUBLE NOT NULL,
food_allowance DOUBLE NOT NULL,
local_trans DOUBLE NOT NULL,
accommodation DOUBLE NOT NULL,
total_amount DOUBLE NOT NULL,
schedule VARCHAR(30) NOT NULL,
schedule_reason varchar(100),
applytime varchar(30) NOT NULL
);
create TABLE ter_user(
id int primary key auto_increment,
username varchar(30),
password varchar(30),
position varchar(30),
department VARCHAR(50)
);
create table ter_employeeinfo(
user_id VARCHAR(8) PRIMARY KEY,
user_name VARCHAR(50) NOT NULL,
department VARCHAR(50) NOT NULL,
position ENUM('普通职员', '部门经理', '总经理', '财务人员') NOT NULL
);
`
`
<environments default="development"><environment id="development"><transactionManager type="JDBC"/><dataSource type="POOLED"><property name="driver" value="com.mysql.cj.jdbc.Driver"/><property name="url" value="jdbc:mysql:///db1?useSSL=false&allowPublicKeyRetrieval=true&useServerPrepStmts=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai"/><property name="username" value="用户名"/><property name="password" value="密码"/></dataSource></environment>
</environments>
<mappers><!--扫描mapper--><package name="com.Moonbeams.mapper"/><!--如果不扫描则加载映射文件--><!--<mapper resource="Moonbeams/mapper/XXX.xml"/>--></mappers>
`