• 解决:Could not find SQL statement to include with refid


    请检查xml文件的SQL标签和resultMap标签内容是否写正确了。
    
    下面是正确的写法样例。
    <?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.wyx.dao.SysUserMapper">
        <resultMap id="BaseResultMap" type="com.wyx.model.SysUser">
            <id column="id" jdbcType="BIGINT" property="id" />
            <result column="name" jdbcType="VARCHAR" property="name" />
            <result column="nick_name" jdbcType="VARCHAR"
                property="nickName" />
            <result column="avatar" jdbcType="VARCHAR" property="avatar" />
            <result column="password" jdbcType="VARCHAR"
                property="password" />
            <result column="salt" jdbcType="VARCHAR" property="salt" />
            <result column="email" jdbcType="VARCHAR" property="email" />
            <result column="mobile" jdbcType="VARCHAR" property="mobile" />
            <result column="status" jdbcType="TINYINT" property="status" />
            <result column="dept_id" jdbcType="BIGINT" property="deptId" />
            <result column="create_by" jdbcType="VARCHAR"
                property="createBy" />
            <result column="create_time" jdbcType="TIMESTAMP"
                property="createTime" />
            <result column="last_update_by" jdbcType="VARCHAR"
                property="lastUpdateBy" />
            <result column="last_update_time" jdbcType="TIMESTAMP"
                property="lastUpdateTime" />
            <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
        </resultMap>
    
        <sql id="Base_Column_List">
            id, name, nick_name, avatar, password, salt, email, mobile, status,
            dept_id, create_by,
            create_time, last_update_by, last_update_time, del_flag
        </sql>
    
        <select id="findAll" resultMap="BaseResultMap">
            select
            <include refid="Base_Column_List" />
            from sys_user
        </select>
    </mapper>
  • 相关阅读:
    Shell脚本查看apk签名信息
    Android Studio中的六种依赖
    Gradle build设置自动log开关
    转-Android Studio系列教程六--Gradle多渠道打包
    经验分享
    Android Studio build dex jar
    iPhone6搜索如何打开?详细使用方法
    Android Studio 简单设置
    Android Studio常见问题 -- uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library
    iOS开发学习记录【整理】
  • 原文地址:https://www.cnblogs.com/tszr/p/15865162.html
Copyright © 2020-2023  润新知