《SSM项目开发实战 学校教务管理系统 (SpringMVC+MyBatis)》项目演示
```javascript
1、编写 vo 对象 范例:Teacher.java
public class Teacher implements Serializable {
private String tid,name,password,phone,photo,email;
private Integer age,flag;
private Date lastdate;
}
2、定义公共接口方法 范例:IDAO
/**
* 表示定义公共接口
* @param 表示主键类型
* @param 表示对象
*/ public interface IDAO<K,V> { public boolean doCreate(V vo)throws SQLException; public boolean doUpdate(V vo)throws SQLException; public boolean doRemoveBatch(Set<K> ids)throws SQLException; public V findById(K id)throws SQLException;
}
3、定义 IteacherDAO 接口 范例:定义接口
public interface ITeacherDAO extends IDAO<String, Teacher> { public Teacher findLogin(Teacher vo)throws SQLException;
}
4、定义 sql 范例:修改 mapper 文件
<? xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.xmkeshe.dao.ITeacherDAO">
<select id="findLogin" parameterType="Teacher" resultType="Teacher">
SELECT tid,name,flag,photo,lastdate FROM teacher WHERE tid=#{tid} AND password=#{password}
</select>
</mapper>
5、定义业务层接口 范例:IteacherService
public interface ITeacherService { public Teacher login(Teacher vo)throws Exception;
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200429101059215.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3lsY3Rv,size_16,color_FFFFFF,t_70)