This commit is contained in:
雷欧(林平凡)
2025-08-06 18:04:37 +08:00
parent 7edb6013c8
commit 8638187ced
13 changed files with 431 additions and 93 deletions

View File

@@ -61,77 +61,141 @@
select id, order_id, parent_id, order_time, finish_time, modify_time, order_emt, plus, union_id, sku_id, sku_name, sku_num, sku_return_num, sku_frozen_num, price, commission_rate, sub_side_rate, subsidy_rate, final_rate, estimate_cos_price, estimate_fee, actual_cos_price, actual_fee, valid_code, trace_type, position_id, site_id, union_alias, pid, cid1, cid2, cid3, sub_union_id, union_tag, pop_id, ext1, pay_month, cp_act_id, union_role, gift_coupon_ocs_amount, gift_coupon_key, balance_ext, sign, pro_price_amount, rid, goods_info_id, express_status, channel_id, sku_tag, item_id, caller_item_id, order_tag from order_rows
</sql>
<select id="selectOrderRowsList" parameterType="OrderRows" resultMap="OrderRowsResult">
<include refid="selectOrderRowsVo"/>
<where>
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="orderTime != null "> and order_time = #{orderTime}</if>
<if test="finishTime != null "> and finish_time = #{finishTime}</if>
<if test="modifyTime != null "> and modify_time = #{modifyTime}</if>
<if test="orderEmt != null "> and order_emt = #{orderEmt}</if>
<if test="plus != null "> and plus = #{plus}</if>
<if test="unionId != null "> and union_id = #{unionId}</if>
<if test="skuId != null "> and sku_id = #{skuId}</if>
<if test="skuName != null and skuName != ''"> and sku_name like concat('%', #{skuName}, '%')</if>
<if test="skuNum != null "> and sku_num = #{skuNum}</if>
<if test="skuReturnNum != null "> and sku_return_num = #{skuReturnNum}</if>
<if test="skuFrozenNum != null "> and sku_frozen_num = #{skuFrozenNum}</if>
<if test="price != null "> and price = #{price}</if>
<if test="commissionRate != null "> and commission_rate = #{commissionRate}</if>
<if test="subSideRate != null "> and sub_side_rate = #{subSideRate}</if>
<if test="subsidyRate != null "> and subsidy_rate = #{subsidyRate}</if>
<if test="finalRate != null "> and final_rate = #{finalRate}</if>
<if test="estimateCosPrice != null "> and estimate_cos_price = #{estimateCosPrice}</if>
<if test="estimateFee != null "> and estimate_fee = #{estimateFee}</if>
<if test="actualCosPrice != null "> and actual_cos_price = #{actualCosPrice}</if>
<if test="actualFee != null "> and actual_fee = #{actualFee}</if>
<if test="validCode != null "> and valid_code = #{validCode}</if>
<!-- 支持validCode多值查询 -->
<if test="validCodes != null and validCodes.length > 0">
and valid_code in
<foreach item="item" index="index" collection="validCodes" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="traceType != null "> and trace_type = #{traceType}</if>
<if test="positionId != null "> and position_id = #{positionId}</if>
<if test="siteId != null "> and site_id = #{siteId}</if>
<if test="unionAlias != null and unionAlias != ''"> and union_alias like concat('%', #{unionAlias}, '%')</if>
<if test="pid != null and pid != ''"> and pid = #{pid}</if>
<if test="cid1 != null "> and cid1 = #{cid1}</if>
<if test="cid2 != null "> and cid2 = #{cid2}</if>
<if test="cid3 != null "> and cid3 = #{cid3}</if>
<if test="subUnionId != null and subUnionId != ''"> and sub_union_id = #{subUnionId}</if>
<if test="unionTag != null and unionTag != ''"> and union_tag = #{unionTag}</if>
<if test="popId != null "> and pop_id = #{popId}</if>
<if test="ext1 != null and ext1 != ''"> and ext1 = #{ext1}</if>
<if test="payMonth != null and payMonth != ''"> and pay_month = #{payMonth}</if>
<if test="cpActId != null "> and cp_act_id = #{cpActId}</if>
<if test="unionRole != null "> and union_role = #{unionRole}</if>
<if test="giftCouponOcsAmount != null "> and gift_coupon_ocs_amount = #{giftCouponOcsAmount}</if>
<if test="giftCouponKey != null and giftCouponKey != ''"> and gift_coupon_key = #{giftCouponKey}</if>
<if test="balanceExt != null and balanceExt != ''"> and balance_ext = #{balanceExt}</if>
<if test="sign != null and sign != ''"> and sign = #{sign}</if>
<if test="proPriceAmount != null "> and pro_price_amount = #{proPriceAmount}</if>
<if test="rid != null "> and rid = #{rid}</if>
<if test="goodsInfoId != null "> and goods_info_id = #{goodsInfoId}</if>
<if test="expressStatus != null "> and express_status = #{expressStatus}</if>
<if test="channelId != null "> and channel_id = #{channelId}</if>
<if test="skuTag != null and skuTag != ''"> and sku_tag = #{skuTag}</if>
<if test="itemId != null and itemId != ''"> and item_id = #{itemId}</if>
<if test="callerItemId != null and callerItemId != ''"> and caller_item_id = #{callerItemId}</if>
<if test="orderTag != null and orderTag != ''"> and order_tag = #{orderTag}</if>
</where>
order by order_time desc
</select>
<select id="selectOrderRowsList" parameterType="OrderRows" resultMap="OrderRowsResult">
<include refid="selectOrderRowsVo"/>
<where>
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="orderTime != null "> and order_time = #{orderTime}</if>
<if test="finishTime != null "> and finish_time = #{finishTime}</if>
<if test="modifyTime != null "> and modify_time = #{modifyTime}</if>
<if test="orderEmt != null "> and order_emt = #{orderEmt}</if>
<if test="plus != null "> and plus = #{plus}</if>
<if test="unionId != null "> and union_id = #{unionId}</if>
<if test="skuId != null "> and sku_id = #{skuId}</if>
<if test="skuName != null and skuName != ''"> and sku_name like concat('%', #{skuName}, '%')</if>
<if test="skuNum != null "> and sku_num = #{skuNum}</if>
<if test="skuReturnNum != null "> and sku_return_num = #{skuReturnNum}</if>
<if test="skuFrozenNum != null "> and sku_frozen_num = #{skuFrozenNum}</if>
<if test="price != null "> and price = #{price}</if>
<if test="commissionRate != null "> and commission_rate = #{commissionRate}</if>
<if test="subSideRate != null "> and sub_side_rate = #{subSideRate}</if>
<if test="subsidyRate != null "> and subsidy_rate = #{subsidyRate}</if>
<if test="finalRate != null "> and final_rate = #{finalRate}</if>
<if test="estimateCosPrice != null "> and estimate_cos_price = #{estimateCosPrice}</if>
<if test="estimateFee != null "> and estimate_fee = #{estimateFee}</if>
<if test="actualCosPrice != null "> and actual_cos_price = #{actualCosPrice}</if>
<if test="actualFee != null "> and actual_fee = #{actualFee}</if>
<if test="validCode != null "> and valid_code = #{validCode}</if>
<if test="validCodes != null and validCodes.length &gt; 0">
and valid_code in
<foreach item="item" index="index" collection="validCodes" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="traceType != null "> and trace_type = #{traceType}</if>
<if test="positionId != null "> and position_id = #{positionId}</if>
<if test="siteId != null "> and site_id = #{siteId}</if>
<if test="unionAlias != null and unionAlias != ''"> and union_alias like concat('%', #{unionAlias}, '%')</if>
<if test="pid != null and pid != ''"> and pid = #{pid}</if>
<if test="cid1 != null "> and cid1 = #{cid1}</if>
<if test="cid2 != null "> and cid2 = #{cid2}</if>
<if test="cid3 != null "> and cid3 = #{cid3}</if>
<if test="subUnionId != null and subUnionId != ''"> and sub_union_id = #{subUnionId}</if>
<if test="unionTag != null and unionTag != ''"> and union_tag = #{unionTag}</if>
<if test="popId != null "> and pop_id = #{popId}</if>
<if test="ext1 != null and ext1 != ''"> and ext1 = #{ext1}</if>
<if test="payMonth != null and payMonth != ''"> and pay_month = #{payMonth}</if>
<if test="cpActId != null "> and cp_act_id = #{cpActId}</if>
<if test="unionRole != null "> and union_role = #{unionRole}</if>
<if test="giftCouponOcsAmount != null "> and gift_coupon_ocs_amount = #{giftCouponOcsAmount}</if>
<if test="giftCouponKey != null and giftCouponKey != ''"> and gift_coupon_key = #{giftCouponKey}</if>
<if test="balanceExt != null and balanceExt != ''"> and balance_ext = #{balanceExt}</if>
<if test="sign != null and sign != ''"> and sign = #{sign}</if>
<if test="proPriceAmount != null "> and pro_price_amount = #{proPriceAmount}</if>
<if test="rid != null "> and rid = #{rid}</if>
<if test="goodsInfoId != null "> and goods_info_id = #{goodsInfoId}</if>
<if test="expressStatus != null "> and express_status = #{expressStatus}</if>
<if test="channelId != null "> and channel_id = #{channelId}</if>
<if test="skuTag != null and skuTag != ''"> and sku_tag = #{skuTag}</if>
<if test="itemId != null and itemId != ''"> and item_id = #{itemId}</if>
<if test="callerItemId != null and callerItemId != ''"> and caller_item_id = #{callerItemId}</if>
<if test="orderTag != null and orderTag != ''"> and order_tag = #{orderTag}</if>
</where>
order by order_time desc
</select>
<select id="selectOrderRowsById" parameterType="String" resultMap="OrderRowsResult">
<include refid="selectOrderRowsVo"/>
where id = #{id}
</select>
<select id="selectOrderRowsListWithFilter" resultMap="OrderRowsResult">
<include refid="selectOrderRowsVo"/>
<where>
<if test="orderRows.orderId != null "> and order_id = #{orderRows.orderId}</if>
<if test="orderRows.parentId != null "> and parent_id = #{orderRows.parentId}</if>
<if test="orderRows.orderTime != null "> and order_time = #{orderRows.orderTime}</if>
<if test="orderRows.finishTime != null "> and finish_time = #{orderRows.finishTime}</if>
<if test="orderRows.modifyTime != null "> and modify_time = #{orderRows.modifyTime}</if>
<if test="orderRows.orderEmt != null "> and order_emt = #{orderRows.orderEmt}</if>
<if test="orderRows.plus != null "> and plus = #{orderRows.plus}</if>
<if test="orderRows.unionId != null "> and union_id = #{orderRows.unionId}</if>
<if test="orderRows.skuId != null "> and sku_id = #{orderRows.skuId}</if>
<if test="orderRows.skuName != null and orderRows.skuName != ''"> and sku_name like concat('%', #{orderRows.skuName}, '%')</if>
<if test="orderRows.skuNum != null "> and sku_num = #{orderRows.skuNum}</if>
<if test="orderRows.skuReturnNum != null "> and sku_return_num = #{orderRows.skuReturnNum}</if>
<if test="orderRows.skuFrozenNum != null "> and sku_frozen_num = #{orderRows.skuFrozenNum}</if>
<if test="orderRows.price != null "> and price = #{orderRows.price}</if>
<if test="orderRows.commissionRate != null "> and commission_rate = #{orderRows.commissionRate}</if>
<if test="orderRows.subSideRate != null "> and sub_side_rate = #{orderRows.subSideRate}</if>
<if test="orderRows.subsidyRate != null "> and subsidy_rate = #{orderRows.subsidyRate}</if>
<if test="orderRows.finalRate != null "> and final_rate = #{orderRows.finalRate}</if>
<if test="orderRows.estimateCosPrice != null "> and estimate_cos_price = #{orderRows.estimateCosPrice}</if>
<if test="orderRows.estimateFee != null "> and estimate_fee = #{orderRows.estimateFee}</if>
<if test="orderRows.actualCosPrice != null "> and actual_cos_price = #{orderRows.actualCosPrice}</if>
<if test="orderRows.actualFee != null "> and actual_fee = #{orderRows.actualFee}</if>
<if test="orderRows.validCode != null "> and valid_code = #{orderRows.validCode}</if>
<if test="orderRows.traceType != null "> and trace_type = #{orderRows.traceType}</if>
<if test="orderRows.positionId != null "> and position_id = #{orderRows.positionId}</if>
<if test="orderRows.siteId != null "> and site_id = #{orderRows.siteId}</if>
<if test="orderRows.unionAlias != null and orderRows.unionAlias != ''"> and union_alias like concat('%', #{orderRows.unionAlias}, '%')</if>
<if test="orderRows.pid != null and orderRows.pid != ''"> and pid = #{orderRows.pid}</if>
<if test="orderRows.cid1 != null "> and cid1 = #{orderRows.cid1}</if>
<if test="orderRows.cid2 != null "> and cid2 = #{orderRows.cid2}</if>
<if test="orderRows.cid3 != null "> and cid3 = #{orderRows.cid3}</if>
<if test="orderRows.subUnionId != null and orderRows.subUnionId != ''"> and sub_union_id = #{orderRows.subUnionId}</if>
<if test="orderRows.unionTag != null and orderRows.unionTag != ''"> and union_tag = #{orderRows.unionTag}</if>
<if test="orderRows.popId != null "> and pop_id = #{orderRows.popId}</if>
<if test="orderRows.ext1 != null and orderRows.ext1 != ''"> and ext1 = #{orderRows.ext1}</if>
<if test="orderRows.payMonth != null and orderRows.payMonth != ''"> and pay_month = #{orderRows.payMonth}</if>
<if test="orderRows.cpActId != null "> and cp_act_id = #{orderRows.cpActId}</if>
<if test="orderRows.unionRole != null "> and union_role = #{orderRows.unionRole}</if>
<if test="orderRows.giftCouponOcsAmount != null "> and gift_coupon_ocs_amount = #{orderRows.giftCouponOcsAmount}</if>
<if test="orderRows.giftCouponKey != null and orderRows.giftCouponKey != ''"> and gift_coupon_key = #{orderRows.giftCouponKey}</if>
<if test="orderRows.balanceExt != null and orderRows.balanceExt != ''"> and balance_ext = #{orderRows.balanceExt}</if>
<if test="orderRows.sign != null and orderRows.sign != ''"> and sign = #{orderRows.sign}</if>
<if test="orderRows.proPriceAmount != null "> and pro_price_amount = #{orderRows.proPriceAmount}</if>
<if test="orderRows.rid != null "> and rid = #{orderRows.rid}</if>
<if test="orderRows.goodsInfoId != null "> and goods_info_id = #{orderRows.goodsInfoId}</if>
<if test="orderRows.expressStatus != null "> and express_status = #{orderRows.expressStatus}</if>
<if test="orderRows.channelId != null "> and channel_id = #{orderRows.channelId}</if>
<if test="orderRows.skuTag != null and orderRows.skuTag != ''"> and sku_tag = #{orderRows.skuTag}</if>
<if test="orderRows.itemId != null and orderRows.itemId != ''"> and item_id = #{orderRows.itemId}</if>
<if test="orderRows.callerItemId != null and orderRows.callerItemId != ''"> and caller_item_id = #{orderRows.callerItemId}</if>
<if test="orderRows.orderTag != null and orderRows.orderTag != ''"> and order_tag = #{orderRows.orderTag}</if>
<if test="beginTime != null"> and order_time &gt;= #{beginTime}</if>
<if test="endTime != null"> and order_time &lt;= #{endTime}</if>
<if test="excludeUnionIds != null and excludeUnionIds.size() &gt; 0">
and union_id not in
<foreach item="unionId" collection="excludeUnionIds" open="(" separator="," close=")">
#{unionId}
</foreach>
</if>
</where>
order by order_time desc
</select>
<insert id="insertOrderRows" parameterType="OrderRows">
insert into order_rows
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -187,7 +251,7 @@
<if test="itemId != null and itemId != ''">item_id,</if>
<if test="callerItemId != null and callerItemId != ''">caller_item_id,</if>
<if test="orderTag != null and orderTag != ''">order_tag,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
<if test="orderId != null">#{orderId},</if>
@@ -241,7 +305,7 @@
<if test="itemId != null and itemId != ''">#{itemId},</if>
<if test="callerItemId != null and callerItemId != ''">#{callerItemId},</if>
<if test="orderTag != null and orderTag != ''">#{orderTag},</if>
</trim>
</trim>
</insert>
<update id="updateOrderRows" parameterType="OrderRows">