<select id="selectDetailByQueryPriceId" resultType="com.shop.core.beans.responseBeans.officePrice.QueryPriceResponse" >
select cqpe.id as id ,
cqpe.query_price_id as queryPriceId,
cqpe.offer_price_detail_id as offerPriceDetailId,
cqpe.goods_common_id as goodsCommonId,
cqpe.goods_common_name as goodsCommonName,
cqpe.goods_sku_id as goodsSkuId,
cqpe.goods_sku_name as goodsSkuName,
cqpe.goods_image as goodsImage,
cqpe.number as number,
cqpe.goods_unit as goodsUnit,
cqpe.remark as remark,
cope.goods_price as goodsPrice
from club_query_price_detail cqpe left join ( SELECT * FROM club_offer_price_detail WHERE offer_price_user= #{shopId,jdbcType=VARCHAR} ) cope on cqpe.id =cope.query_detail_price_id
where cqpe.query_price_id = #{queryPriceId,jdbcType=VARCHAR}
</select>
分开给条件,这样就能保证左表字段全部出来。右表不影响左表。