<?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.interplug.qcast.biz.login.LoginMapper">
    <select id="getLogin" parameterType="com.interplug.qcast.biz.login.dto.LoginUser"
            resultType="boolean">
        /* sqlid : com.interplug.qcast.login.findByLoginId */
        select 1
        from M_USER
        where USER_ID = #{username}
          and PASSWORD = #{password}
    </select>

    <select id="getUser" parameterType="com.interplug.qcast.biz.login.dto.LoginUser"
            resultType="com.interplug.qcast.biz.login.dto.UserResponse">
        /* sqlid : com.interplug.qcast.login.findByLoginId */
        select USER_ID
				, SALE_STORE_ID AS STORE_ID
				, CATEGORY
				, NAME AS USER_NM
				, NAME_KANA AS USER_NM_KANA
				, TEL AS TEL_NO
				, FAX
				, MAIL AS EMAIL
				, GROUP_ID
				, MODULE_SELECT_GROUP_ID
				, VERSION_MANAGEMENT_ID
				, DISP_COST_PRICE
				, DISP_SELLING_PRICE
				, REGIST_DATETIME
				, LAST_EDIT_DATETIME
				, LAST_EDIT_USER
        from M_USER
        where USER_ID = #{loginId}
    </select>
</mapper>