mybatis-config.xml中写sql, 报错, 注释问题

<?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.atguigu.mybatis.mapper.EmpMapper">

    <select id="getEmpByEmpId" resultType="Emp">
        <!-- 注释错误, 弄错好几次, 记录一下吧 -->
        <!-- 错误 注释方式, 直接 ctrl + / , 注释添加- -->
        <!-- select emp_id empId, emp_name empName, age, gender from t_emp where emp_id = #{empId} -->
        select * from t_emp where emp_id = #{empId}
    </select>

</mapper>

在这里插入图片描述

posted on 2022-08-04 10:51  beyondx  阅读(96)  评论(0编辑  收藏  举报

导航