arextest / arex-agent-java

Lightweight Java agent for traffic capture and replay, enhancing testing and debugging.
https://doc.arextest.com/
Apache License 2.0
459 stars 94 forks source link

[Bug] mybatis insert 之后id主键自增 插入mock之后没有给id赋值 #573

Open scjakehuang opened 1 month ago

scjakehuang commented 1 month ago

Search before asking

AREX Test Service

AREX Java Agent (arextest/arex-agent-java)

Current Behavior

insert into order_item ( snapshot_id, order_no, buy_count, shop_name, spu_id, sku_id, sku_type, refund_able, auto_approve, item_title, item_description, unit_price, cost_price, item_img_url, item_url, sign_key, project_code, pay_time_limit,product_type,phone_num,created_on, created_by, updated_on, updated_by, item_belong_user_id, item_discount_amount,item_member_discount_amount, item_freight_amount, item_electronic_card_amount, pre_sale, pre_sale_date, item_balance_amount, unit_points, sku_barCode, supplier_id, supplier_name, stock_date,wx_shop_product_id,wx_shop_sku_id,platform_id,platform_supplier_price, item_use_integral, item_integral_deduct_amount, business_goods_id, commission_snapshot, ori_unit_price, ticket_distributor_id, ticket_distributor_name, crossed_price ) values (#{item.snapshotId,jdbcType=VARCHAR}, #{item.orderNo,jdbcType=VARCHAR}, #{item.buyCount,jdbcType=INTEGER}, #{item.shopName,jdbcType=VARCHAR}, #{item.spuId,jdbcType=VARCHAR}, #{item.skuId,jdbcType=VARCHAR}, #{item.skuType,jdbcType=VARCHAR}, #{item.refundAble,jdbcType=VARCHAR}, #{item.autoApprove,jdbcType=INTEGER}, #{item.itemTitle,jdbcType=VARCHAR}, #{item.itemDescription,jdbcType=VARCHAR}, #{item.unitPrice,jdbcType=DECIMAL},#{item.costPrice,jdbcType=DECIMAL}, #{item.itemImgUrl,jdbcType=VARCHAR}, #{item.itemUrl,jdbcType=VARCHAR}, #{item.signKey,jdbcType=VARCHAR}, #{item.projectCode,jdbcType=VARCHAR}, #{item.payTimeLimit,jdbcType=INTEGER}, #{item.productType,jdbcType=VARCHAR}, #{item.phoneNum,jdbcType=VARCHAR}, #{item.createdOn,jdbcType=TIMESTAMP}, #{item.createdBy,jdbcType=VARCHAR}, #{item.updatedOn,jdbcType=TIMESTAMP}, #{item.updatedBy,jdbcType=VARCHAR}, #{item.itemBelongUserId,jdbcType=VARCHAR}, #{item.itemDiscountAmount,jdbcType=DECIMAL}, #{item.itemMemberDiscountAmount,jdbcType=DECIMAL}, #{item.itemFreightAmount,jdbcType=DECIMAL}, #{item.itemElectronicCardAmount}, #{item.preSale,jdbcType=INTEGER}, #{item.preSaleDate,jdbcType=TIMESTAMP}, #{item.itemBalanceAmount}, #{item.unitPoints}, #{item.skuBarCode}, #{item.supplierId}, #{item.supplierName}, #{item.stockDate},#{item.wxShopProductId},#{item.wxShopSkuId},#{item.platformId},#{item.platformSupplierPrice}, #{item.itemUseIntegral}, #{item.itemIntegralDeductAmount}, #{item.businessGoodsId,jdbcType=VARCHAR}, #{item.commissionSnapshot}, #{item.oriUnitPrice}, #{item.ticketDistributorId}, #{item.ticketDistributorName}, #{item.crossedPrice,jdbcType=DECIMAL} )

Expected Behavior

order_item对象的id字段有自增主键的值,现在是null

Steps To Reproduce

1.插入数据 2.mock数据返回的id值为空

Anything else

No response

Are you willing to submit a pull request to fix on your own?

scjakehuang commented 4 weeks ago
image insert into order_item ( snapshot_id, order_no, buy_count, shop_name, spu_id, sku_id, sku_type, refund_able, auto_approve, item_title, item_description, unit_price, cost_price, item_img_url, item_url, sign_key, project_code, pay_time_limit,product_type,phone_num,created_on, created_by, updated_on, updated_by, item_belong_user_id, item_discount_amount,item_member_discount_amount, item_freight_amount, item_electronic_card_amount, pre_sale, pre_sale_date, item_balance_amount, unit_points, sku_barCode, supplier_id, supplier_name, stock_date,wx_shop_product_id,wx_shop_sku_id,platform_id,platform_supplier_price, item_use_integral, item_integral_deduct_amount, business_goods_id, commission_snapshot, ori_unit_price, ticket_distributor_id, ticket_distributor_name, crossed_price ) values (#{item.snapshotId,jdbcType=VARCHAR}, #{item.orderNo,jdbcType=VARCHAR}, #{item.buyCount,jdbcType=INTEGER}, #{item.shopName,jdbcType=VARCHAR}, #{item.spuId,jdbcType=VARCHAR}, #{item.skuId,jdbcType=VARCHAR}, #{item.skuType,jdbcType=VARCHAR}, #{item.refundAble,jdbcType=VARCHAR}, #{item.autoApprove,jdbcType=INTEGER}, #{item.itemTitle,jdbcType=VARCHAR}, #{item.itemDescription,jdbcType=VARCHAR}, #{item.unitPrice,jdbcType=DECIMAL},#{item.costPrice,jdbcType=DECIMAL}, #{item.itemImgUrl,jdbcType=VARCHAR}, #{item.itemUrl,jdbcType=VARCHAR}, #{item.signKey,jdbcType=VARCHAR}, #{item.projectCode,jdbcType=VARCHAR}, #{item.payTimeLimit,jdbcType=INTEGER}, #{item.productType,jdbcType=VARCHAR}, #{item.phoneNum,jdbcType=VARCHAR}, #{item.createdOn,jdbcType=TIMESTAMP}, #{item.createdBy,jdbcType=VARCHAR}, #{item.updatedOn,jdbcType=TIMESTAMP}, #{item.updatedBy,jdbcType=VARCHAR}, #{item.itemBelongUserId,jdbcType=VARCHAR}, #{item.itemDiscountAmount,jdbcType=DECIMAL}, #{item.itemMemberDiscountAmount,jdbcType=DECIMAL}, #{item.itemFreightAmount,jdbcType=DECIMAL}, #{item.itemElectronicCardAmount}, #{item.preSale,jdbcType=INTEGER}, #{item.preSaleDate,jdbcType=TIMESTAMP}, #{item.itemBalanceAmount}, #{item.unitPoints}, #{item.skuBarCode}, #{item.supplierId}, #{item.supplierName}, #{item.stockDate},#{item.wxShopProductId},#{item.wxShopSkuId},#{item.platformId},#{item.platformSupplierPrice}, #{item.itemUseIntegral}, #{item.itemIntegralDeductAmount}, #{item.businessGoodsId,jdbcType=VARCHAR}, #{item.commissionSnapshot}, #{item.oriUnitPrice}, #{item.ticketDistributorId}, #{item.ticketDistributorName}, #{item.crossedPrice,jdbcType=DECIMAL} )
 mybatis版本号
                <dependency>
                    <groupId>org.mybatis</groupId>
                    <artifactId>mybatis</artifactId>
                    <version>3.4.2</version>
                </dependency>