|
|
|
@ -91,52 +91,110 @@ |
|
|
|
order by id desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="myPage" resultType="com.xujie.modules.supplier.entity.PurQuotationDetail"> |
|
|
|
select |
|
|
|
<include refid="BaseColumnList"/> |
|
|
|
from PurQuotationDetail |
|
|
|
<select id="myPage" resultType="com.xujie.modules.supplier.data.PurQuotationDetailData"> |
|
|
|
select A.order_no |
|
|
|
, A.supplier_id |
|
|
|
, A.supplier_name |
|
|
|
, A.tax_code |
|
|
|
, A.buyer |
|
|
|
, A.currency |
|
|
|
, A.order_date |
|
|
|
, A.upload_flag |
|
|
|
, A.file_name |
|
|
|
, A.want_reply_date |
|
|
|
, A.other_condition as otherCondition |
|
|
|
|
|
|
|
, B.item_no |
|
|
|
, B.site |
|
|
|
, B.part_no |
|
|
|
, B.part_desc |
|
|
|
, B.umid |
|
|
|
, B.qty |
|
|
|
, B.price |
|
|
|
, B.material_cost |
|
|
|
, B.produce_fee |
|
|
|
, B.profit |
|
|
|
, B.freight |
|
|
|
, B.duty |
|
|
|
, B.additional_cost |
|
|
|
, B.pur_lead_time |
|
|
|
, B.remark |
|
|
|
, B.tax |
|
|
|
, B.last_update_by |
|
|
|
, B.status |
|
|
|
, B.tax_rate |
|
|
|
, B.surface_fee |
|
|
|
, B.purchase_cycle |
|
|
|
, B.mould_fee |
|
|
|
, B.remark2 |
|
|
|
|
|
|
|
, E.user_display |
|
|
|
, F.DeliveryTerm as deliveryTerm |
|
|
|
, G.PaymentTerm as paymentTerm |
|
|
|
, P.part_spec as spec |
|
|
|
|
|
|
|
, round((round(round(B.qty, 2) * round(B.Price, 4), 2) + round(B.additional_cost, 2)) * |
|
|
|
round(A.currency_rate, 6), 2) as total_vale_base |
|
|
|
, (round(round(B.qty, 2) * round(B.price, 4), 2) + round(B.additional_cost, 2)) as total_vale |
|
|
|
, (SELECT dbo.Get_Tax_TaxRate(A.site, D.taxCode)) as taxRate |
|
|
|
|
|
|
|
from PurQuotationHeader as A |
|
|
|
left join PurQuotationDetail B on A.site = B.site and A.order_no = B.order_no |
|
|
|
left join part as P On B.Site = P.site and B.part_no = P.part_no |
|
|
|
left join srm_supplier D on A.supplier_id = D.supplier_no and A.site = D.site |
|
|
|
left join sys_user E on A.site = E.site and A.buyer = E.username |
|
|
|
left join DeliveryTerm F on A.site = F.Site and A.delivery_term = F.DeliveryTermID |
|
|
|
left join PaymentTerm G on A.site = G.Site and A.payment_term = G.PaymentTermID |
|
|
|
where 1=1 |
|
|
|
<if test="query.orderNo != null and query.orderNo != '' "> and order_no like '%${query.orderNo}%'</if> |
|
|
|
<if test="query.site != null and query.site != '' "> and site like '%${query.site}%'</if> |
|
|
|
<if test="query.partNo != null and query.partNo != '' "> and part_no like '%${query.partNo}%'</if> |
|
|
|
<if test="query.partDesc != null and query.partDesc != '' "> and part_desc like '%${query.partDesc}%'</if> |
|
|
|
<if test="query.status != null and query.status != '' "> and status like '%${query.status}%'</if> |
|
|
|
<if test="query.qty != null and query.qty != '' "> and qty like '%${query.qty}%'</if> |
|
|
|
<if test="query.umid != null and query.umid != '' "> and umid like '%${query.umid}%'</if> |
|
|
|
<if test="query.remark2 != null and query.remark2 != '' "> and remark2 like '%${query.remark2}%'</if> |
|
|
|
<if test="query.convertFactor != null and query.convertFactor != '' "> and convert_factor like '%${query.convertFactor}%'</if> |
|
|
|
<if test="query.actReplyDate != null and query.actReplyDate != '' "> and act_reply_date like '%${query.actReplyDate}%'</if> |
|
|
|
<if test="query.orderRef1 != null and query.orderRef1 != '' "> and order_ref1 like '%${query.orderRef1}%'</if> |
|
|
|
<if test="query.itemNo != null and query.itemNo != '' "> and item_no like '%${query.itemNo}%'</if> |
|
|
|
<if test="query.surfaceFee != null and query.surfaceFee != '' "> and surface_fee like '%${query.surfaceFee}%'</if> |
|
|
|
<if test="query.freight != null and query.freight != '' "> and freight like '%${query.freight}%'</if> |
|
|
|
<if test="query.lastUpdateBy != null and query.lastUpdateBy != '' "> and last_update_by like '%${query.lastUpdateBy}%'</if> |
|
|
|
<if test="query.orderRef2 != null and query.orderRef2 != '' "> and order_ref2 like '%${query.orderRef2}%'</if> |
|
|
|
<if test="query.purLeadTime != null and query.purLeadTime != '' "> and pur_lead_time like '%${query.purLeadTime}%'</if> |
|
|
|
<if test="query.duty != null and query.duty != '' "> and duty like '%${query.duty}%'</if> |
|
|
|
<if test="query.profit != null and query.profit != '' "> and profit like '%${query.profit}%'</if> |
|
|
|
<if test="query.tax != null and query.tax != '' "> and tax like '%${query.tax}%'</if> |
|
|
|
<if test="query.materialCost != null and query.materialCost != '' "> and material_cost like '%${query.materialCost}%'</if> |
|
|
|
<if test="query.remark != null and query.remark != '' "> and remark like '%${query.remark}%'</if> |
|
|
|
<if test="query.id != null "> and id = '${query.id}'</if> |
|
|
|
<if test="query.additionalCost != null and query.additionalCost != '' "> and additional_cost like '%${query.additionalCost}%'</if> |
|
|
|
<if test="query.purchaseCycle != null and query.purchaseCycle != '' "> and purchase_cycle like '%${query.purchaseCycle}%'</if> |
|
|
|
<if test="query.price != null and query.price != '' "> and price like '%${query.price}%'</if> |
|
|
|
<if test="query.actReplyComments != null and query.actReplyComments != '' "> and act_reply_comments like '%${query.actReplyComments}%'</if> |
|
|
|
<if test="query.taxRate != null and query.taxRate != '' "> and tax_rate like '%${query.taxRate}%'</if> |
|
|
|
<if test="query.acceptFlag != null and query.acceptFlag != '' "> and accept_flag like '%${query.acceptFlag}%'</if> |
|
|
|
<if test="query.produceFee != null and query.produceFee != '' "> and produce_fee like '%${query.produceFee}%'</if> |
|
|
|
<if test="query.mouldFee != null and query.mouldFee != '' "> and mould_fee like '%${query.mouldFee}%'</if> |
|
|
|
<if test="query.orderRef3 != null and query.orderRef3 != '' "> and order_ref3 like '%${query.orderRef3}%'</if> |
|
|
|
<if test="query.orderRefType != null and query.orderRefType != '' "> and order_ref_type like '%${query.orderRefType}%'</if> |
|
|
|
order by id desc |
|
|
|
<if test="query.supplierId != null and query.supplierId != '' "> and A.supplier_id = '%${query.supplierId}%'</if> |
|
|
|
<if test="query.supplierName != null and query.supplierName != '' "> and A.supplier_name like '%${query.supplierName}%'</if> |
|
|
|
<if test="query.startDate != null"> |
|
|
|
and A.order_date gt;= '${query.startDate}' |
|
|
|
</if> |
|
|
|
<if test="query.endDate != null"> |
|
|
|
and A.order_date lt;= '${query.endDate}' |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="query.orderNo != null and query.orderNo != '' "> and B.order_no like '%${query.orderNo}%'</if> |
|
|
|
<if test="query.site != null and query.site != '' "> and B.site like '%${query.site}%'</if> |
|
|
|
<if test="query.partNo != null and query.partNo != '' "> and B.part_no like '%${query.partNo}%'</if> |
|
|
|
<if test="query.partDesc != null and query.partDesc != '' "> and B.part_desc like '%${query.partDesc}%'</if> |
|
|
|
<if test="query.status != null and query.status != '' "> and B.status like '%${query.status}%'</if> |
|
|
|
<if test="query.qty != null and query.qty != '' "> and B.qty like '%${query.qty}%'</if> |
|
|
|
<if test="query.umid != null and query.umid != '' "> and B.umid like '%${query.umid}%'</if> |
|
|
|
<if test="query.remark2 != null and query.remark2 != '' "> and B.remark2 like '%${query.remark2}%'</if> |
|
|
|
<if test="query.convertFactor != null and query.convertFactor != '' "> and B.convert_factor like '%${query.convertFactor}%'</if> |
|
|
|
<if test="query.actReplyDate != null and query.actReplyDate != '' "> and B.act_reply_date like '%${query.actReplyDate}%'</if> |
|
|
|
<if test="query.orderRef1 != null and query.orderRef1 != '' "> and B.order_ref1 like '%${query.orderRef1}%'</if> |
|
|
|
<if test="query.itemNo != null and query.itemNo != '' "> and B.item_no like '%${query.itemNo}%'</if> |
|
|
|
<if test="query.surfaceFee != null and query.surfaceFee != '' "> and B.surface_fee like '%${query.surfaceFee}%'</if> |
|
|
|
<if test="query.freight != null and query.freight != '' "> and B.freight like '%${query.freight}%'</if> |
|
|
|
<if test="query.lastUpdateBy != null and query.lastUpdateBy != '' "> and B.last_update_by like '%${query.lastUpdateBy}%'</if> |
|
|
|
<if test="query.orderRef2 != null and query.orderRef2 != '' "> and B.order_ref2 like '%${query.orderRef2}%'</if> |
|
|
|
<if test="query.purLeadTime != null and query.purLeadTime != '' "> and B.pur_lead_time like '%${query.purLeadTime}%'</if> |
|
|
|
<if test="query.duty != null and query.duty != '' "> and B.duty like '%${query.duty}%'</if> |
|
|
|
<if test="query.profit != null and query.profit != '' "> and B.profit like '%${query.profit}%'</if> |
|
|
|
<if test="query.tax != null and query.tax != '' "> and B.tax like '%${query.tax}%'</if> |
|
|
|
<if test="query.materialCost != null and query.materialCost != '' "> and B.material_cost like '%${query.materialCost}%'</if> |
|
|
|
<if test="query.remark != null and query.remark != '' "> and B.remark like '%${query.remark}%'</if> |
|
|
|
<if test="query.id != null "> and B.id = '${query.id}'</if> |
|
|
|
<if test="query.additionalCost != null and query.additionalCost != '' "> and B.additional_cost like '%${query.additionalCost}%'</if> |
|
|
|
<if test="query.purchaseCycle != null and query.purchaseCycle != '' "> and B.purchase_cycle like '%${query.purchaseCycle}%'</if> |
|
|
|
<if test="query.price != null and query.price != '' "> and B.price like '%${query.price}%'</if> |
|
|
|
<if test="query.actReplyComments != null and query.actReplyComments != '' "> and B.act_reply_comments like '%${query.actReplyComments}%'</if> |
|
|
|
<if test="query.taxRate != null and query.taxRate != '' "> and B.tax_rate like '%${query.taxRate}%'</if> |
|
|
|
<if test="query.acceptFlag != null and query.acceptFlag != '' "> and B.accept_flag like '%${query.acceptFlag}%'</if> |
|
|
|
<if test="query.produceFee != null and query.produceFee != '' "> and B.produce_fee like '%${query.produceFee}%'</if> |
|
|
|
<if test="query.mouldFee != null and query.mouldFee != '' "> and B.mould_fee like '%${query.mouldFee}%'</if> |
|
|
|
<if test="query.orderRef3 != null and query.orderRef3 != '' "> and B.order_ref3 like '%${query.orderRef3}%'</if> |
|
|
|
<if test="query.orderRefType != null and query.orderRefType != '' "> and B.order_ref_type like '%${query.orderRefType}%'</if> |
|
|
|
Order by A.order_no desc ,B.item_no |
|
|
|
</select> |
|
|
|
<select id="getMaxItemNo" resultType="java.lang.Integer"> |
|
|
|
select max(item_no) from PurQuotationDetail |
|
|
|
where order_no = #{orderNo} |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<update id="updatePurDetailStatus"> |
|
|
|
update PurQuotationDetail |
|
|
|
set status = #{status} |
|
|
|
|