<?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.gx.obe.server.management.supplier.dao.SupplierMapper">
 
      <!-- 通用查询映射结果 -->
      <resultMap id="BaseResultMap" type="com.gx.obe.server.management.supplier.entity.Supplier">
                <id column="SUPPLIER_ID" property="id"/>
                <result column="SUPPLIER_NAME" property="supplierName"/>
                <result column="ORG_CODE" property="orgCode"/>
                <result column="TENDER_ID" property="tenderId"/>
                <result column="LINKER" property="linker"/>
                <result column="ID_CARD" property="idCard"/>
                <result column="ADDRESS" property="address"/>
                <result column="LINKER_TEL" property="linkerTel"/>
                <result column="ZIPCODE" property="zipcode"/>
                <result column="MEMO" property="memo"/>
                <result column="APPLY_URL" property="applyUrl"/>
                <result column="APPLY_TIME" property="applyTime"/>
                <result column="TENDER_TIME" property="tenderTime"/>
                <result column="SIGN_TYPE" property="signType"/>
                <result column="BID_BOND" property="bidBond"/>
                <result column="BID_BOND_TYPE" property="bidBondType"/>
                <result column="TENDER_FEE" property="tenderFee"/>
                <result column="USE_STATUS" property="useStatus"/>
                <result column="SORT_NO" property="sortNo"/>
                <result column="BID_NUMBER" property="bidNumber"/>
                <result column="CREATE_TIME" property="createTime"/>
                <result column="SIGN_PERSON" property="signPerson"/>
                <result column="SIGN_PERSON_TEL" property="signPersonTel"/>
                <result column="BID_FILE_TYPE" property="bidFileType"/>
                <result column="SIGN_PERSON_CARD" property="signPersonCard"/>
                <result column="SIGN_TIME" property="signTime"/>
                <result column="PRICE_SIGN_TIME" property="priceSignTime"/>
                <result column="PRICE_SIGN_PERSON" property="priceSignPerson"/>
                <result column="PRICE_SIGN_PERSON_TEL" property="priceSignPersonTel"/>
                <result column="PRICE_SIGN_PERSON_CARD" property="priceSignPersonCard"/>
                <result column="EMAIL" property="email"/>
                <result column="BID_FILE_DOWNLOAD_TIME" property="bidFileDownloadTime"/>
                <result column="DOWNLOAD_TIME_TENDER_TIME" property="downLoadTimeTenderTime"/>
                <result column="SIGN_FILE" property="signFile"/>
                <result column="SEALED_BID_CODE" property="sealedBidCode"/>
                <result column="MODIFY_TIME" property="modifyTime"/>
                <result column="ORG_ID" property="orgId"/>
                <result column="QUALIFIED_STATUS" property="qualifiedStatus"/>
                <result column="INVITATION_STATUS" property="invitationStatus"/>
                <result column="OPENFILE_SIGNSTATUS" property="openFileSignStatus"/>
                <result column="IS_BASIC_ACCOUNT" property="isBasicAccount"/>
                <result column="BOND_IN_DATE" property="inDate"/>
                <result column="TENDER_IP" property="tenderIP"/>
      </resultMap>
      <!-- 通用查询结果列 -->
      <sql id="Base_Column_List">
        SUPPLIER_NAME,ORG_CODE,TENDER_ID,LINKER,ID_CARD,ADDRESS,LINKER_TEL,ZIPCODE,MEMO,APPLY_URL,APPLY_TIME,TENDER_TIME,SIGN_TYPE,BID_BOND,BID_BOND_TYPE,TENDER_FEE,USE_STATUS,SORT_NO,BID_NUMBER,CREATE_TIME,SIGN_PERSON,SIGN_PERSON_TEL,BID_FILE_TYPE,SIGN_PERSON_CARD,SIGN_TIME,PRICE_SIGN_TIME,PRICE_SIGN_PERSON,PRICE_SIGN_PERSON_TEL,PRICE_SIGN_PERSON_CARD,EMAIL,BID_FILE_DOWNLOAD_TIME,DOWNLOAD_TIME_TENDER_TIME,SIGN_FILE,SEALED_BID_CODE,MODIFY_TIME,ORG_ID, QUALIFIED_STATUS,INVITATION_STATUS,OPENFILE_SIGNSTATUS,IS_BASIC_ACCOUNT,BOND_IN_DATE,TENDER_IP
    </sql>
    
     <!-- parameterType="List" -->
    <select id="getSupplierList"  resultMap="BaseResultMap">
   	 	SELECT
   	 	  S.* 
   	 	FROM OBE_SUPPLIER S 
   	 	WHERE S.TENDER_ID = #{tenderId} 
   	 	AND S.USE_STATUS = #{useStatus} 
   	 	ORDER BY S.SORT_NO, S.TENDER_TIME 
    </select> 
    
    <select id="findSupplierOpeningCount" resultType="Integer">
    	SELECT
			COUNT( 1 ) 
		FROM
			obe_supplier_opening_result 
		WHERE
			tender_id = #{tenderId} 
			AND BID_OPENING_STATUS = 01
    </select>
    
     <!-- 通用LIst更新结果列 -->
      <update id="updateObeSupplierBatchList" parameterType="java.util.List">
        <foreach collection="ObeSupplierList" item="ObeSupplier" index="index" open="" close="" separator=";">
	        UPDATE obe_supplier
		        <set>
		                 <if test="ObeSupplier.supplierName != null">
		                	SUPPLIER_NAME = #{ObeSupplier.supplierName} ,
		           		</if>
		                 <if test="ObeSupplier.orgCode != null">
		                	ORG_CODE = #{ObeSupplier.orgCode },
		           		</if>
		                 <if test="ObeSupplier.tenderId != null">
		                	TENDER_ID = #{ObeSupplier.tenderId} ,
		           		</if>
		                 <if test="ObeSupplier.linker != null">
		                	LINKER = #{ObeSupplier.linker },
		           		</if>
		                 <if test="ObeSupplier.idCard != null">
		                	ID_CARD =#{ ObeSupplier.idCard },
		           		</if>
		                 <if test="ObeSupplier.address != null">
		                	ADDRESS = #{ObeSupplier.address} ,
		           		</if>
		                 <if test="ObeSupplier.linkerTel != null">
		                	LINKER_TEL = #{ObeSupplier.linkerTel },
		           		</if>
		                 <if test="ObeSupplier.zipcode != null">
		                	ZIPCODE =#{ ObeSupplier.zipcode} ,
		           		</if>
		                 <if test="ObeSupplier.memo != null">
		                	MEMO = #{ObeSupplier.memo },
		           		</if>
		                 <if test="ObeSupplier.applyUrl != null">
		                	APPLY_URL =#{ ObeSupplier.applyUrl} ,
		           		</if>
		                 <if test="ObeSupplier.applyTime != null">
		                	APPLY_TIME = #{ObeSupplier.applyTime} ,
		           		</if>
		                 <if test="ObeSupplier.tenderTime != null">
		                	TENDER_TIME = #{ObeSupplier.tenderTime },
		           		</if>
		                 <if test="ObeSupplier.signType != null">
		                	SIGN_TYPE =#{ ObeSupplier.signType },
		           		</if>
		                 <if test="ObeSupplier.bidBond != null">
		                	BID_BOND = #{ObeSupplier.bidBond },
		           		</if>
		                 <if test="ObeSupplier.bidBondType != null">
		                	BID_BOND_TYPE = #{ObeSupplier.bidBondType },
		           		</if>
		                 <if test="ObeSupplier.tenderFee != null">
		                	TENDER_FEE = #{ObeSupplier.tenderFee },
		           		</if>
		                 <if test="ObeSupplier.useStatus != null">
		                	USE_STATUS = #{ObeSupplier.useStatus} ,
		           		</if>
		                 <if test="ObeSupplier.sortNo != null">
		                	SORT_NO = #{ObeSupplier.sortNo} ,
		           		</if>
		                 <if test="ObeSupplier.bidNumber != null">
		                	BID_NUMBER = #{ObeSupplier.bidNumber },
		           		</if>
		                 <if test="ObeSupplier.createTime != null">
		                	CREATE_TIME = #{ObeSupplier.createTime },
		           		</if>
		                 <if test="ObeSupplier.signPerson != null">
		                	SIGN_PERSON = #{ObeSupplier.signPerson },
		           		</if>
		                 <if test="ObeSupplier.signPersonTel != null">
		                	SIGN_PERSON_TEL =#{ ObeSupplier.signPersonTel} ,
		           		</if>
		                 <if test="ObeSupplier.bidFileType != null">
		                	BID_FILE_TYPE =#{ ObeSupplier.bidFileType },
		           		</if>
		                 <if test="ObeSupplier.signPersonCard != null">
		                	SIGN_PERSON_CARD = #{ObeSupplier.signPersonCard} ,
		           		</if>
		                 <if test="ObeSupplier.signTime != null">
		                	SIGN_TIME =#{ ObeSupplier.signTime },
		           		</if>
		                 <if test="ObeSupplier.priceSignTime != null">
		                	PRICE_SIGN_TIME =#{ ObeSupplier.priceSignTime },
		           		</if>
		                 <if test="ObeSupplier.priceSignPerson != null">
		                	PRICE_SIGN_PERSON = #{ObeSupplier.priceSignPerson} ,
		           		</if>
		                 <if test="ObeSupplier.priceSignPersonTel != null">
		                	PRICE_SIGN_PERSON_TEL =#{ ObeSupplier.priceSignPersonTel} ,
		           		</if>
		                 <if test="ObeSupplier.priceSignPersonCard != null">
		                	PRICE_SIGN_PERSON_CARD =#{ ObeSupplier.priceSignPersonCard },
		           		</if>
		                 <if test="ObeSupplier.email != null">
		                	EMAIL = #{ObeSupplier.email },
		           		</if>
		                 <if test="ObeSupplier.bidFileDownloadTime != null">
		                	BID_FILE_DOWNLOAD_TIME =#{ ObeSupplier.bidFileDownloadTime} ,
		           		</if>
		                 <if test="ObeSupplier.downloadTimeTenderTime != null">
		                	DOWNLOAD_TIME_TENDER_TIME = #{ObeSupplier.downloadTimeTenderTime },
		           		</if>
		                 <if test="ObeSupplier.signFile != null">
		                	SIGN_FILE =#{ ObeSupplier.signFile} ,
		           		</if>
		                 <if test="ObeSupplier.sealedBidCode != null">
		                	SEALED_BID_CODE = #{ObeSupplier.sealedBidCode },
		           		</if>
		                 <if test="ObeSupplier.modifyTime != null">
		                	MODIFY_TIME = #{ObeSupplier.modifyTime} ,
		           		</if>
		                 <if test="ObeSupplier.orgId != null">
		                	ORG_ID = #{ObeSupplier.orgId }
		           		</if>
		                 <if test="ObeSupplier.qualifiedStatus != null">
							 QUALIFIED_STATUS = #{ObeSupplier.qualifiedStatus }
		           		</if>
		                 <if test="ObeSupplier.invitationStatus != null">
							 INVITATION_STATUS = #{ObeSupplier.invitationStatus }
		           		</if>
		                 <if test="ObeSupplier.openFileSignStatus != null">
							 OPENFILE_SIGNSTATUS = #{ObeSupplier.openFileSignStatus }
		           		</if>
		                 <if test="ObeSupplier.isBasicAccount != null">
							 IS_BASIC_ACCOUNT = #{ObeSupplier.isBasicAccount }
		           		</if>
		                 <if test="ObeSupplier.inDate != null">
							 BOND_BOND_IN_DATE = #{ObeSupplier.inDate }
		           		</if>
		                 <if test="ObeSupplier.tenderIP != null">
							 TENDER_IP = #{ObeSupplier.tenderIP }
		           		</if>
		        </set>
		        <where>
		                 SUPPLIER_ID = #{ObeSupplier.id}
		        </where>
        </foreach>
    </update>
    
     <insert id="insertByBatch"  parameterType="java.util.List">
	        insert into obe_supplier 
		    (
		        	SUPPLIER_ID, SUPPLIER_NAME, ORG_CODE, TENDER_ID, LINKER, ID_CARD, ADDRESS, LINKER_TEL, ZIPCODE, MEMO, APPLY_URL, APPLY_TIME, TENDER_TIME, SIGN_TYPE, BID_BOND, BID_BOND_TYPE, TENDER_FEE, USE_STATUS, SORT_NO, BID_NUMBER, CREATE_TIME, SIGN_PERSON, SIGN_PERSON_TEL, BID_FILE_TYPE, SIGN_PERSON_CARD, SIGN_TIME, PRICE_SIGN_TIME, PRICE_SIGN_PERSON, PRICE_SIGN_PERSON_TEL, PRICE_SIGN_PERSON_CARD, EMAIL, BID_FILE_DOWNLOAD_TIME, DOWNLOAD_TIME_TENDER_TIME, SIGN_FILE, SEALED_BID_CODE, MODIFY_TIME, ORG_ID, QUALIFIED_STATUS,INVITATION_STATUS,OPENFILE_SIGNSTATUS,IS_BASIC_ACCOUNT,BOND_IN_DATE,TENDER_IP
		    )
	     	values
       		 <foreach collection="ObeSupplierList" item="ObeSupplier" index="index" open="" close="" separator=",">
	            (
		                 	#{ObeSupplier.id},
			                #{ObeSupplier.supplierName} ,
			                #{ObeSupplier.orgCode},
			                 #{ObeSupplier.tenderId},
			                 #{ObeSupplier.linker},
			                 #{ObeSupplier.idCard},
			                #{ObeSupplier.address},
			                #{ObeSupplier.linkerTel},
			                #{ObeSupplier.zipcode} ,
			                #{ObeSupplier.memo},
			                 #{ObeSupplier.applyUrl},
			                 #{ObeSupplier.applyTime},
			                #{ObeSupplier.tenderTime},
			                #{ObeSupplier.signType} ,
			                #{ObeSupplier.bidBond},
			                #{ObeSupplier.bidBondType},
			                 #{ObeSupplier.tenderFee},
			                 #{ObeSupplier.useStatus},
			                #{ObeSupplier.sortNo},
			                #{ObeSupplier.bidNumber} ,
			                 #{ObeSupplier.createTime},
			                 #{ObeSupplier.signPerson},
			                #{ObeSupplier.signPersonTel} ,
			                #{ObeSupplier.bidFileType},
			                 #{ObeSupplier.signPersonCard},
			                 #{ObeSupplier.signTime},
			                 #{ObeSupplier.priceSignTime} ,
			                 #{ObeSupplier.priceSignPerson} ,
			                 #{ObeSupplier.priceSignPersonTel} ,
			                 #{ObeSupplier.priceSignPersonCard} ,
			                 #{ObeSupplier.email},
			                 #{ObeSupplier.bidFileDownloadTime} ,
			                 #{ObeSupplier.downloadTimeTenderTime} ,
			                 #{ObeSupplier.signFile} ,
			                 #{ObeSupplier.sealedBidCode} ,
			                 #{ObeSupplier.modifyTime },
			                 #{ObeSupplier.orgId},
			                 #{ObeSupplier.qualifiedStatus},
			                 #{ObeSupplier.invitationStatus},
			                 #{ObeSupplier.openFileSignStatus},
			                 #{ObeSupplier.isBasicAccount},
			                 #{ObeSupplier.inDate},
			                 #{ObeSupplier.tenderIP}
			    )
	        </foreach>
    	</insert> 
    
    
    <resultMap id="AffectResultMap" type="com.gx.obe.server.management.supplier.entity.Supplier">
                <id column="SUPPLIER_ID" property="id"/>
                <result column="SUPPLIER_NAME" property="supplierName"/>
                <result column="ORG_CODE" property="orgCode"/>
                <result column="TENDER_ID" property="tenderId"/>
                <result column="LINKER" property="linker"/>
                <result column="ID_CARD" property="idCard"/>
                <result column="ADDRESS" property="address"/>
                <result column="LINKER_TEL" property="linkerTel"/>
                <result column="ZIPCODE" property="zipcode"/>
                <result column="MEMO" property="memo"/>
                <result column="APPLY_URL" property="applyUrl"/>
                <result column="APPLY_TIME" property="applyTime"/>
                <result column="TENDER_TIME" property="tenderTime"/>
                <result column="SIGN_TYPE" property="signType"/>
                <result column="BID_BOND" property="bidBond"/>
                <result column="BID_BOND_TYPE" property="bidBondType"/>
                <result column="TENDER_FEE" property="tenderFee"/>
                <result column="USE_STATUS" property="useStatus"/>
                <!-- result column="SORT_NO" property="sortNo"/ -->
                <result column="SUPPLIER_INDEX" property="sortNo"/>
                <result column="BID_NUMBER" property="bidNumber"/>
                <result column="CREATE_TIME" property="createTime"/>
                <result column="SIGN_PERSON" property="signPerson"/>
                <result column="SIGN_PERSON_TEL" property="signPersonTel"/>
                <result column="BID_FILE_TYPE" property="bidFileType"/>
                <result column="SIGN_PERSON_CARD" property="signPersonCard"/>
                <result column="SIGN_TIME" property="signTime"/>
                <result column="PRICE_SIGN_TIME" property="priceSignTime"/>
                <result column="PRICE_SIGN_PERSON" property="priceSignPerson"/>
                <result column="PRICE_SIGN_PERSON_TEL" property="priceSignPersonTel"/>
                <result column="PRICE_SIGN_PERSON_CARD" property="priceSignPersonCard"/>
                <result column="EMAIL" property="email"/>
                <result column="BID_FILE_DOWNLOAD_TIME" property="bidFileDownloadTime"/>
                <result column="DOWNLOAD_TIME_TENDER_TIME" property="downLoadTimeTenderTime"/>
                <result column="SIGN_FILE" property="signFile"/>
                <result column="SEALED_BID_CODE" property="sealedBidCode"/>
                <result column="MODIFY_TIME" property="modifyTime"/>
                <result column="ORG_ID" property="orgId"/>
                <result column="QUALIFIED_STATUS" property="qualifiedStatus"/>
                <result column="INVITATION_STATUS" property="invitationStatus"/>
                <result column="OPENFILE_SIGNSTATUS" property="openFileSignStatus"/>
                <result column="IS_BASIC_ACCOUNT" property="isBasicAccount"/>
                <result column="BOND_IN_DATE" property="inDate"/>
                <result column="TENDER_IP" property="tenderIP"/>
                <association column="supplierOpeningResult" property="supplierOpeningResult" javaType="com.gx.obe.server.management.supplier.entity.SupplierOpeningResult">
                	<id column="OPENING_RESULT_ID" property="id" />
			        <result column="SUPPLIER_ID" property="supplierId" />
			        <result column="TENDER_ID" property="tenderId" />
			        <result column="BID_OPENING_STATUS" property="bidOpeningStatus" />
			        <result column="TECHNOLOGY_BID_STATUS" property="technologyBidStatus" />
			        <result column="BUSINESS_BID_STATUS" property="businessBidStatus" />
			        <result column="PRICE_BID_STATUS" property="priceBidStatus" />
			        <result column="REMOTE_DECRYPT" property="remoteDecrypt" />
			        <result column="BID_OPENING_OPINION" property="bidOpeningOpinion" />
			        <result column="CONFIRM_TIME" property="confirmTime" />
			        <result column="CONFIRM_STATUS" property="confirmStatus" />
			        <result column="PRICE_CONFIRM_TIME" property="priceConfirmTime" />
			        <result column="PRICE_CONFIRM_STATUS" property="priceConfirmStatus" />
			        <result column="CONFIRM_OPINION" property="confirmOpinion" />
			        <result column="REVOKE_STATUS" property="revokeStatus" />
			        <result column="REVOKE_REASON" property="revokeReason" />
			        <result column="BID_OPENING_RECORD" property="bidOpeningRecord" />
			        <result column="BID_PRICE" property="bidPrice" />
			        <result column="CURRENCY_CODE" property="currencyCode" />
			        <result column="CURRENCY_NAME" property="currencyName" />
			        <result column="PRICE_UNIT" property="priceUnit" />
			        <result column="EVALUATION_PRICE" property="evaluationPrice" />
			        <result column="EVALUATION_PRICE_ORIGINAL" property="evaluationPriceOriginal" />
			        <result column="MODIFY_REASON" property="modifyReason" />
			        <result column="BASE_PRICE" property="basePrice" />
			        <result column="DEVIATION_RATE" property="deviationRate" />
			        <result column="BID_OPENING_TIME" property="bidOpeningTime" />
			        <result column="PRICE_BID_OPENING_TIME" property="priceBidOpeningTime" />
			        <result column="PRICE_XML" property="priceXml" />
			        <result column="FINAL_BID_PRICE" property="finalBidPrice"/> 
                </association>
                <association column="supplierEvaluationResult" property="supplierEvaluationResult" javaType="com.gx.obe.server.management.supplier.entity.SupplierEvaluationResult">
                 	<id column="EVALUATION_RESULT_ID" property="id" />
			        <result column="SUPPLIER_ID" property="supplierId" />
			        <result column="TENDER_ID" property="tenderId" />
			        <result column="EVALUATION_OPINION" property="evaluationOpinion" />
			        <result column="BIDDING_REQUEST" property="biddingRequest" />
			        <result column="APPLY_USER_ID" property="applyUserId" />
			        <result column="OPINION_EDITOR" property="opinionEditor" />
			        <result column="EVALUATION_SCORE" property="evaluationScore" />
			        <result column="EVALUATION_FINAL_SCORE" property="evaluationFinalScore" />
			        <result column="ACCESSMENT" property="accessment" />
			        <result column="SORT_NO" property="sortNo" />
			        <result column="WIN_BID_SORT_NO" property="winBidSortNo" />
			        <result column="RECOMMEND" property="recommend" />
			        <result column="CHOICE_TYPE" property="choiceType" />
			        <result column="WIN_BID_RECOMMEND" property="winBidRecommend" />
			        <result column="PRICE_SCORE" property="priceScore" />
			        <result column="PRICE_FINAL_SCORE" property="priceFinalScore" />
                </association>
      </resultMap>
    
    
     <!-- parameterType="List" -->
    <select id="getOpenBidSuccessSupplier"  resultMap="AffectResultMap">
   	 	SELECT
   	 	  S.SUPPLIER_NAME, 
          S.ORG_CODE, 
          S.TENDER_ID, 
          S.LINKER, 
          S.ID_CARD, 
          S.ADDRESS, 
          S.LINKER_TEL, 
          S.ZIPCODE, 
          S.MEMO, 
          S.APPLY_URL, 
          S.APPLY_TIME, 
          S.TENDER_TIME, 
          S.SIGN_TYPE, 
          S.BID_BOND, 
          S.BID_BOND_TYPE, 
          S.TENDER_FEE, 
          S.USE_STATUS, 
          S.SORT_NO AS SUPPLIER_INDEX, 
          S.BID_NUMBER, 
          S.CREATE_TIME, 
          S.SIGN_PERSON, 
          S.SIGN_PERSON_TEL, 
          S.BID_FILE_TYPE, 
          S.SIGN_PERSON_CARD, 
          S.SIGN_TIME, 
          S.PRICE_SIGN_TIME, 
          S.PRICE_SIGN_PERSON, 
          S.PRICE_SIGN_PERSON_TEL, 
          S.PRICE_SIGN_PERSON_CARD, 
          S.EMAIL, 
          S.BID_FILE_DOWNLOAD_TIME, 
          S.DOWNLOAD_TIME_TENDER_TIME, 
          S.SIGN_FILE, 
          S.SEALED_BID_CODE, 
          S.MODIFY_TIME, 
          S.ORG_ID, 
          S.QUALIFIED_STATUS, 
          S.INVITATION_STATUS, 
          S.OPENFILE_SIGNSTATUS, 
          S.TENDER_IP, 
   	  	 R.*
   	  	FROM OBE_SUPPLIER S 
   	  	LEFT JOIN OBE_SUPPLIER_OPENING_RESULT R 
   	  	ON S.TENDER_ID = R.TENDER_ID    
   	  	AND S.SUPPLIER_ID = R.SUPPLIER_ID 
   	  	WHERE S.TENDER_ID = #{tenderId}
   	  	AND S.USE_STATUS = #{useStatus} 
   	  	 AND R.BID_OPENING_STATUS = #{bidOpeningStatus} 
   	  	AND (R.REVOKE_STATUS IS NULL 
   	  	OR R.REVOKE_STATUS = #{revokeStatus})    
   	  	ORDER BY S.SORT_NO, S.TENDER_TIME 
    </select> 
    
    <select id="getSupplierOpenBidList"  resultMap="AffectResultMap">
		SELECT
		  S.SUPPLIER_ID,
		  S.SUPPLIER_NAME,
          S.ORG_CODE, 
          S.TENDER_ID, 
          S.LINKER, 
          S.ID_CARD, 
          S.ADDRESS, 
          S.LINKER_TEL, 
          S.ZIPCODE, 
          S.MEMO, 
          S.APPLY_URL, 
          S.APPLY_TIME, 
          S.TENDER_TIME, 
          S.SIGN_TYPE, 
          S.BID_BOND, 
          S.BID_BOND_TYPE, 
          S.TENDER_FEE, 
          S.USE_STATUS, 
          S.SORT_NO AS SUPPLIER_INDEX, 
          S.BID_NUMBER, 
          S.CREATE_TIME, 
          S.SIGN_PERSON, 
          S.SIGN_PERSON_TEL, 
          S.BID_FILE_TYPE, 
          S.SIGN_PERSON_CARD, 
          S.SIGN_TIME, 
          S.PRICE_SIGN_TIME, 
          S.PRICE_SIGN_PERSON, 
          S.PRICE_SIGN_PERSON_TEL, 
          S.PRICE_SIGN_PERSON_CARD, 
          S.EMAIL, 
          S.BID_FILE_DOWNLOAD_TIME, 
          S.DOWNLOAD_TIME_TENDER_TIME, 
          S.SIGN_FILE, 
          S.SEALED_BID_CODE, 
          S.MODIFY_TIME, 
          S.ORG_ID, 
          S.QUALIFIED_STATUS, 
          S.INVITATION_STATUS, 
          S.OPENFILE_SIGNSTATUS,
          S.TENDER_IP,  
		R.*
		FROM OBE_SUPPLIER S
		LEFT JOIN OBE_SUPPLIER_OPENING_RESULT R
		ON S.TENDER_ID = R.TENDER_ID
		AND S.SUPPLIER_ID = R.SUPPLIER_ID
		WHERE S.TENDER_ID = #{tenderId}
		ORDER BY S.SORT_NO
    </select> 
    
    <!--  修改供应商的投标保证金情况 -->
    <update id="updateSupplierBidBondType">
    	UPDATE OBE_SUPPLIER 
		SET BID_BOND_TYPE = #{bidBondType} 
		WHERE
			SUPPLIER_ID = #{supplierId}
    </update>
    
    <!--  修改供应商的排序 -->
    <update id="sortSupplierBySignTime">
    	 <foreach collection="supplierList" item="supplier" index="index" open="" close="" separator=";">
	        UPDATE obe_supplier
		        <set>
		        	 <if test="supplier.sortNo != null">
		                	SORT_NO = #{supplier.sortNo} ,
		        	 </if>
		        </set>
		        <where>
		                 SUPPLIER_ID = #{supplier.id}
		        </where>
        </foreach>
    </update>
    
    <select id="getAllUnTenderSupplierList"  resultMap="BaseResultMap">
		SELECT
   	 	  S.* 
   	 	FROM OBE_SUPPLIER S 
   	 	WHERE S.TENDER_ID = #{tenderId} 
   	 	AND ISNULL(S.TENDER_TIME)
   	 	ORDER BY S.SORT_NO 
    </select> 
    
    <!-- 验证供应商属性是否唯一 -->
    <select id="isUniqueSupplier"  resultType = "Integer" >
  	  SELECT 
  	    COUNT(SUPPLIER_ID) COUNT 
  	  FROM OBE_SUPPLIER  
  	  	WHERE TENDER_ID = #{tenderId}
  	      AND #{column} = #{columValue}
  	  <if test  = "supplierId != null">
		        AND SUPPLIER_ID != #{supplierId} 
	  </if>
    </select>
    
    <!-- 获得指定评标步骤下的供应商列表 -->
    <select id = "getEvaluationStepSupplierList" resultMap ="BaseResultMap">
		SELECT
		S.*
		FROM obe_supplier S,
		OBE_SUPPLIER_OPENING_RESULT R
		WHERE S.TENDER_ID = #{tenderId}
		AND R.TENDER_ID = #{tenderId}
		AND R.SUPPLIER_ID = S.SUPPLIER_ID
		AND R.REVOKE_STATUS = #{revokeNo}
		AND R.BID_OPENING_STATUS = #{openbidSuccess}
		AND S.SUPPLIER_ID NOT IN
		( SELECT
		SN.SUPPLIER_ID
		FROM OBE_SUPPLIER_EVALUATION_STEP SN
		WHERE SN.TENDER_ID = #{tenderId}
		AND SN.STEP_STATUS = #{completeStaues}
		AND SN.ACCESSMENT = #{unqualified}
		AND SN.STEP_ID IN
		( SELECT
		N.STEP_ID
		FROM OBE_EVALUATION_STEP N
		WHERE N.TENDER_ID = #{tenderId}
	    <![CDATA[ AND N.SORT_NO < #{stepIndex})]]>
		)
		ORDER BY S.SORT_NO, S.TENDER_TIME 
    </select>
    
    <!-- 获取当前报价的供应商 -->
  	<select id = "getPrivceRoundSupplierList" resultMap ="BaseResultMap">
		SELECT
			*
		FROM obe_supplier 
		WHERE SUPPLIER_ID in
		(
			SELECT SUPPLIER_ID FROM
    	    obe_bid_price_round_status
			WHERE PRICE_ROUND_ID = #{roundId}
		)
    </select>
    
    <!-- 获得投标人的开标结果和评标结果 -->
    <select id = "getSupplierOpenbidAndEvaluateResultList" resultMap =  "AffectResultMap">
    	SELECT  
    	 S.SUPPLIER_NAME, 
          S.ORG_CODE, 
          S.TENDER_ID, 
          S.LINKER, 
          S.ID_CARD, 
          S.ADDRESS, 
          S.LINKER_TEL, 
          S.ZIPCODE, 
          S.MEMO, 
          S.APPLY_URL, 
          S.APPLY_TIME, 
          S.TENDER_TIME, 
          S.SIGN_TYPE, 
          S.BID_BOND, 
          S.BID_BOND_TYPE, 
          S.TENDER_FEE, 
          S.USE_STATUS, 
          S.SORT_NO AS SUPPLIER_INDEX, 
          S.BID_NUMBER, 
          S.CREATE_TIME, 
          S.SIGN_PERSON, 
          S.SIGN_PERSON_TEL, 
          S.BID_FILE_TYPE, 
          S.SIGN_PERSON_CARD, 
          S.SIGN_TIME, 
          S.PRICE_SIGN_TIME, 
          S.PRICE_SIGN_PERSON, 
          S.PRICE_SIGN_PERSON_TEL, 
          S.PRICE_SIGN_PERSON_CARD, 
          S.EMAIL, 
          S.BID_FILE_DOWNLOAD_TIME, 
          S.DOWNLOAD_TIME_TENDER_TIME, 
          S.SIGN_FILE, 
          S.SEALED_BID_CODE, 
          S.MODIFY_TIME, 
          S.ORG_ID, 
          S.QUALIFIED_STATUS, 
          S.INVITATION_STATUS, 
          S.OPENFILE_SIGNSTATUS, 
		  S.TENDER_IP,  
    	e.*,   o.* 
    	FROM obe_supplier S 
    	  LEFT JOIN OBE_SUPPLIER_OPENING_RESULT o 
    	    ON o.TENDER_ID = S.TENDER_ID 
    	    AND o.SUPPLIER_ID = S.SUPPLIER_ID 
    	    LEFT JOIN OBE_SUPPLIER_EVALUATION_RESULT e 
    	    ON e.TENDER_ID = S.TENDER_ID 
    	    AND e.SUPPLIER_ID = S.SUPPLIER_ID 
    	    WHERE s.TENDER_ID = #{tenderId} 
    	     AND s.USE_STATUS = #{useStatus}
    	      ORDER BY e.SORT_NO,S.SORT_NO 
    </select>
    
    <!-- 获得投标人的最大序号 -->
    <select id="getMaxSupplierSortNo"   resultType = "Integer" >
    	SELECT 
    	  MAX(t.SORT_NO) SORT_NO 
    	  FROM OBE_SUPPLIER t 
    	   WHERE t.TENDER_ID = #{tenderId}
    </select>
    
    <!--   获得指定步骤评审不通过的投标人 -->
    <select id= "getDisAccessmentSupplier"  resultMap = "BaseResultMap" >
	   	 SELECT   s.* 
	   	 FROM obe_supplier s 
	   	 WHERE s.TENDER_ID = #{tenderId} 
	   	     AND s.SUPPLIER_ID IN(SELECT DISTINCT 
	   	     (t.SUPPLIER_ID) 
	   	     FROM OBE_SUPPLIER_EVALUATION_STEP t 
	   	     WHERE t.TENDER_ID = #{tenderId}
	   	     AND t.ACCESSMENT = #{accessment} 
	   	      <if test="stepId != null">
			                	AND t.STEP_ID = #{stepId} 
			  </if>
			                              ) 
			AND s.USE_STATUS = #{useStatus}
			 ORDER BY S.SORT_NO, S.TENDER_TIME 
    </select>
    
    <!-- 根据项目Id,获得项目下所有分包的投标人集合(去重复) -->
    <select id = "getSupplierListByTenderProject" resultMap = "BaseResultMap">
    	SELECT   s.*, 
    	  COUNT(DISTINCT s.ORG_CODE) 
	    	FROM obe_supplier s 
	    	WHERE s.TENDER_ID = #{tenderParentId} 
	    	OR s.TENDER_ID IN(SELECT 
	    	p.TENDER_ID   
	    	FROM obe_tender_project p 
	    	WHERE p.TENDER_PARENT_ID = #{tenderParentId}) 
	    	AND S.USE_STATUS = #{useStatus}
	    	GROUP BY s.ORG_CODE 
	    	ORDER BY S.SORT_NO, S.TENDER_TIME 
    </select>

     <!-- 模糊查询投标人名称或编码,获得项目下的投标人列表。 -->
    <select id="getSupplierListByName"  resultMap="AffectResultMap">
    	SELECT  
    	 S.SUPPLIER_NAME, 
          S.ORG_CODE, 
          S.TENDER_ID, 
          S.LINKER, 
          S.ID_CARD, 
          S.ADDRESS, 
          S.LINKER_TEL, 
          S.ZIPCODE, 
          S.MEMO, 
          S.APPLY_URL, 
          S.APPLY_TIME, 
          S.TENDER_TIME, 
          S.SIGN_TYPE, 
          S.BID_BOND, 
          S.BID_BOND_TYPE, 
          S.TENDER_FEE, 
          S.USE_STATUS, 
          S.SORT_NO AS SUPPLIER_INDEX, 
          S.BID_NUMBER, 
          S.CREATE_TIME, 
          S.SIGN_PERSON, 
          S.SIGN_PERSON_TEL, 
          S.BID_FILE_TYPE, 
          S.SIGN_PERSON_CARD, 
          S.SIGN_TIME, 
          S.PRICE_SIGN_TIME, 
          S.PRICE_SIGN_PERSON, 
          S.PRICE_SIGN_PERSON_TEL, 
          S.PRICE_SIGN_PERSON_CARD, 
          S.EMAIL, 
          S.BID_FILE_DOWNLOAD_TIME, 
          S.DOWNLOAD_TIME_TENDER_TIME, 
          S.SIGN_FILE, 
          S.SEALED_BID_CODE, 
          S.MODIFY_TIME, 
          S.ORG_ID, 
          S.QUALIFIED_STATUS, 
          S.INVITATION_STATUS, 
          S.OPENFILE_SIGNSTATUS,
		  S.TENDER_IP,   
    	r.* 
    	FROM OBE_SUPPLIER S 
    	  LEFT JOIN OBE_SUPPLIER_OPENING_RESULT r 
    	  ON S.SUPPLIER_ID = r.SUPPLIER_ID 
    	  WHERE S.TENDER_ID = #{tenderId} 
    	  AND S.USE_STATUS = #{useStatus} 
    	   <if test  = "content != null and content != ''">
		         AND (S.SUPPLIER_NAME LIKE '%#{content}%' 
		         OR S.ORG_CODE LIKE '%#{content}%') 
	 	   </if>
	 	   ORDER BY S.SORT_NO; 
    </select>
    
    <!-- getparentSupplierByParentTenderId -->
    <select id = "getparentSupplierByParentTenderId" resultType = "java.util.HashMap" >
    	SELECT ES.SUPPLIER_NAME AS SUPPLIER_NAME, ES.LINKER AS LINKER, ES.LINKER_TEL AS LINKER_TEL, COUNT(ES.SUPPLIER_NAME) AS SUPPLIER_COUNT
    	  FROM (SELECT SUPPLIER_NAME , LINKER, LINKER_TEL 
    	   FROM OBE_SUPPLIER 
    	   WHERE TENDER_ID IN 
    	   (SELECT TENDER_ID 
    	   FROM OBE_TENDER_PROJECT 
    	   WHERE TENDER_PARENT_ID = #{tenderId})) ES 
    	    GROUP BY SUPPLIER_NAME 
    </select>
    
    <!-- 获得报名供应商的个数 -->
    <select id = "getSupplierCount" resultType ="Integer">
   	 SELECT COUNT(T.SUPPLIER_ID) FROM OBE_SUPPLIER T WHERE T.TENDER_ID = #{tenderId} 
    </select>
    
    <!-- 获得未废标且已签到的供应商家数 -->
    <select id = "getSupplierSignCount" resultType ="Integer">
   	 SELECT COUNT(t.SUPPLIER_ID) FROM obe_supplier t LEFT JOIN obe_supplier_opening_result o ON o.SUPPLIER_ID = t.SUPPLIER_ID  WHERE t.TENDER_ID = #{tenderId} AND t.SIGN_TIME IS NOT NULL AND (o.REVOKE_STATUS IS NULL OR o.REVOKE_STATUS != #{revokeStatus})
    </select>
    	
    <!-- 获得推荐的供应商列表 -->
    <select id = "getRecommendSupplierList" resultMap = "BaseResultMap">
   			 SELECT s.*
   			 FROM obe_supplier s, 
   			   OBE_SUPPLIER_OPENING_RESULT r , obe_supplier_evaluation_result oser 
   			 WHERE s.TENDER_ID = #{tenderId} AND r.TENDER_ID = #{tenderId}
   			     AND r.SUPPLIER_ID = s.SUPPLIER_ID AND oser.SUPPLIER_ID = s.SUPPLIER_ID
   			     AND r.REVOKE_STATUS = #{revokeStatus} 
   			     AND r.BID_OPENING_STATUS = #{bidOpeningStatus} 
   			     AND s.SUPPLIER_ID NOT IN(SELECT 
   			     sn.SUPPLIER_ID 
   			     FROM OBE_SUPPLIER_EVALUATION_STEP sn 
   			     WHERE sn.TENDER_ID = #{tenderId}
   			     AND sn.STEP_STATUS = #{stepStatus} 
   			     AND sn.ACCESSMENT = #{unqualified} 
   			     AND sn.STEP_ID IN(SELECT 
   			     	n.STEP_ID 
   			     	FROM OBE_EVALUATION_STEP n 
   			     	WHERE n.TENDER_ID = #{tenderId}
   			     <![CDATA[AND n.SORT_NO < #{sortNo})) ]]>	
   			     ORDER BY oser.SORT_NO, s.TENDER_TIME 
    </select>
    
    <!--获得按项目开标的供应商  -->
    <select id = "getDecryptSupplierList"   resultMap = "AffectResultMap">
    	SELECT DISTINCT 
    	  T.SUPPLIER_NAME, 
    	  T.SUPPLIER_ID, 
    	  T.ORG_CODE,   
    	  T.TENDER_ID, 
    	  T.TENDER_TIME, 
    	  R.*
    	  FROM OBE_SUPPLIER T 
    	  LEFT JOIN OBE_SUPPLIER_OPENING_RESULT R 
    	  ON T.SUPPLIER_ID = R.SUPPLIER_ID 
    	  <choose>
    	   <when test  = "projectId != null and content != ''">
		         WHERE T.TENDER_ID IN(SELECT 
		         TENDER_ID 
		         FROM OBE_TENDER_PROJECT 
		         WHERE TENDER_PARENT_ID = #{projectId}) 
	 	   </when>
	 	   <otherwise>
    	 		WHERE T.TENDER_ID = #{tenderId}
	 	   </otherwise>
	 	  </choose>
    	 ORDER BY T.SORT_NO, T.TENDER_TIME
    </select>
    
    <!-- 通过项目id查找项目下所有包件中资审为通过供应商数量 -->
    <select id = "getComplianceFailSupplierCount" resultMap = "BaseResultMap">
    	SELECT * FROM obe_supplier os LEFT JOIN OBE_SUPPLIER_EVALUATION_RESULT oser ON os.supplier_id = oser.supplier_id LEFT JOIN obe_tender_project otp ON oser.TENDER_ID = otp.TENDER_ID WHERE (otp.tender_id=#{tenderId} OR otp.tender_parent_id =#{tenderId} ) AND  OSER.ACCESSMENT = #{accessment}
    </select>
    
    <!-- 获得整个项目下开标成功的投标人列表 -->
    <select id = "getOpenBidSuccessByParentId"  resultMap = "AffectResultMap">
    	SELECT    
		S.SUPPLIER_NAME, 
          S.ORG_CODE, 
          S.TENDER_ID, 
          S.LINKER, 
          S.ID_CARD, 
          S.ADDRESS, 
          S.LINKER_TEL, 
          S.ZIPCODE, 
          S.MEMO, 
          S.APPLY_URL, 
          S.APPLY_TIME, 
          S.TENDER_TIME, 
          S.SIGN_TYPE, 
          S.BID_BOND, 
          S.BID_BOND_TYPE, 
          S.TENDER_FEE, 
          S.USE_STATUS, 
          S.SORT_NO AS SUPPLIER_INDEX, 
          S.BID_NUMBER, 
          S.CREATE_TIME, 
          S.SIGN_PERSON, 
          S.SIGN_PERSON_TEL, 
          S.BID_FILE_TYPE, 
          S.SIGN_PERSON_CARD, 
          S.SIGN_TIME, 
          S.PRICE_SIGN_TIME, 
          S.PRICE_SIGN_PERSON, 
          S.PRICE_SIGN_PERSON_TEL, 
          S.PRICE_SIGN_PERSON_CARD, 
          S.EMAIL, 
          S.BID_FILE_DOWNLOAD_TIME, 
          S.DOWNLOAD_TIME_TENDER_TIME, 
          S.SIGN_FILE, 
          S.SEALED_BID_CODE, 
          S.MODIFY_TIME, 
          S.ORG_ID, 
          S.QUALIFIED_STATUS, 
          S.INVITATION_STATUS, 
          S.OPENFILE_SIGNSTATUS,
		  S.TENDER_IP,   
   		R.* 
    	FROM OBE_SUPPLIER S 
    	  LEFT JOIN OBE_TENDER_PROJECT P ON P.TENDER_ID = S.TENDER_ID 
    	  LEFT JOIN OBE_SUPPLIER_OPENING_RESULT R 
    	  ON S.TENDER_ID = R.TENDER_ID  
    	        AND S.SUPPLIER_ID = R.SUPPLIER_ID 
    	        WHERE (P.TENDER_ID=#{tenderId} OR P.TENDER_PARENT_ID =#{tenderId} ) 
    	            AND S.USE_STATUS = #{useStatus} 
    	                AND R.BID_OPENING_STATUS = #{bidOpeningStatus} 
    	                    AND (R.REVOKE_STATUS IS NULL 
    	                         OR R.REVOKE_STATUS = #{revokeStatus}) 
    	                         ORDER BY S.SORT_NO  
    </select>
    
    <!-- 获得供应商的开标信息 -->
    <select id= "getSupplierBidOpeningInfoList" resultType = "java.util.HashMap" >
    	SELECT 
		  t.SUPPLIER_ID, 
		  t.ORG_CODE, 
		  t.SUPPLIER_NAME, 
		  t.TENDER_TIME, 
		  t.SIGN_TIME, 
		  t.SIGN_PERSON_TEL, 
		  t.SIGN_PERSON, 
		  t.PRICE_SIGN_TIME, 
		  t.PRICE_SIGN_PERSON, 
		  t.PRICE_SIGN_PERSON_TEL, 
		  r.OPENING_RESULT_ID, 
		  r.BID_OPENING_TIME, 
		  r.PRICE_BID_OPENING_TIME, 
		  r.BUSINESS_BID_STATUS, 
		  r.TECHNOLOGY_BID_STATUS, 
		  r.PRICE_BID_STATUS, 
		  r.CONFIRM_STATUS, 
		  r.PRICE_CONFIRM_STATUS, 
		  r.REVOKE_STATUS, 
		  r.BID_PRICE 
		FROM OBE_SUPPLIER t 
		  LEFT JOIN obe_supplier_opening_result r 
		    ON t.SUPPLIER_ID = r.SUPPLIER_ID 
		WHERE T.TENDER_ID = #{tenderId} 
		 ORDER BY t.SORT_NO
    </select>
    
    <!-- 根据包件id查询该包件下,供应商投标人数 -->
    <select id = "getBidSupplierCount"  resultType = "Integer">
    	SELECT COUNT(1) FROM OBE_SUPPLIER WHERE TENDER_ID = #{tenderId} AND TENDER_TIME IS NOT NULL
    </select>
    
    <!-- 根据包件id查询该包件下,供应商商务技术解密人数 -->
    <select id = "getSupplierBusinessDecryptCount" resultType = "Integer">
    	SELECT count(1) from OBE_SUPPLIER_OPENING_RESULT
    	 <choose>
	    	<when test  = "priceBidStatus ">
	    	  WHERE  PRICE_BID_STATUS = #{openbidSuccess}
	    	</when>
	    	<otherwise>
	    	  WHERE  BUSINESS_BID_STATUS = #{openbidSuccess} AND TECHNOLOGY_BID_STATUS = #{openbidSuccess}
	    	</otherwise>
    	 </choose>
	    	  AND TENDER_ID = #{tenderId}
    </select>
    
     <!-- 验证供应商名称是否唯一-->
    <select id = "isUniqueSupplierByName" resultType = "Integer">
    	SELECT 
    	  COUNT(t.SUPPLIER_ID) COUNT 
    	  FROM OBE_SUPPLIER t 
    	  WHERE t.TENDER_ID = #{tenderId}
    	      AND t.USE_STATUS = 01 
    	          AND t.SUPPLIER_NAME = #{supplierName}
    	          <if test="supplierId != null">
    	          	    AND t.SUPPLIER_ID != #{supplierId} 
    	          </if>
    </select>
    
    <select id="queryToMap" resultType = "java.util.HashMap">
		SELECT m.* , (SELECT COUNT(a.SUPPLIER_ID) FROM obe_supplier a WHERE
		a.TENDER_ID = m.TENDER_ID) AS SUPPLIER_COUNT, B.BID_PRICE ,
		E.ACCESSMENT, e.PRICE_SCORE, e.PRICE_FINAL_SCORE, e.EVALUATION_SCORE,
		e.EVALUATION_FINAL_SCORE, e.SORT_NO FROM (SELECT s.SUPPLIER_ID,
		t.TENDER_ID, t.TENDER_PARENT_ID, t.TENDER_NO, t.TENDER_NAME,
		s.SUPPLIER_NAME FROM obe_tender_project t RIGHT JOIN obe_supplier s ON
		t.TENDER_ID = s.TENDER_ID GROUP BY s.SUPPLIER_NAME , T.TENDER_ID) AS m
		LEFT JOIN obe_supplier_opening_result B ON m.TENDER_ID = B.TENDER_ID
		AND m.SUPPLIER_ID = B.SUPPLIER_ID LEFT JOIN
		obe_supplier_evaluation_result E ON m.TENDER_ID = E.TENDER_ID AND
		m.SUPPLIER_ID = E.SUPPLIER_ID
		 <choose>
	    	<when test  = "hasParent ">
	    	  AND m.TENDER_PARENT_ID = #{tenderId}
	    	</when>
	    	<otherwise>
	    	  AND m.TENDER_ID = #{tenderId}
	    	</otherwise>
    	 </choose>
    </select>
    
    <!-- 指定字段修改 -->
	<update id="updateAssignProperty">
		UPDATE
			obe_supplier
		<set>
			<foreach collection="attributes" item="attribute" index="index" open="" close="" separator=",">
				<if test="attribute == 'supplierName'">
					SUPPLIER_NAME = #{ObeSupplier.supplierName}
				</if>
				<if test="attribute == 'orgCode'">
					ORG_CODE = #{ObeSupplier.orgCode}
				</if>
				<if test="attribute == 'tenderId'">
					TENDER_ID = #{ObeSupplier.tenderId}
				</if>
				<if test="attribute == 'linker'">
					LINKER = #{ObeSupplier.linker}
				</if>
				<if test="attribute == 'idCard'">
					ID_CARD = #{ObeSupplier.idCard}
				</if>
				<if test="attribute == 'address'">
					ADDRESS = #{ObeSupplier.address}
				</if>
				<if test="attribute == 'linkerTel'">
					LINKER_TEL = #{ObeSupplier.linkerTel}
				</if>
				<if test="attribute == 'zipcode'">
					ZIPCODE = #{ObeSupplier.zipcode}
				</if>
				<if test="attribute == 'memo'">
					MEMO = #{ObeSupplier.memo}
				</if>
				<if test="attribute == 'applyUrl'">
					APPLY_URL = #{ObeSupplier.applyUrl}
				</if>
				<if test="attribute == 'applyTime'">
					APPLY_TIME = #{ObeSupplier.applyTime}
				</if>
				<if test="attribute == 'tenderTime'">
					TENDER_TIME = #{ObeSupplier.tenderTime}
				</if>
				<if test="attribute == 'signType'">
					SIGN_TYPE = #{ObeSupplier.signType}
				</if>
				<if test="attribute == 'bidBond'">
					BID_BOND = #{ObeSupplier.bidBond}
				</if>
				<if test="attribute == 'bidBondType'">
					BID_BOND_TYPE = #{ObeSupplier.bidBondType}
				</if>
				<if test="attribute == 'tenderFee'">
					TENDER_FEE = #{ObeSupplier.tenderFee}
				</if>
				<if test="attribute == 'useStatus'">
					USE_STATUS = #{ObeSupplier.useStatus}
				</if>
				<if test="attribute == 'sortNo'">
					SORT_NO = #{ObeSupplier.sortNo}
				</if>
				<if test="attribute == 'bidNumber'">
					BID_NUMBER = #{ObeSupplier.bidNumber}
				</if>
				<if test="attribute == 'createTime'">
					CREATE_TIME = #{ObeSupplier.createTime}
				</if>
				<if test="attribute == 'signPerson'">
					SIGN_PERSON = #{ObeSupplier.signPerson}
				</if>
				<if test="attribute == 'signPersonTel'">
					SIGN_PERSON_TEL = #{ObeSupplier.signPersonTel}
				</if>
				<if test="attribute == 'bidFileType'">
					BID_FILE_TYPE = #{ObeSupplier.bidFileType}
				</if>
				<if test="attribute == 'signPersonCard'">
					SIGN_PERSON_CARD = #{ObeSupplier.signPersonCard}
				</if>
				<if test="attribute == 'signTime'">
					SIGN_TIME = #{ObeSupplier.signTime}
				</if>
				<if test="attribute == 'priceSignTime'">
					PRICE_SIGN_TIME = #{ObeSupplier.priceSignTime}
				</if>
				<if test="attribute == 'priceSignPerson'">
					PRICE_SIGN_PERSON = #{ObeSupplier.priceSignPerson}
				</if>
				<if test="attribute == 'priceSignPersonTel'">
					PRICE_SIGN_PERSON_TEL = #{ObeSupplier.priceSignPersonTel}
				</if>
				<if test="attribute == 'priceSignPersonCard'">
					PRICE_SIGN_PERSON_CARD = #{ObeSupplier.priceSignPersonCard}
				</if>
				<if test="attribute == 'email'">
					EMAIL = #{ObeSupplier.email}
				</if>
				<if test="attribute == 'bidFileDownloadTime'">
					BID_FILE_DOWNLOAD_TIME = #{ObeSupplier.bidFileDownloadTime}
				</if>
				<if test="attribute == 'downloadTimeTenderTime'">
					DOWNLOAD_TIME_TENDER_TIME = #{ObeSupplier.downloadTimeTenderTime}
				</if>
				<if test="attribute == 'signFile'">
					SIGN_FILE = #{ObeSupplier.signFile}
				</if>
				<if test="attribute == 'sealedBidCode'">
					SEALED_BID_CODE = #{ObeSupplier.sealedBidCode}
				</if>
				<if test="attribute == 'modifyTime'">
					MODIFY_TIME = #{ObeSupplier.modifyTime}
				</if>
				<if test="attribute == 'orgId'">
					ORG_ID = #{ObeSupplier.orgId}
				</if>
				<if test="attribute == 'qualifiedStatus'">
					QUALIFIED_STATUS = #{ObeSupplier.qualifiedStatus}
				</if>
				<if test="attribute == 'invitationStatus'">
					INVITATION_STATUS = #{ObeSupplier.invitationStatus}
				</if>
				<if test="attribute == 'openFileSignStatus'">
					OPENFILE_SIGNSTATUS = #{ObeSupplier.openFileSignStatus}
				</if>
				 <if test="attribute == 'isBasicAccount'">
					IS_BASIC_ACCOUNT = #{ObeSupplier.isBasicAccount}
		        </if>
		         <if test="attribute == 'inDate'">
					 BOND_IN_DATE = #{ObeSupplier.inDate}
		        </if>
		          <if test="attribute == 'tenderIP'">
					 TENDER_IP = #{ObeSupplier.tenderIP}
		        </if>
			</foreach>
		</set>
		<where>
			SUPPLIER_ID = #{ObeSupplier.id}
		</where>
	</update>
	
	<!-- 批量指定字段修改 -->
	<update id="batchUpdateProperty">
		UPDATE
			obe_supplier
		<set>
			<foreach collection="attributes" item="attribute" index="index" open="" close="" separator=",">
				<if test="attribute == 'supplierName'">
					SUPPLIER_NAME = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.supplierName}
        			</foreach>
				</if>
				<if test="attribute == 'orgCode'">
					ORG_CODE = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.orgCode}
        			</foreach>
				</if>
				<if test="attribute == 'tenderId'">
					TENDER_ID = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.tenderId}
        			</foreach>
				</if>
				<if test="attribute == 'linker'">
					LINKER = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.linker}
        			</foreach>
				</if>
				<if test="attribute == 'idCard'">
					ID_CARD = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.idCard}
        			</foreach>
				</if>
				<if test="attribute == 'address'">
					ADDRESS = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.address}
        			</foreach>
				</if>
				<if test="attribute == 'linkerTel'">
					LINKER_TEL = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.linkerTel}
        			</foreach>
				</if>
				<if test="attribute == 'zipcode'">
					ZIPCODE = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.zipcode}
        			</foreach>
				</if>
				<if test="attribute == 'memo'">
					MEMO = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.memo}
        			</foreach>
				</if>
				<if test="attribute == 'applyUrl'">
					APPLY_URL = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.applyUrl}
        			</foreach>
				</if>
				<if test="attribute == 'applyTime'">
					APPLY_TIME = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.applyTime}
        			</foreach>
				</if>
				<if test="attribute == 'tenderTime'">
					TENDER_TIME = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.tenderTime}
        			</foreach>
				</if>
				<if test="attribute == 'signType'">
					SIGN_TYPE = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.signType}
        			</foreach>
				</if>
				<if test="attribute == 'bidBond'">
					BID_BOND = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.bidBond}
        			</foreach>
				</if>
				<if test="attribute == 'bidBondType'">
					BID_BOND_TYPE = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.bidBondType}
        			</foreach>
				</if>
				<if test="attribute == 'tenderFee'">
					TENDER_FEE = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.tenderFee}
        			</foreach>
				</if>
				<if test="attribute == 'useStatus'">
					USE_STATUS = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.useStatus}
        			</foreach>
				</if>
				<if test="attribute == 'sortNo'">
					SORT_NO = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.sortNo}
        			</foreach>
				</if>
				<if test="attribute == 'bidNumber'">
					BID_NUMBER = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.bidNumber}
        			</foreach>
				</if>
				<if test="attribute == 'createTime'">
					CREATE_TIME = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.createTime}
        			</foreach>
				</if>
				<if test="attribute == 'signPerson'">
					SIGN_PERSON = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.signPerson}
        			</foreach>
				</if>
				<if test="attribute == 'signPersonTel'">
					SIGN_PERSON_TEL = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.signPersonTel}
        			</foreach>
				</if>
				<if test="attribute == 'bidFileType'">
					BID_FILE_TYPE = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.bidFileType}
        			</foreach>
				</if>
				<if test="attribute == 'signPersonCard'">
					SIGN_PERSON_CARD = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.signPersonCard}
        			</foreach>
				</if>
				<if test="attribute == 'signTime'">
					SIGN_TIME = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.signTime}
        			</foreach>
				</if>
				<if test="attribute == 'priceSignTime'">
					PRICE_SIGN_TIME = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.priceSignTime}
        			</foreach>
				</if>
				<if test="attribute == 'priceSignPerson'">
					PRICE_SIGN_PERSON = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.priceSignPerson}
        			</foreach>
				</if>
				<if test="attribute == 'priceSignPersonTel'">
					PRICE_SIGN_PERSON_TEL = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.priceSignPersonTel}
        			</foreach>
				</if>
				<if test="attribute == 'priceSignPersonCard'">
					PRICE_SIGN_PERSON_CARD = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.priceSignPersonCard}
        			</foreach>
				</if>
				<if test="attribute == 'email'">
					EMAIL = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.email}
        			</foreach>
				</if>
				<if test="attribute == 'bidFileDownloadTime'">
					BID_FILE_DOWNLOAD_TIME = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.bidFileDownloadTime}
        			</foreach>
				</if>
				<if test="attribute == 'downloadTimeTenderTime'">
					DOWNLOAD_TIME_TENDER_TIME = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.downloadTimeTenderTime}
        			</foreach>
				</if>
				<if test="attribute == 'signFile'">
					SIGN_FILE = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.signFile}
        			</foreach>
				</if>
				<if test="attribute == 'sealedBidCode'">
					SEALED_BID_CODE = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.sealedBidCode}
        			</foreach>
				</if>
				<if test="attribute == 'modifyTime'">
					MODIFY_TIME = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.modifyTime}
        			</foreach>
				</if>
				<if test="attribute == 'orgId'">
					ORG_ID = 
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.orgId}
        			</foreach>
				</if>
				<if test="attribute == 'qualifiedStatus'">
					QUALIFIED_STATUS =
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.qualifiedStatus}
        			</foreach>
				</if>
				<if test="attribute == 'invitationStatus'">
					INVITATION_STATUS =
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.invitationStatus}
        			</foreach>
				</if>
				<if test="attribute == 'openFileSignStatus'">
					OPENFILE_SIGNSTATUS =
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.openFileSignStatus}
        			</foreach>
				</if>
				<if test="attribute == 'isBasicAccount'">
					IS_BASIC_ACCOUNT =
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.isBasicAccount}
        			</foreach>
				</if>
				<if test="attribute == 'inDate'">
					BOND_IN_DATE =
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.inDate}
        			</foreach>
				</if>
				<if test="attribute == 'tenderIP'">
					TENDER_IP =
					<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator=" " open="case SUPPLIER_ID" close="end">
            			when #{ObeSupplier.id} then #{ObeSupplier.tenderIP}
        			</foreach>
				</if>
			</foreach>
		</set>
		<where>
			SUPPLIER_ID IN
			<foreach collection="ObeSupplierList" item="ObeSupplier" index="index" separator="," open="(" close=")">
            	#{ObeSupplier.id}
        	</foreach>
		</where>
	</update>
	
	  <!-- 删除指定供应商 -->
    <delete id="removeSupplier">
    	DELETE FROM OBE_SUPPLIER WHERE SUPPLIER_ID= #{supplierId}
    </delete>
    
</mapper>