ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
![](https://box.kancloud.cn/f8a9060457a3882d5e579324a3cc436a_1262x428.png) 创建Orders.java这个pojo类 我们创建个OrderMapper.xml ~~~ <?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="mapper.OrderMapper"> <resultMap type="pojo.Orders" id="order"> <!-- 把pojo中和表不一样的写下就行 --> <result column="user_id" property="userId"/> </resultMap> <select id="selectOrdersList" resultMap="order"> select id,user_id,number,createtime,note from orders </select> </mapper> ~~~ 然后创建 ~~~ package mapper; import java.util.List; import pojo.Orders; public interface OrderMapper { // 查询订单表order的所有数据 public List<Orders> selectOrdersList(); } ~~~