mybatis
select id="selectPlur" parameterType="map" resultMap="elementResultMap"
${sql}
/select
mysql
select * from (select * from ELEMENT where I_NO=1) T1
inner join (select * from ELEMENT where I_NO=3) T2 using (G_NO)
inner join ( select * from ELEMENT where I_NO=5) T3 using (G_NO)
mysql data result
G_NO | I_NO | I_REQ | I_NO | I_REQ | I_NO | I_REQ |
1 | 1 | 10 | 3 | 20 | 5 | 1 |
4 | 1 | 100 | 3 | 10 | 5 | 1 |
ajax result
[0]"gNo": 1
"iNo": 1
"iReq": 10
[1]"gNo": 4
"iNo": 1
"iReq": 100
ajax result what I want
[0]"gNo": 1
"iNo": 1
"iReq": 10
"iNo": 3
"iReq": 20
"iNo": 5
"iReq": 1
[1]"gNo": 4
"iNo": 1
"iReq": 100
"iNo": 3
"iReq": 10
"iNo": 5
"iReq": 1
in mySQL, I execute ‘mysql’ statement and it returns what I want like ‘mysql data result’.
but I`m using mybatis with eclipse
because of property name, result has only one “iNo” and “iReq” like ‘ajax result’
How can I get result like ‘ajax result what I want”?