文章目录
易错点
1.直接使用select* from order报错,因为order是关键字,需要使用反引号引起来。这也就是为什么你会看到有些sql语句不需要引起来,而有些需要。
mysql常见保留字
关联查询
1.一对一查询
mapper.xml代码
<!-- 一对一查询-->
<select id="order_relation_one" parameterType="Integer" resultMap="order_business">
select* from `order`
where id=#{id}
</select>
<resultMap id="order_business" type="order">
<id property="id" column="id"></id>
<result property="number" column="number"></result>
<result property