left join sys_user u on u.user_name=a.create_by
left join sys_dept d on u.dept_id = d.dept_id
left join bid_jsqr q on q.bid_jsqr_id = a.bid_jsxz_confirm_id
left join bid_hj h on h.bid_hj_id = a.bid_hj_id
select a.bid_id, a.bid_code,a.bid_number,a.bid_salesman_code, a.bid_salesman_bm, a.bid_salesman_name,
a.bid_salesman_dept_id, a.bid_salesman_dept_name,a.bid_has_registration,a.bid_registration_number, a.bid_opening_date,
a.bid_online_quotation, a.bid_website, a.bid_tendering_unit_bm,a.bid_tendering_unit, a.bid_agency,
a.bid_project, a.bid_authorized_representative, a.bid_authorized_phone,
a.bid_file_payment_method, a.bid_payment_deviation, a.bid_copper_price_linkage,
a.bid_price_linkage_method, a.bid_other_require, a.bid_winning_amount,
a.bid_copper_cable_amount, a.bid_aluminum_cable_amount, a.bid_open_close,
a.bid_price_adjustment_notice, a.bid_validity_period, a.bid_tong_price,
a.bid_lv_price, a.bid_ds, a.bid_factory_price, a.bid_price, a.bid_business_settlement,
a.bid_bond, a.bid_winning_service_fee, a.bid_performance_bond, a.bid_delivery_date,
a.bid_warranty_period, a.bid_bidding, a.bid_evaluation_method, a.bid_technical_require,
a.bid_price_linkage, a.bid_payment_method, a.bid_other_matters, a.bid_zbr, a.bid_jdr,
a.bid_shr, a.bid_confirm_status, a.bid_approval_status, a.bid_notification_award, a.bid_remark,a.bid_returnRemark,
a.set_receive_user,a.receive_user_name,a.receive_user_nick_name,a.bid_status,a.create_by,u.nick_name create_name, a.create_time,
a.update_by, a.update_time,
a.bid_jsxz_confirm_id,
isnull(q.bid_jsxz_approval_status,0) bid_jsxz_approval_status,
q.bid_jsxz_technical_requirement,q.bid_jsxz_group_values,
q.bid_jsqr_code bid_jsxz_confirm_code,
q.bid_jsqr_tl_approval_status,q.bid_jsqr_tl_remark,
q.bid_jsqr_dy_approval_status,q.bid_jsqr_dy_remark,
q.bid_jsqr_zy_approval_status,q.bid_jsqr_zy_remark,
q.bid_jsqr_qt_approval_status,q.bid_jsqr_qt_remark,
a.bid_jsqr_check_state,a.bid_jsqr_check_info,
a.bid_hj_id,
isnull(h.bid_hj_approval_status,0) bid_hj_approval_status,
h.bid_hj_code,h.bid_hj_pricing_date,
h.bid_hj_remark
from bid a
insert into bid
bid_id,
bid_code,
bid_number,
bid_salesman_code,
bid_salesman_bm,
bid_salesman_name,
bid_salesman_dept_id,
bid_salesman_dept_name,
bid_has_registration,
bid_registration_number,
bid_opening_date,
bid_online_quotation,
bid_website,
bid_tendering_unit_bm,
bid_tendering_unit,
bid_agency,
bid_project,
bid_authorized_representative,
bid_authorized_phone,
bid_file_payment_method,
bid_payment_deviation,
bid_copper_price_linkage,
bid_price_linkage_method,
bid_other_require,
bid_winning_amount,
bid_copper_cable_amount,
bid_aluminum_cable_amount,
bid_open_close,
bid_price_adjustment_notice,
bid_validity_period,
bid_tong_price,
bid_lv_price,
bid_ds,
bid_factory_price,
bid_price,
bid_business_settlement,
bid_bond,
bid_winning_service_fee,
bid_performance_bond,
bid_delivery_date,
bid_warranty_period,
bid_bidding,
bid_evaluation_method,
bid_technical_require,
bid_price_linkage,
bid_payment_method,
bid_other_matters,
bid_zbr,
bid_jdr,
bid_shr,
bid_confirm_status,
bid_approval_status,
bid_notification_award,
bid_remark,
bid_returnRemark,
set_receive_user,
receive_user_name,
receive_user_nick_name,
bid_status,
bid_jsxz_confirm_id,
bid_hj_id,
create_by,
create_time,
update_by,
update_time,
#{bidId},
#{bidCode},
#{bidNumber},
#{bidSalesmanCode},
#{bidSalesmanBm},
#{bidSalesmanName},
#{bidSalesmanDeptId},
#{bidSalesmanDeptName},
#{bidHasRegistration},
#{bidRegistrationNumber},
#{bidOpeningDate},
#{bidOnlineQuotation},
#{bidWebsite},
#{bidTenderingUnitBm},
#{bidTenderingUnit},
#{bidAgency},
#{bidProject},
#{bidAuthorizedRepresentative},
#{bidAuthorizedPhone},
#{bidFilePaymentMethod},
#{bidPaymentDeviation},
#{bidCopperPriceLinkage},
#{bidPriceLinkageMethod},
#{bidOtherRequire},
#{bidWinningAmount},
#{bidCopperCableAmount},
#{bidAluminumCableAmount},
#{bidOpenClose},
#{bidPriceAdjustmentNotice},
#{bidValidityPeriod},
#{bidTongPrice},
#{bidLvPrice},
#{bidDs},
#{bidFactoryPrice},
#{bidPrice},
#{bidBusinessSettlement},
#{bidBond},
#{bidWinningServiceFee},
#{bidPerformanceBond},
#{bidDeliveryDate},
#{bidWarrantyPeriod},
#{bidBidding},
#{bidEvaluationMethod},
#{bidTechnicalRequire},
#{bidPriceLinkage},
#{bidPaymentMethod},
#{bidOtherMatters},
#{bidZbr},
#{bidJdr},
#{bidShr},
#{bidConfirmStatus},
#{bidApprovalStatus},
#{bidNotificationAward},
#{bidRemark},
#{bidReturnRemark},
#{setReceiveUser},
#{receiveUserName},
#{receiveUserNickName},
#{bidStatus},
#{bidJsxzConfirmId},
#{bidHjId},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
insert into sys_oa_bid
user_id,
department_id,
submission_time,
bid_id,
bid_code,
bid_salesman_name,
bid_has_registration,
bid_registration_number,
bid_opening_date,
bid_online_quotation,
bid_website,
bid_tendering_unit,
bid_agency,
bid_project,
bid_authorized_representative,
bid_authorized_phone,
bid_file_payment_method,
bid_payment_deviation,
bid_copper_price_linkage,
bid_price_linkage_method,
bid_other_require,
bid_remark,
bid_ywy_file,
create_time,
isFinish,
#{userId},
#{departmentId},
#{submissionTime},
#{bidId},
#{bidCode},
#{bidSalesmanName},
#{bidHasRegistration},
#{bidRegistrationNumber},
#{bidOpeningDate},
#{bidOnlineQuotation},
#{bidWebsite},
#{bidTenderingUnit},
#{bidAgency},
#{bidProject},
#{bidAuthorizedRepresentative},
#{bidAuthorizedPhone},
#{bidFilePaymentMethod},
#{bidPaymentDeviation},
#{bidCopperPriceLinkage},
#{bidPriceLinkageMethod},
#{bidOtherRequire},
#{bidRemark},
#{bidYwyFile},
#{createTime},
#{isFinish},
update bid
bid_code = #{bidCode},
bid_number = #{bidNumber},
bid_salesman_code = #{bidSalesmanCode},
bid_salesman_bm = #{bidSalesmanBm},
bid_salesman_name = #{bidSalesmanName},
bid_salesman_dept_id = #{bidSalesmanDeptId},
bid_salesman_dept_name = #{bidSalesmanDeptName},
bid_has_registration = #{bidHasRegistration},
bid_registration_number = #{bidRegistrationNumber},
bid_opening_date = #{bidOpeningDate},
bid_online_quotation = #{bidOnlineQuotation},
bid_website = #{bidWebsite},
bid_tendering_unit_bm = #{bidTenderingUnitBm},
bid_tendering_unit = #{bidTenderingUnit},
bid_agency = #{bidAgency},
bid_project = #{bidProject},
bid_authorized_representative = #{bidAuthorizedRepresentative},
bid_authorized_phone = #{bidAuthorizedPhone},
bid_file_payment_method = #{bidFilePaymentMethod},
bid_payment_deviation = #{bidPaymentDeviation},
bid_copper_price_linkage = #{bidCopperPriceLinkage},
bid_price_linkage_method = #{bidPriceLinkageMethod},
bid_other_require = #{bidOtherRequire},
bid_winning_amount = #{bidWinningAmount},
bid_copper_cable_amount = #{bidCopperCableAmount},
bid_aluminum_cable_amount = #{bidAluminumCableAmount},
bid_open_close = #{bidOpenClose},
bid_price_adjustment_notice = #{bidPriceAdjustmentNotice},
bid_validity_period = #{bidValidityPeriod},
bid_tong_price = #{bidTongPrice},
bid_lv_price = #{bidLvPrice},
bid_ds = #{bidDs},
bid_factory_price = #{bidFactoryPrice},
bid_price = #{bidPrice},
bid_business_settlement = #{bidBusinessSettlement},
bid_bond = #{bidBond},
bid_winning_service_fee = #{bidWinningServiceFee},
bid_performance_bond = #{bidPerformanceBond},
bid_delivery_date = #{bidDeliveryDate},
bid_warranty_period = #{bidWarrantyPeriod},
bid_bidding = #{bidBidding},
bid_evaluation_method = #{bidEvaluationMethod},
bid_technical_require = #{bidTechnicalRequire},
bid_price_linkage = #{bidPriceLinkage},
bid_payment_method = #{bidPaymentMethod},
bid_other_matters = #{bidOtherMatters},
bid_zbr = #{bidZbr},
bid_jdr = #{bidJdr},
bid_shr = #{bidShr},
bid_confirm_status = #{bidConfirmStatus},
bid_approval_status = #{bidApprovalStatus},
bid_notification_award = #{bidNotificationAward},
bid_remark = #{bidRemark},
bid_returnRemark = #{bidReturnRemark},
set_receive_user = #{setReceiveUser},
receive_user_name = #{receiveUserName},
receive_user_nick_name = #{receiveUserNickName},
bid_status = #{bidStatus},
bid_jsxz_confirm_id = #{bidJsxzConfirmId},
bid_hj_id = #{bidHjId},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
where bid_id = #{bidId}
delete from bid where bid_id = #{bidId}
delete from bid where bid_id in
#{bidId}