insertSql語句中的trim標簽的使用


insert into MB_BATCH_DIS_DETAILS
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="batchNo != null">
        BATCH_NO,
      </if>
      <if test="seqNo != null">
        SEQ_NO,
      </if>
      <if test="contractNo != null">
        CONTRACT_NO,
      </if>
      <if test="prodType != null">
        PROD_TYPE,
      </if>
      <if test="discSubType != null">
        DISC_SUB_TYPE,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="batchNo != null">
        #{batchNo,jdbcType=VARCHAR},
      </if>
      <if test="seqNo != null">
        #{seqNo,jdbcType=VARCHAR},
      </if>
      <if test="contractNo != null">
        #{contractNo,jdbcType=VARCHAR},
      </if>
      <if test="prodType != null">
        #{prodType,jdbcType=VARCHAR},
      </if>
      <if test="discSubType != null">
        #{discSubType,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM