<?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="com.tsvv.dao.EmplyDao">

    <!-- 数据表列字段与pojo类属性映射关系 type:指定将查询的结果封装到哪个类pojo对象中 id:指定一个唯一表示resultMap的值 -->
    <resultMap type="com.tsvv.pojo.Emply" id="emplyRM">
        <id column="id" property="id" />
        <result column="name" property="name" />
        <result column="tele" property="tele" />
        <result column="addr" property="addr" />
        <result column="birthday" property="birthday" />
        <result column="create_time" property="createTime" />
    </resultMap>
<!-- 1.查询所有员工信息 id值为对应接口中方法的名字 resultMap:指定为resultMap标签的id值 --> <select id="findAll" resultMap="emplyRM"> select * from tb_emply </select> </mapper>

 

相关文章:

  • 2022-12-23
  • 2022-03-10
  • 2021-10-25
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2021-12-28
  • 2022-01-08
猜你喜欢
  • 2021-05-26
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
相关资源
相似解决方案