Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

MemberMapper.xml 본문

SPRING/chapter04_MVC

MemberMapper.xml

GAWON 2023. 7. 18. 09:27
<?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="org.joonzis.mapper.MemberMapper">

	<resultMap type="org.joonzis.domain.MemberVO" id="memberMap">
		<result property="userid" column="userid"/>
		<result property="userpw" column="userpw"/>
		<result property="username" column="username"/>
		<result property="regdate" column="regdate"/>
		<result property="updatedate" column="updatedate"/>
		<collection property="authList" resultMap="authMap"></collection>
	</resultMap>
	
	<resultMap type="org.joonzis.domain.AuthVO" id="authMap">
		<result property="userid" column="userid"/>
		<result property="auth" column="auth"/>
	</resultMap>
	
	
	
	
	
	
	<select id="read" resultMap="memberMap">
	SELECT
    	mem.userid, userpw, username, enabled, regdate, updatedate, auth
	FROM
    	tbl_member mem LEFT JOIN tbl_member_auth auth ON mem.userid=auth.userid
	WHERE
    	mem.userid=#{userid}
	</select>
	
</mapper>

'SPRING > chapter04_MVC' 카테고리의 다른 글

log4j.xml  (0) 2023.07.18
ReplyMapper.xml  (0) 2023.07.18
BoardMapper.xml  (0) 2023.07.18
BoardAttachMapper.xml  (0) 2023.07.18
SampleTxServiceImpl.java  (0) 2023.07.18