<?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.platform.yijia.dao.PosMachineMapper">

    <resultMap type="com.platform.yijia.pojo.SysUser" id="SysUserResult">
        <id     property="userId"       column="user_id"      />
        <result property="deptId"       column="dept_id"      />
        <result property="userName"     column="user_name"    />
        <result property="nickName"     column="nick_name"    />
        <result property="email"        column="email"        />
        <result property="phonenumber"  column="phonenumber"  />
        <result property="sex"          column="sex"          />
        <result property="avatar"       column="avatar"       />
        <result property="password"     column="password"     />
        <result property="status"       column="status"       />
        <result property="delFlag"      column="del_flag"     />
        <result property="loginIp"      column="login_ip"     />
        <result property="loginDate"    column="login_date"   />
        <result property="createBy"     column="create_by"    />
        <result property="createTime"   column="create_time"  />
        <result property="updateBy"     column="update_by"    />
        <result property="updateTime"   column="update_time"  />
        <result property="remark"       column="remark"       />
    </resultMap>

    <!--POS机班结登录人信息-->
    <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
        SELECT
            u.user_id,
            u.dept_id,
            u.user_name,
            u.nick_name,
            u.email,
            u.avatar,
            u.phonenumber,
            u.password,
            u.sex,
            u.status,
            u.del_flag,
            u.login_ip,
            u.login_date,
            u.create_by,
            u.create_time,
            u.remark
        FROM
            sys_user AS u
        WHERE
            u.del_flag ="0" AND u.user_name = #{userName}
    </select>
</mapper>
