purchase.audit_status, purchase.use_status, purchase.remark,file.url as photo_url from purchase_quote as purchase
p.remark,file.url as photo_url from purchase_quote as p
left join (
left join (
select
select
att.rel_id
att.rel_id
@ -53,31 +49,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where att.source_type = 'purchaseQuote' and att.source_sub_type = 'photo'
where att.source_type = 'purchaseQuote' and att.source_sub_type = 'photo'
group by att.rel_id
group by att.rel_id
)file
)file
on purchase.purchase_quote_id = file.rel_id
on p.purchase_quote_id = file.rel_id
<where>
<where>
<iftest="purchaseQuoteCode != null and purchaseQuoteCode != ''"> and purchase.purchase_quote_code = #{purchaseQuoteCode}</if>
<iftest="purchaseQuoteCode != null and purchaseQuoteCode != ''"> and p.purchase_quote_code = #{purchaseQuoteCode}</if>
<iftest="purchaseBuyer != null and purchaseBuyer != ''"> and purchase.purchaseBuyer = #{purchaseBuyer}</if>
<iftest="purchaseBuyer != null and purchaseBuyer != ''"> and p.purchaseBuyer = #{purchaseBuyer}</if>
<iftest="supplierQuoteCode != null and supplierQuoteCode != ''"> and purchase.supplier_quote_code = #{supplierQuoteCode}</if>
<iftest="supplierQuoteCode != null and supplierQuoteCode != ''"> and p.supplier_quote_code = #{supplierQuoteCode}</if>
<iftest="supplierName != null and supplierName != ''"> and purchase.supplier_name like concat('%', #{supplierName}, '%')</if>
<iftest="supplierName != null and supplierName != ''"> and p.supplier_name like concat('%', #{supplierName}, '%')</if>
<iftest="materialAmount != null and materialAmount != ''"> and purchase.material_amount = #{materialAmount}</if>
<iftest="materialAmount != null and materialAmount != ''"> and p.material_amount = #{materialAmount}</if>
<iftest="params.beginPricingDate != null and params.beginPricingDate != '' and params.endPricingDate != null and params.endPricingDate != ''"> and purchase.pricingDate between #{params.beginPricingDate} and #{params.endPricingDate}</if>
<iftest="params.beginPricingDate != null and params.beginPricingDate != '' and params.endPricingDate != null and params.endPricingDate != ''"> and p.pricingDate between #{params.beginPricingDate} and #{params.endPricingDate}</if>
<iftest="materialNo != null and materialNo != ''"> and purchase.material_no = #{materialNo}</if>
<iftest="materialNo != null and materialNo != ''"> and p.material_no = #{materialNo}</if>
<iftest="params.beginFirstAddTime != null and params.beginFirstAddTime != '' and params.endFirstAddTime != null and params.endFirstAddTime != ''"> and purchase.first_add_time between #{params.beginFirstAddTime} and #{params.endFirstAddTime}</if>
<iftest="materialName != null and materialName != ''"> and p.material_name like concat('%', #{materialName}, '%')</if>
<iftest="updateInfoTime != null and updateInfoTime != ''"> and purchase.update_info_time = #{updateInfoTime}</if>
<iftest="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and p.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<iftest="materialName != null and materialName != ''"> and purchase.material_name like concat('%', #{materialName}, '%')</if>
<iftest="auditStatus != null and auditStatus != ''"> and p.audit_status = #{auditStatus}</if>
<iftest="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and purchase.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<iftest="useStatus != null and useStatus != ''"> and p.use_status = #{useStatus}</if>
<iftest="auditStatus != null and auditStatus != ''"> and purchase.audit_status = #{auditStatus}</if>
<iftest="useStatus != null and useStatus != ''"> and purchase.use_status = #{useStatus}</if>