简单粗暴点,直接上代码吧
mysql创建一张表,表名prentice
表中林朝英有两个徒弟,分别是小龙女和李莫愁。而小龙女有徒弟杨过,李莫愁有徒弟洪凌波。
现在需要通过pid查询出师傅所收的全部徒弟信息。
1. 创建 Prentice实体类 (略)
2. 创建PrenticeMapper接口
package com.wl.mapper;
import java.util.List;
import com.wl.pojo.Prentice;
//根据pid查询徒弟信息
public interface PrenticeMapper {
List<Prentice> selectPrenticeByPid(int pid);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//D