mybatis中sql语句问题

发布网友

我来回答

2个回答

热心网友

这要用到动态sql了,首先你要改成
<resultMap type="test" id="test">
<id property="id" column="id" />
<result column="name" property="name" />
<collection property="picture" ofType="picture">
<id property="picture_id" column="id" />
<result column="proct_id" property="proct_id" />
<result column="img" property="picture_img" />
</collection>
</resultMap>
<select id="selecTests" resultMap="test">
select
A.id ,
B.proct_id,
B.img,
A.name
from test A
LEFT JOIN
picture B ON A.id=B.proct_id
</select>
还有就是你的悬赏太少了

热心网友

直接这样写就可以了追问报错啊,兄弟,不能直接这样写。。

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com