<?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.ads.business.dao.UserDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ads.business.entity.User">
        <id column="user_id" property="userId" />
        <result column="name" property="name" />
        <result column="account" property="account" />
        <result column="password" property="password" />
        <result column="status" property="status" />
        <result column="create_user" property="createUser" />
        <result column="create_time" property="createTime" />
        <result column="update_user" property="updateUser" />
        <result column="update_time" property="updateTime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        user_id, name, account, password, status, create_user, create_time, update_user, update_time
    </sql>
    <select id="findPage" resultType="com.ads.business.service.model.response.AdmUserListResponse">
        select  hu.user_id userId,
                hu.name name,
                hu.account account,
                hu.password password,
                hu.status status,
                hu1.name createUserName,
                hu.create_time createTime
        from    hsay_user hu
        left join hsay_user hu1 on hu.create_user =  hu1.user_id
        ${ew.customSqlSegment}



    </select>
    <select id="getById" resultType="com.ads.business.service.data.UserOutData">
        select  user_id userId,
                name,
                account,
                password,
                status,
                create_user createUser,
                create_time createTime
        from    hsay_user
        where   user_id = #{userId}
    </select>

</mapper>
