退菜同步修改订单金额

This commit is contained in:
2024-10-12 10:20:02 +08:00
parent 608fb72c78
commit 7379b1d85d
2 changed files with 17 additions and 0 deletions

View File

@@ -5,7 +5,9 @@ import cn.ysk.cashier.vo.TbOrderSaleVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
@@ -32,4 +34,10 @@ public interface TbOrderInfoMapper extends BaseMapper<TbOrderInfo> {
" ) " +
"</script>")
List<TbOrderSaleVO> selectAllSaleInfo(@Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime, @Param("productSkuIds") List<Integer> productSkuIds, @Param("shopId") Integer shopId);
@Update("update tb_order_info set settlement_amount=settlement_amount-#{priceAmount}, pack_fee=pack_fee-#{packAmount}," +
"order_amount=origin_amount-#{priceAmount}, amount=amount-#{priceAmount}," +
"order_amount=order_amount-#{priceAmount} where id=#{orderId} and origin_amount-#{priceAmount} >= 0")
int updateOrderAmount(Integer orderId, BigDecimal priceAmount, BigDecimal packAmount);
}