<?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.imooc.o2o.dao.LocalAuthDao">
<resultMap id="localAuthResultMap" type="com.imooc.o2o.entity.LocalAuth">
<id column="local_auth_id" property="localAuthId" />
<result column="username" property="username" />
<result column="password" property="password" />
<result column="create_time" property="createTime" />
<result column="last_edit_time" property="lastEditTime" />
<association property="personInfo" column="user_id"
javaType="com.imooc.o2o.entity.PersonInfo">
<id column="user_id" property="userId" />
<result column="name" property="name" />
<result column="gender" property="gender" />
<result column="email" property="email" />
<result column="profile_img" property="profileImg" />
<result column="user_type" property="userType" />
<result column="create_time" property="createTime" />
<result column="last_edit_time" property="lastEditTime" />
<result column="enable_status" property="enableStatus" />
</association>
</resultMap>
<select id="queryLocalByUserNameAndPwd" resultMap="localAuthResultMap"
parameterType="String">
SELECT
l.local_auth_id,
l.username,
l.password,
l.create_time,
l.last_edit_time,
p.user_id,
p.name,
p.gender,
p.email,
p.profile_img,
p.user_type,
p.create_time,
p.last_edit_time,
p.enable_status
FROM
tb_local_auth l
LEFT
JOIN
tb_person_info
p ON l.user_id
=
p.user_id
WHERE
l.username =
#{username}
AND
l.password = #{password}
</select>
</mapper>