package com.xunhong.erp.turbo.biz.infrastructure.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xunhong.erp.turbo.biz.infrastructure.entity.ProductDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author shenyifei
 */
@Mapper
public interface ProductMapper extends BaseMapper<ProductDO> {
    /**
     * 批量重置排序
     *
     * @param productId 产品ID
     */
    @Update("UPDATE product SET sort = (product_id * 1000) WHERE product_id = #{productId}")
    void batchResetSort(@Param("productId") Long productId);
}