//单独的bean类 添加索要查询的元素,提供get set方法
private Stringusername;
private Stringphone;
private Stringpname;
private double pprice;
private int count;
private Stringtname;
private double tprice;
//xml的查新配置(五表联查)
<mapper namespace="dtoMapper">
<select id="getOne" resultType="dto.Dto">
select u.name as username, u.phone, p.name as pname, p.price as pprice, d.count, t.name as tname, o.price as tprice
from users u
inner join orders o on o.uid = u.uid
inner join details d on o.oid = d.oid
inner join products p on d.pid = p.pid
inner join types t on p.tid = t.tid
where o.oid = #{i}
<select id="getAll" resultType="Book">
select* from book
<insert id="saveBook" >
insert into book values (#{id},#{userName},#{password},#{addr})
<update id="updateBook">
update book set userName=#{userName},password=#{password},addr=#{addr} where id=#{id}
</update>
</mapper>