billMapper
<?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="com.oupeng.mapper.BillMapper">
<!--商品名称 供应商 是否付款-->
<select id="getProNameAndProIdAndIsPay" resultMap="billAndProvider">
select b.billCode,b.productName,p.proName,b.totalPrice,b.isPayment,b.creationDate
from smbms_bill b,smbms_provider p
where b.productName like concat('%',#{productName},'%') and b.providerId=#{providerId} and b.isPayment=#{isPayment} and b.providerId=p.id
</select>
<resultMap id="billAndProvider" type="Bill">
<id property="id" column="id"/>
<result property="productName" column="productName"/>
<result property="providerId" column="providerId"/>
<result property="providerName" column="p.proName"/>
</resultMap>
</mapper>
结果