spring springmvc mybatis 整合批量操作,批量更新,批量插入

1.批量插入

 
        INSERT INTO CISHAN_SUBSIDY_ACCOUNT_RECHARGE_MONTH(BATCH_NO,ACCOUNT_ID,USER_ID,
        NAME,IDNO,MOBILE,MONTH_AMOUNT,CISHAN_CHANNEL_ID,CISHAN_ORG_PROVINCE,CISHAN_ORG_CITY,
        CISHAN_ORG_COUNTY,CREATE_TIME,UPDATE_TIME)
        VALUES
       
        (#{item.batchNo,jdbcType=INTEGER},#{item.accountId,jdbcType=BIGINT},
        #{item.userId,jdbcType=BIGINT},#{item.name,jdbcType=VARCHAR},#{item.idNo,jdbcType=INTEGER},#{item.mobile,jdbcType=VARCHAR},
        #{item.monthAmount,jdbcType=DECIMAL},#{item.channelId,jdbcType=BIGINT},
        #{item.provinceId,jdbcType=BIGINT},#{item.cityId,jdbcType=BIGINT},#{item.countyId,jdbcType=BIGINT},
        #{item.createTime,jdbcType=TIMESTAMP},#{item.updateTime,jdbcType=TIMESTAMP})
       
  



2.批量更新


   
		UPDATE CISHAN_SUBSIDY_ACCOUNT_RECHARGE_MONTH 
		
		  STATUS = #{item.status,jdbcType=VARCHAR},MESSAGE = #{item.message,jdbcType=VARCHAR},
		  BIZ_TRANSACTION_ID = #{item.bizTransactionId,jdbcType=INTEGER},UPDATE_TIME = #{item.updateTime,jdbcType=TIMESTAMP}
		
		WHERE ID = #{item.id}
	
		 
  


你可能感兴趣的:(springmvc,JAVA,mybatis)