JNBusinessTest/ruoyi-system/target/classes/mapper/bid/BidMapper.xml

670 lines
43 KiB
XML

<?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.ruoyi.bid.mapper.BidMapper">
<resultMap type="Bid" id="BidResult">
<result property="bidId" column="bid_id" />
<result property="bidCode" column="bid_code" />
<result property="bidNumber" column="bid_number" />
<result property="bidSalesmanCode" column="bid_salesman_code" />
<result property="bidSalesmanBm" column="bid_salesman_bm" />
<result property="bidSalesmanName" column="bid_salesman_name" />
<result property="bidSalesmanDeptId" column="bid_salesman_dept_id" />
<result property="bidSalesmanDeptName" column="bid_salesman_dept_name" />
<result property="bidHasRegistration" column="bid_has_registration" />
<result property="bidRegistrationNumber" column="bid_registration_number" />
<result property="bidOpeningDate" column="bid_opening_date" />
<result property="bidOnlineQuotation" column="bid_online_quotation" />
<result property="bidWebsite" column="bid_website" />
<result property="bidTenderingUnitBm" column="bid_tendering_unit_bm" />
<result property="bidTenderingUnit" column="bid_tendering_unit" />
<result property="bidAgency" column="bid_agency" />
<result property="bidProject" column="bid_project" />
<result property="bidAuthorizedRepresentative" column="bid_authorized_representative" />
<result property="bidAuthorizedPhone" column="bid_authorized_phone" />
<result property="bidFilePaymentMethod" column="bid_file_payment_method" />
<result property="bidPaymentDeviation" column="bid_payment_deviation" />
<result property="bidCopperPriceLinkage" column="bid_copper_price_linkage" />
<result property="bidPriceLinkageMethod" column="bid_price_linkage_method" />
<result property="bidOtherRequire" column="bid_other_require" />
<result property="bidWinningAmount" column="bid_winning_amount" />
<result property="bidCopperCableAmount" column="bid_copper_cable_amount" />
<result property="bidAluminumCableAmount" column="bid_aluminum_cable_amount" />
<result property="bidOpenClose" column="bid_open_close" />
<result property="bidPriceAdjustmentNotice" column="bid_price_adjustment_notice" />
<result property="bidValidityPeriod" column="bid_validity_period" />
<result property="bidTongPrice" column="bid_tong_price" />
<result property="bidLvPrice" column="bid_lv_price" />
<result property="bidDs" column="bid_ds" />
<result property="bidFactoryPrice" column="bid_factory_price" />
<result property="bidPrice" column="bid_price" />
<result property="bidBusinessSettlement" column="bid_business_settlement" />
<result property="bidBond" column="bid_bond" />
<result property="bidWinningServiceFee" column="bid_winning_service_fee" />
<result property="bidPerformanceBond" column="bid_performance_bond" />
<result property="bidDeliveryDate" column="bid_delivery_date" />
<result property="bidWarrantyPeriod" column="bid_warranty_period" />
<result property="bidBidding" column="bid_bidding" />
<result property="bidEvaluationMethod" column="bid_evaluation_method" />
<result property="bidTechnicalRequire" column="bid_technical_require" />
<result property="bidPriceLinkage" column="bid_price_linkage" />
<result property="bidPaymentMethod" column="bid_payment_method" />
<result property="bidOtherMatters" column="bid_other_matters" />
<result property="bidZbr" column="bid_zbr" />
<result property="bidJdr" column="bid_jdr" />
<result property="bidShr" column="bid_shr" />
<result property="bidConfirmStatus" column="bid_confirm_status" />
<result property="bidApprovalStatus" column="bid_approval_status" />
<result property="bidOaApprovalStatus" column="bid_oa_approval_status" />
<result property="bidNotificationAward" column="bid_notification_award" />
<result property="bidRemark" column="bid_remark" />
<result property="bidReturnRemark" column="bid_returnRemark" />
<result property="bidStatus" column="bid_status" />
<result property="bidMatpriceDiff" column="bid_matprice_diff" />
<result property="bidVicePresidentApproved" column="bid_vice_president_approved" />
<result property="bidOaRemark" column="bid_oa_remark" />
<result property="bidOaIsTp" column="bid_oa_isTp" />
<result property="bidJsxzApprovalStatus" column="bid_jsxz_approval_status" />
<result property="bidJsxzTechnicalRequirement" column="bid_jsxz_technical_requirement" />
<result property="bidJsxzGroupValues" column="bid_jsxz_group_values" />
<result property="bidJsxzConfirmId" column="bid_jsxz_confirm_id" />
<result property="bidJsxzConfirmCode" column="bid_jsxz_confirm_code" />
<result property="bidJsqrTlApprovalStatus" column="bid_jsqr_tl_approval_status" />
<result property="bidJsqrTlRemark" column="bid_jsqr_tl_remark" />
<result property="bidJsqrDyApprovalStatus" column="bid_jsqr_dy_approval_status" />
<result property="bidJsqrDyRemark" column="bid_jsqr_dy_remark" />
<result property="bidJsqrZyApprovalStatus" column="bid_jsqr_zy_approval_status" />
<result property="bidJsqrZyRemark" column="bid_jsqr_zy_remark" />
<result property="bidJsqrQtApprovalStatus" column="bid_jsqr_qt_approval_status" />
<result property="bidJsqrQtRemark" column="bid_jsqr_qt_remark" />
<result property="bidJsqrCheckState" column="bid_jsqr_check_state" />
<result property="bidJsqrCheckInfo" column="bid_jsqr_check_info" />
<result property="bidHjId" column="bid_hj_id" />
<result property="bidHjCode" column="bid_hj_code" />
<result property="bidHjApprovalStatus" column="bid_hj_approval_status" />
<result property="bidHjPricingDate" column="bid_hj_pricing_date" />
<result property="bidHjRemark" column="bid_hj_remark" />
<result property="createBy" column="create_by" />
<result property="createName" column="create_name" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="bidJoins">
left join sys_user u on u.user_id=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
</sql>
<sql id="selectBidVo">
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_oa_approval_status,a.bid_matprice_diff,
a.bid_notification_award, a.bid_remark,a.bid_returnRemark,
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,
isnull(a.bid_jsqr_check_state,1) bid_jsqr_check_state,a.bid_jsqr_check_info,
a.bid_vice_president_approved,a.bid_oa_remark,a.bid_oa_isTp,
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
<include refid="bidJoins"/>
</sql>
<select id="selectBidList" parameterType="Bid" resultMap="BidResult">
<include refid="selectBidVo"/>
<where>
<if test="bidNumber != null and bidNumber != ''"> and bid_number like concat('%', #{bidNumber}, '%')</if>
<if test="bidSalesmanName != null and bidSalesmanName != ''"> and u.nick_name like concat('%', #{bidSalesmanName}, '%')</if>
<if test="bidAuthorizedRepresentative != null and bidAuthorizedRepresentative != ''"> and bid_authorized_representative like concat('%', #{bidAuthorizedRepresentative}, '%')</if>
<if test="params.beginBidOpeningDate != null and params.beginBidOpeningDate != '' and params.endBidOpeningDate != null and params.endBidOpeningDate != ''"> and bid_opening_date between #{params.beginBidOpeningDate} and #{params.endBidOpeningDate}</if>
<if test="bidTenderingUnit != null and bidTenderingUnit != ''"> and bid_tendering_unit like concat('%', #{bidTenderingUnit}, '%')</if>
<if test="bidAgency != null and bidAgency != ''"> and bid_agency like concat('%', #{bidAgency}, '%')</if>
<if test="bidProject != null and bidProject != ''"> and bid_project like concat('%', #{bidProject}, '%')</if>
<if test="bidStatus != null and bidStatus != ''"> and bid_status = #{bidStatus}</if>
<if test="bidZbr != null and bidZbr != ''"> and bid_zbr like concat('%', #{bidZbr}, '%')</if>
<if test="bidApprovalStatus != null and bidApprovalStatus != ''"> and bid_approval_status = #{bidApprovalStatus}</if>
<if test="createBy != null and createBy != ''"> and a.create_by = #{createBy}</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
order by a.bid_code desc
</select>
<select id="selectBidByBidId" parameterType="String" resultMap="BidResult">
<include refid="selectBidVo"/>
where a.bid_id = #{bidId}
</select>
<insert id="insertBid" parameterType="Bid">
insert into bid
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="bidId != null">bid_id,</if>
<if test="bidCode != null">bid_code,</if>
<if test="bidNumber != null">bid_number,</if>
<if test="bidSalesmanCode != null">bid_salesman_code,</if>
<if test="bidSalesmanBm != null">bid_salesman_bm,</if>
<if test="bidSalesmanName != null">bid_salesman_name,</if>
<if test="bidSalesmanDeptId != null">bid_salesman_dept_id,</if>
<if test="bidSalesmanDeptName != null">bid_salesman_dept_name,</if>
<if test="bidHasRegistration != null">bid_has_registration,</if>
<if test="bidRegistrationNumber != null">bid_registration_number,</if>
<if test="bidOpeningDate != null">bid_opening_date,</if>
<if test="bidOnlineQuotation != null">bid_online_quotation,</if>
<if test="bidWebsite != null">bid_website,</if>
<if test="bidTenderingUnitBm != null">bid_tendering_unit_bm,</if>
<if test="bidTenderingUnit != null">bid_tendering_unit,</if>
<if test="bidAgency != null">bid_agency,</if>
<if test="bidProject != null">bid_project,</if>
<if test="bidAuthorizedRepresentative != null">bid_authorized_representative,</if>
<if test="bidAuthorizedPhone != null">bid_authorized_phone,</if>
<if test="bidFilePaymentMethod != null">bid_file_payment_method,</if>
<if test="bidPaymentDeviation != null">bid_payment_deviation,</if>
<if test="bidCopperPriceLinkage != null">bid_copper_price_linkage,</if>
<if test="bidPriceLinkageMethod != null">bid_price_linkage_method,</if>
<if test="bidOtherRequire != null">bid_other_require,</if>
<if test="bidWinningAmount != null">bid_winning_amount,</if>
<if test="bidCopperCableAmount != null">bid_copper_cable_amount,</if>
<if test="bidAluminumCableAmount != null">bid_aluminum_cable_amount,</if>
<if test="bidOpenClose != null">bid_open_close,</if>
<if test="bidPriceAdjustmentNotice != null">bid_price_adjustment_notice,</if>
<if test="bidValidityPeriod != null">bid_validity_period,</if>
<if test="bidTongPrice != null">bid_tong_price,</if>
<if test="bidLvPrice != null">bid_lv_price,</if>
<if test="bidDs != null">bid_ds,</if>
<if test="bidFactoryPrice != null">bid_factory_price,</if>
<if test="bidPrice != null">bid_price,</if>
<if test="bidBusinessSettlement != null">bid_business_settlement,</if>
<if test="bidBond != null">bid_bond,</if>
<if test="bidWinningServiceFee != null">bid_winning_service_fee,</if>
<if test="bidPerformanceBond != null">bid_performance_bond,</if>
<if test="bidDeliveryDate != null">bid_delivery_date,</if>
<if test="bidWarrantyPeriod != null">bid_warranty_period,</if>
<if test="bidBidding != null">bid_bidding,</if>
<if test="bidEvaluationMethod != null">bid_evaluation_method,</if>
<if test="bidTechnicalRequire != null">bid_technical_require,</if>
<if test="bidPriceLinkage != null">bid_price_linkage,</if>
<if test="bidPaymentMethod != null">bid_payment_method,</if>
<if test="bidOtherMatters != null">bid_other_matters,</if>
<if test="bidZbr != null">bid_zbr,</if>
<if test="bidJdr != null">bid_jdr,</if>
<if test="bidShr != null">bid_shr,</if>
<if test="bidConfirmStatus != null">bid_confirm_status,</if>
<if test="bidApprovalStatus != null">bid_approval_status,</if>
<if test="bidOaApprovalStatus != null">bid_oa_approval_status,</if>
<if test="bidNotificationAward != null">bid_notification_award,</if>
<if test="bidRemark != null">bid_remark,</if>
<if test="bidReturnRemark != null">bid_returnRemark,</if>
<if test="bidStatus != null">bid_status,</if>
<if test="bidVicePresidentApproved != null">bid_vice_president_approved,</if>
<if test="bidMatpriceDiff != null">bid_matprice_diff,</if>
<if test="bidOaRemark != null">bid_oa_remark,</if>
<if test="bidOaIsTp != null">bid_oa_isTp,</if>
<if test="bidJsxzConfirmId != null">bid_jsxz_confirm_id,</if>
<if test="bidHjId != null">bid_hj_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="bidId != null">#{bidId},</if>
<if test="bidCode != null">#{bidCode},</if>
<if test="bidNumber != null">#{bidNumber},</if>
<if test="bidSalesmanCode != null">#{bidSalesmanCode},</if>
<if test="bidSalesmanBm != null">#{bidSalesmanBm},</if>
<if test="bidSalesmanName != null">#{bidSalesmanName},</if>
<if test="bidSalesmanDeptId != null">#{bidSalesmanDeptId},</if>
<if test="bidSalesmanDeptName != null">#{bidSalesmanDeptName},</if>
<if test="bidHasRegistration != null">#{bidHasRegistration},</if>
<if test="bidRegistrationNumber != null">#{bidRegistrationNumber},</if>
<if test="bidOpeningDate != null">#{bidOpeningDate},</if>
<if test="bidOnlineQuotation != null">#{bidOnlineQuotation},</if>
<if test="bidWebsite != null">#{bidWebsite},</if>
<if test="bidTenderingUnitBm != null">#{bidTenderingUnitBm},</if>
<if test="bidTenderingUnit != null">#{bidTenderingUnit},</if>
<if test="bidAgency != null">#{bidAgency},</if>
<if test="bidProject != null">#{bidProject},</if>
<if test="bidAuthorizedRepresentative != null">#{bidAuthorizedRepresentative},</if>
<if test="bidAuthorizedPhone != null">#{bidAuthorizedPhone},</if>
<if test="bidFilePaymentMethod != null">#{bidFilePaymentMethod},</if>
<if test="bidPaymentDeviation != null">#{bidPaymentDeviation},</if>
<if test="bidCopperPriceLinkage != null">#{bidCopperPriceLinkage},</if>
<if test="bidPriceLinkageMethod != null">#{bidPriceLinkageMethod},</if>
<if test="bidOtherRequire != null">#{bidOtherRequire},</if>
<if test="bidWinningAmount != null">#{bidWinningAmount},</if>
<if test="bidCopperCableAmount != null">#{bidCopperCableAmount},</if>
<if test="bidAluminumCableAmount != null">#{bidAluminumCableAmount},</if>
<if test="bidOpenClose != null">#{bidOpenClose},</if>
<if test="bidPriceAdjustmentNotice != null">#{bidPriceAdjustmentNotice},</if>
<if test="bidValidityPeriod != null">#{bidValidityPeriod},</if>
<if test="bidTongPrice != null">#{bidTongPrice},</if>
<if test="bidLvPrice != null">#{bidLvPrice},</if>
<if test="bidDs != null">#{bidDs},</if>
<if test="bidFactoryPrice != null">#{bidFactoryPrice},</if>
<if test="bidPrice != null">#{bidPrice},</if>
<if test="bidBusinessSettlement != null">#{bidBusinessSettlement},</if>
<if test="bidBond != null">#{bidBond},</if>
<if test="bidWinningServiceFee != null">#{bidWinningServiceFee},</if>
<if test="bidPerformanceBond != null">#{bidPerformanceBond},</if>
<if test="bidDeliveryDate != null">#{bidDeliveryDate},</if>
<if test="bidWarrantyPeriod != null">#{bidWarrantyPeriod},</if>
<if test="bidBidding != null">#{bidBidding},</if>
<if test="bidEvaluationMethod != null">#{bidEvaluationMethod},</if>
<if test="bidTechnicalRequire != null">#{bidTechnicalRequire},</if>
<if test="bidPriceLinkage != null">#{bidPriceLinkage},</if>
<if test="bidPaymentMethod != null">#{bidPaymentMethod},</if>
<if test="bidOtherMatters != null">#{bidOtherMatters},</if>
<if test="bidZbr != null">#{bidZbr},</if>
<if test="bidJdr != null">#{bidJdr},</if>
<if test="bidShr != null">#{bidShr},</if>
<if test="bidConfirmStatus != null">#{bidConfirmStatus},</if>
<if test="bidApprovalStatus != null">#{bidApprovalStatus},</if>
<if test="bidOaApprovalStatus != null">#{bidOaApprovalStatus},</if>
<if test="bidNotificationAward != null">#{bidNotificationAward},</if>
<if test="bidRemark != null">#{bidRemark},</if>
<if test="bidReturnRemark != null">#{bidReturnRemark},</if>
<if test="bidStatus != null">#{bidStatus},</if>
<if test="bidVicePresidentApproved != null">#{bidVicePresidentApproved},</if>
<if test="bidMatpriceDiff != null">#{bidMatpriceDiff},</if>
<if test="bidOaRemark != null">#{bidOaRemark},</if>
<if test="bidOaIsTp != null">#{bidOaIsTp},</if>
<if test="bidJsxzConfirmId != null">#{bidJsxzConfirmId},</if>
<if test="bidHjId != null">#{bidHjId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<insert id="insertSysOABid" parameterType="SysOaBid">
insert into sys_oa_bid
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="departmentId != null">department_id,</if>
<if test="submissionTime != null">submission_time,</if>
<if test="bidId != null">bid_id,</if>
<if test="bidCode != null">bid_code,</if>
<if test="bidSalesmanName != null">bid_salesman_name,</if>
<if test="bidHasRegistration != null">bid_has_registration,</if>
<if test="bidRegistrationNumber != null">bid_registration_number,</if>
<if test="bidOpeningDate != null">bid_opening_date,</if>
<if test="bidOnlineQuotation != null">bid_online_quotation,</if>
<if test="bidWebsite != null">bid_website,</if>
<if test="bidTenderingUnit != null">bid_tendering_unit,</if>
<if test="bidAgency != null">bid_agency,</if>
<if test="bidProject != null">bid_project,</if>
<if test="bidAuthorizedRepresentative != null">bid_authorized_representative,</if>
<if test="bidAuthorizedPhone != null">bid_authorized_phone,</if>
<if test="bidFilePaymentMethod != null">bid_file_payment_method,</if>
<if test="bidPaymentDeviation != null">bid_payment_deviation,</if>
<if test="bidCopperPriceLinkage != null">bid_copper_price_linkage,</if>
<if test="bidPriceLinkageMethod != null">bid_price_linkage_method,</if>
<if test="bidOtherRequire != null">bid_other_require,</if>
<if test="bidRemark != null">bid_remark,</if>
<if test="bidYwyFile != null">bid_ywy_file,</if>
<if test="createTime != null">create_time,</if>
<if test="isFinish != null">isFinish,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="departmentId != null">#{departmentId},</if>
<if test="submissionTime != null and submissionTime != ''">#{submissionTime},</if>
<if test="bidId != null">#{bidId},</if>
<if test="bidCode != null and bidCode != ''">#{bidCode},</if>
<if test="bidSalesmanName != null">#{bidSalesmanName},</if>
<if test="bidHasRegistration != null">#{bidHasRegistration},</if>
<if test="bidRegistrationNumber != null">#{bidRegistrationNumber},</if>
<if test="bidOpeningDate != null">#{bidOpeningDate},</if>
<if test="bidOnlineQuotation != null">#{bidOnlineQuotation},</if>
<if test="bidWebsite != null">#{bidWebsite},</if>
<if test="bidTenderingUnit != null">#{bidTenderingUnit},</if>
<if test="bidAgency != null">#{bidAgency},</if>
<if test="bidProject != null">#{bidProject},</if>
<if test="bidAuthorizedRepresentative != null">#{bidAuthorizedRepresentative},</if>
<if test="bidAuthorizedPhone != null">#{bidAuthorizedPhone},</if>
<if test="bidFilePaymentMethod != null">#{bidFilePaymentMethod},</if>
<if test="bidPaymentDeviation != null">#{bidPaymentDeviation},</if>
<if test="bidCopperPriceLinkage != null">#{bidCopperPriceLinkage},</if>
<if test="bidPriceLinkageMethod != null">#{bidPriceLinkageMethod},</if>
<if test="bidOtherRequire != null">#{bidOtherRequire},</if>
<if test="bidRemark != null">#{bidRemark},</if>
<if test="bidYwyFile != null">#{bidYwyFile},</if>
<if test="createTime != null">#{createTime},</if>
<if test="isFinish != null">#{isFinish},</if>
</trim>
</insert>
<insert id="insertSysOABidTb" parameterType="SysOaBid">
insert into sys_oa_bid_tb
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="departmentId != null">department_id,</if>
<if test="submissionTime != null">submission_time,</if>
<if test="bidId != null">bid_id,</if>
<if test="bidCode != null">bid_code,</if>
<if test="bidNumber != null">bid_number,</if>
<if test="bidSalesmanName != null">bid_salesman_name,</if>
<if test="bidTenderingUnit != null">bid_tendering_unit,</if>
<if test="bidAgency != null">bid_agency,</if>
<if test="bidProject != null">bid_project,</if>
<if test="bidAuthorizedRepresentative != null">bid_authorized_representative,</if>
<if test="bidOpenClose != null">bid_open_close,</if>
<if test="bidValidityPeriod != null">bid_validity_period,</if>
<if test="bidBusinessSettlement != null">bid_business_settlement,</if>
<if test="bidPriceAdjustmentNotice != null">bid_price_adjustment_notice,</if>
<if test="bidTongPrice != null">bid_tong_price,</if>
<if test="bidLvPrice != null">bid_lv_price,</if>
<if test="bidFactoryPrice != null">bid_factory_price,</if>
<if test="bidPrice != null">bid_price,</if>
<if test="bidDs != null">bid_ds,</if>
<if test="bidBond != null">bid_bond,</if>
<if test="bidWinningServiceFee != null">bid_winning_service_fee,</if>
<if test="bidPerformanceBond != null">bid_performance_bond,</if>
<if test="bidDeliveryDate != null">bid_delivery_date,</if>
<if test="bidWarrantyPeriod != null">bid_warranty_period,</if>
<if test="bidBidding != null">bid_bidding,</if>
<if test="bidEvaluationMethod != null">bid_evaluation_method,</if>
<if test="bidTechnicalRequire != null">bid_technical_require,</if>
<if test="bidPriceLinkage != null">bid_price_linkage,</if>
<if test="bidPaymentMethod != null">bid_payment_method,</if>
<if test="bidOtherMatters != null">bid_other_matters,</if>
<if test="bidZbr != null">bid_zbr,</if>
<if test="bidMatpriceDiff != null">bid_matprice_diff,</if>
<if test="bidOaIsTp != null">bid_oa_isTp,</if>
<if test="createTime != null">create_time,</if>
<if test="isFinish != null">isFinish,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="departmentId != null">#{departmentId},</if>
<if test="submissionTime != null">#{submissionTime},</if>
<if test="bidId != null">#{bidId},</if>
<if test="bidCode != null">#{bidCode},</if>
<if test="bidNumber != null">#{bidNumber},</if>
<if test="bidSalesmanName != null">#{bidSalesmanName},</if>
<if test="bidTenderingUnit != null">#{bidTenderingUnit},</if>
<if test="bidAgency != null">#{bidAgency},</if>
<if test="bidProject != null">#{bidProject},</if>
<if test="bidAuthorizedRepresentative != null">#{bidAuthorizedRepresentative},</if>
<if test="bidOpenClose != null">#{bidOpenClose},</if>
<if test="bidValidityPeriod != null">#{bidValidityPeriod},</if>
<if test="bidBusinessSettlement != null">#{bidBusinessSettlement},</if>
<if test="bidPriceAdjustmentNotice != null">#{bidPriceAdjustmentNotice},</if>
<if test="bidTongPrice != null">#{bidTongPrice},</if>
<if test="bidLvPrice != null">#{bidLvPrice},</if>
<if test="bidFactoryPrice != null">#{bidFactoryPrice},</if>
<if test="bidPrice != null">#{bidPrice},</if>
<if test="bidDs != null">#{bidDs},</if>
<if test="bidBond != null">#{bidBond},</if>
<if test="bidWinningServiceFee != null">#{bidWinningServiceFee},</if>
<if test="bidPerformanceBond != null">#{bidPerformanceBond},</if>
<if test="bidDeliveryDate != null">#{bidDeliveryDate},</if>
<if test="bidWarrantyPeriod != null">#{bidWarrantyPeriod},</if>
<if test="bidBidding != null">#{bidBidding},</if>
<if test="bidEvaluationMethod != null">#{bidEvaluationMethod},</if>
<if test="bidTechnicalRequire != null">#{bidTechnicalRequire},</if>
<if test="bidPriceLinkage != null">#{bidPriceLinkage},</if>
<if test="bidPaymentMethod != null">#{bidPaymentMethod},</if>
<if test="bidOtherMatters != null">#{bidOtherMatters},</if>
<if test="bidZbr != null">#{bidZbr},</if>
<if test="bidMatpriceDiff != null">#{bidMatpriceDiff},</if>
<if test="bidOaIsTp != null">#{bidOaIsTp},</if>
<if test="createTime != null">#{createTime},</if>
<if test="isFinish != null">#{isFinish},</if>
</trim>
</insert>
<select id="selectBidTbHistorys" parameterType="String" resultType="BidTbHistory">
SELECT bid_open_close bidOpenClose,bid_price_adjustment_notice bidPriceAdjustmentNotice,bid_tong_price bidTongPrice,
bid_lv_price bidLvPrice,bid_matprice_diff bidMatpriceDiff,
bid_factory_price bidFactoryPrice,bid_price bidPrice,bid_ds bidDs,bid_business_settlement bidBusinessSettlement,
bid_payment_method bidPaymentMethod,bid_price_linkage bidPriceLinkage,
bid_technical_require bidTechnicalRequire,create_time createTime
FROM bid_history where 1=1 and bid_id = #{bidId} order by create_time desc
</select>
<insert id="insertSysOABidTbHistory" parameterType="SysOaBidTbHistory">
insert into sys_oa_bid_tb_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="bidHisId != null">bid_his_id,</if>
<if test="sysOaBidId != null">sys_oa_bid_id,</if>
<if test="bidOpenClose != null">bid_open_close,</if>
<if test="bidPriceAdjustmentNotice != null">bid_price_adjustment_notice,</if>
<if test="bidTongPrice != null">bid_tong_price,</if>
<if test="bidLvPrice != null">bid_lv_price,</if>
<if test="bidMatpriceDiff != null">bid_matprice_diff,</if>
<if test="bidFactoryPrice != null">bid_factory_price,</if>
<if test="bidPrice != null">bid_price,</if>
<if test="bidDs != null">bid_ds,</if>
<if test="bidBusinessSettlement != null">bid_business_settlement,</if>
<if test="bidPaymentMethod != null">bid_payment_method,</if>
<if test="bidPriceLinkage != null">bid_price_linkage,</if>
<if test="bidTechnicalRequire != null">bid_technical_require,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="bidHisId != null">#{bidHisId},</if>
<if test="sysOaBidId != null">#{sysOaBidId},</if>
<if test="bidOpenClose != null">#{bidOpenClose},</if>
<if test="bidPriceAdjustmentNotice != null">#{bidPriceAdjustmentNotice},</if>
<if test="bidTongPrice != null">#{bidTongPrice},</if>
<if test="bidLvPrice != null">#{bidLvPrice},</if>
<if test="bidMatpriceDiff != null">#{bidMatpriceDiff},</if>
<if test="bidFactoryPrice != null">#{bidFactoryPrice},</if>
<if test="bidPrice != null">#{bidPrice},</if>
<if test="bidDs != null">#{bidDs},</if>
<if test="bidBusinessSettlement != null">#{bidBusinessSettlement},</if>
<if test="bidPaymentMethod != null">#{bidPaymentMethod},</if>
<if test="bidPriceLinkage != null">#{bidPriceLinkage},</if>
<if test="bidTechnicalRequire != null">#{bidTechnicalRequire},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<insert id="insertBidTbHistory" parameterType="BidTbHistory">
insert into bid_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="bidHisId != null">bid_his_id,</if>
<if test="bidId != null">bid_id,</if>
<if test="bidOpenClose != null">bid_open_close,</if>
<if test="bidPriceAdjustmentNotice != null">bid_price_adjustment_notice,</if>
<if test="bidTongPrice != null">bid_tong_price,</if>
<if test="bidLvPrice != null">bid_lv_price,</if>
<if test="bidMatpriceDiff != null">bid_matprice_diff,</if>
<if test="bidFactoryPrice != null">bid_factory_price,</if>
<if test="bidPrice != null">bid_price,</if>
<if test="bidDs != null">bid_ds,</if>
<if test="bidBusinessSettlement != null">bid_business_settlement,</if>
<if test="bidPaymentMethod != null">bid_payment_method,</if>
<if test="bidPriceLinkage != null">bid_price_linkage,</if>
<if test="bidTechnicalRequire != null">bid_technical_require,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="bidHisId != null">#{bidHisId},</if>
<if test="bidId != null">#{bidId},</if>
<if test="bidOpenClose != null">#{bidOpenClose},</if>
<if test="bidPriceAdjustmentNotice != null">#{bidPriceAdjustmentNotice},</if>
<if test="bidTongPrice != null">#{bidTongPrice},</if>
<if test="bidLvPrice != null">#{bidLvPrice},</if>
<if test="bidMatpriceDiff != null">#{bidMatpriceDiff},</if>
<if test="bidFactoryPrice != null">#{bidFactoryPrice},</if>
<if test="bidPrice != null">#{bidPrice},</if>
<if test="bidDs != null">#{bidDs},</if>
<if test="bidBusinessSettlement != null">#{bidBusinessSettlement},</if>
<if test="bidPaymentMethod != null">#{bidPaymentMethod},</if>
<if test="bidPriceLinkage != null">#{bidPriceLinkage},</if>
<if test="bidTechnicalRequire != null">#{bidTechnicalRequire},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateBid" parameterType="Bid">
update bid
<trim prefix="SET" suffixOverrides=",">
<if test="bidCode != null">bid_code = #{bidCode},</if>
<if test="bidNumber != null">bid_number = #{bidNumber},</if>
<if test="bidSalesmanCode != null">bid_salesman_code = #{bidSalesmanCode},</if>
<if test="bidSalesmanBm != null">bid_salesman_bm = #{bidSalesmanBm},</if>
<if test="bidSalesmanName != null">bid_salesman_name = #{bidSalesmanName},</if>
<if test="bidSalesmanDeptId != null">bid_salesman_dept_id = #{bidSalesmanDeptId},</if>
<if test="bidSalesmanDeptName != null">bid_salesman_dept_name = #{bidSalesmanDeptName},</if>
<if test="bidHasRegistration != null">bid_has_registration = #{bidHasRegistration},</if>
<if test="bidRegistrationNumber != null">bid_registration_number = #{bidRegistrationNumber},</if>
<if test="bidOpeningDate != null">bid_opening_date = #{bidOpeningDate},</if>
<if test="bidOnlineQuotation != null">bid_online_quotation = #{bidOnlineQuotation},</if>
<if test="bidWebsite != null">bid_website = #{bidWebsite},</if>
<if test="bidTenderingUnitBm != null">bid_tendering_unit_bm = #{bidTenderingUnitBm},</if>
<if test="bidTenderingUnit != null">bid_tendering_unit = #{bidTenderingUnit},</if>
<if test="bidAgency != null">bid_agency = #{bidAgency},</if>
<if test="bidProject != null">bid_project = #{bidProject},</if>
<if test="bidAuthorizedRepresentative != null">bid_authorized_representative = #{bidAuthorizedRepresentative},</if>
<if test="bidAuthorizedPhone != null">bid_authorized_phone = #{bidAuthorizedPhone},</if>
<if test="bidFilePaymentMethod != null">bid_file_payment_method = #{bidFilePaymentMethod},</if>
<if test="bidPaymentDeviation != null">bid_payment_deviation = #{bidPaymentDeviation},</if>
<if test="bidCopperPriceLinkage != null">bid_copper_price_linkage = #{bidCopperPriceLinkage},</if>
<if test="bidPriceLinkageMethod != null">bid_price_linkage_method = #{bidPriceLinkageMethod},</if>
<if test="bidOtherRequire != null">bid_other_require = #{bidOtherRequire},</if>
<if test="bidWinningAmount != null">bid_winning_amount = #{bidWinningAmount},</if>
<if test="bidCopperCableAmount != null">bid_copper_cable_amount = #{bidCopperCableAmount},</if>
<if test="bidAluminumCableAmount != null">bid_aluminum_cable_amount = #{bidAluminumCableAmount},</if>
<if test="bidOpenClose != null">bid_open_close = #{bidOpenClose},</if>
<if test="bidPriceAdjustmentNotice != null">bid_price_adjustment_notice = #{bidPriceAdjustmentNotice},</if>
<if test="bidValidityPeriod != null">bid_validity_period = #{bidValidityPeriod},</if>
<if test="bidTongPrice != null">bid_tong_price = #{bidTongPrice},</if>
<if test="bidLvPrice != null">bid_lv_price = #{bidLvPrice},</if>
<if test="bidDs != null">bid_ds = #{bidDs},</if>
<if test="bidFactoryPrice != null">bid_factory_price = #{bidFactoryPrice},</if>
<if test="bidPrice != null">bid_price = #{bidPrice},</if>
<if test="bidBusinessSettlement != null">bid_business_settlement = #{bidBusinessSettlement},</if>
<if test="bidBond != null">bid_bond = #{bidBond},</if>
<if test="bidWinningServiceFee != null">bid_winning_service_fee = #{bidWinningServiceFee},</if>
<if test="bidPerformanceBond != null">bid_performance_bond = #{bidPerformanceBond},</if>
<if test="bidDeliveryDate != null">bid_delivery_date = #{bidDeliveryDate},</if>
<if test="bidWarrantyPeriod != null">bid_warranty_period = #{bidWarrantyPeriod},</if>
<if test="bidBidding != null">bid_bidding = #{bidBidding},</if>
<if test="bidEvaluationMethod != null">bid_evaluation_method = #{bidEvaluationMethod},</if>
<if test="bidTechnicalRequire != null">bid_technical_require = #{bidTechnicalRequire},</if>
<if test="bidPriceLinkage != null">bid_price_linkage = #{bidPriceLinkage},</if>
<if test="bidPaymentMethod != null">bid_payment_method = #{bidPaymentMethod},</if>
<if test="bidOtherMatters != null">bid_other_matters = #{bidOtherMatters},</if>
<if test="bidZbr != null">bid_zbr = #{bidZbr},</if>
<if test="bidJdr != null">bid_jdr = #{bidJdr},</if>
<if test="bidShr != null">bid_shr = #{bidShr},</if>
<if test="bidConfirmStatus != null">bid_confirm_status = #{bidConfirmStatus},</if>
<if test="bidApprovalStatus != null">bid_approval_status = #{bidApprovalStatus},</if>
<if test="bidOaApprovalStatus != null">bid_oa_approval_status = #{bidOaApprovalStatus},</if>
<if test="bidNotificationAward != null">bid_notification_award = #{bidNotificationAward},</if>
<if test="bidRemark != null">bid_remark = #{bidRemark},</if>
<if test="bidReturnRemark != null">bid_returnRemark = #{bidReturnRemark},</if>
<if test="bidStatus != null">bid_status = #{bidStatus},</if>
<if test="bidVicePresidentApproved != null">bid_vice_president_approved = #{bidVicePresidentApproved},</if>
<if test="bidOaRemark != null">bid_oa_remark = #{bidOaRemark},</if>
<if test="bidMatpriceDiff != null">bid_matprice_diff = #{bidMatpriceDiff},</if>
<if test="bidOaIsTp != null">bid_oa_isTp = #{bidOaIsTp},</if>
<if test="bidJsxzConfirmId != null">bid_jsxz_confirm_id = #{bidJsxzConfirmId},</if>
<if test="bidHjId != null">bid_hj_id = #{bidHjId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where bid_id = #{bidId}
</update>
<delete id="deleteBidByBidId" parameterType="String">
delete from bid where bid_id = #{bidId}
</delete>
<delete id="deleteBidByBidIds" parameterType="String">
delete from bid where bid_id in
<foreach item="bidId" collection="array" open="(" separator="," close=")">
#{bidId}
</foreach>
</delete>
<select id="getCode" resultType="String" statementType="CALLABLE">
{call GetSerialNo(#{type,mode=IN,jdbcType=VARCHAR})}
</select>
<select id="getCodeTB" resultType="String" statementType="CALLABLE">
{call GetSerialNo_Business(#{type,mode=IN,jdbcType=VARCHAR})}
</select>
<select id="selectOAUserByUserName" resultType="SysOaBid">
select top 1 id as userId,departmentid as departmentId from HrmResource where loginid = #{loginid}
</select>
<select id="selectBidByBidJsqrId" parameterType="String" resultMap="BidResult">
<include refid="selectBidVo"/>
where a.bid_jsxz_confirm_id = #{bidJsqrId}
</select>
<select id="selectBidByBidHjId" parameterType="String" resultMap="BidResult">
<include refid="selectBidVo"/>
where a.bid_hj_id = #{bidHjId}
</select>
<select id="versionList" resultType="RbVersionDateResult">
select uid_0 value,convert(varchar(10),[date_0],23) label
from [rb_productVersion] A
inner join (select max(uid_0) muid from rb_productVersion
where sta_0=1 or sta_0=0 group by date_0 )B on A.uid_0=B.muid
order by sta_0 desc,uid_0 desc
</select>
<select id="rb_price_version" resultType="String">
select top 1 muid from
(
select max(uid_0) muid,date_0 from rb_productVersion
where sta_0=1 or sta_0=0 group by date_0
)a order by date_0 desc
</select>
<select id="getTongLvPrice" resultType="RbTongLvPrice">
select tong_price_0,lv_price_0
from rb_productVersion
where uid_0 = #{rbUid}
</select>
</mapper>