<?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.sckw.user.mapper.UserMapper">
    <resultMap id="BaseResultMap" type="com.sckw.user.entity.KwBusinessUser" >
        <result column="id" property="id" />
        <result column="name" property="name" />
        <result column="mobile" property="mobile" />
        <result column="username" property="username" />
        <result column="password" property="password" />
        <result column="slat" property="slat" />
        <result column="status" property="status" />
        <result column="token" property="token" />
        <result column="type" property="type" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="del_flag" property="delFlag" />
    </resultMap>

    <sql id="Base_Column_List">
                id,
                `name`,
                mobile,
                username,
                `password`,
                slat,
                `status`,
                token,
                type,
                create_time,
                update_time,
                del_flag
    </sql>



    <select id="load" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM kw_business_user
        WHERE id = #{id} and del_flag = 0
    </select>

    <select id="selectOneByTenantId" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM kw_business_user
        WHERE tenant_id = #{tenantId} and del_flag = 0
    </select>
</mapper>