package cn.iocoder.yudao.module.mes.dal.mysql.wm.materialstock;
|
|
import org.apache.ibatis.annotations.Delete;
|
import org.apache.ibatis.annotations.Insert;
|
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Select;
|
|
@Mapper
|
public interface MesWmMaterialStockFreezeClaimMapper {
|
|
@Insert("INSERT IGNORE INTO mes_wm_material_stock_freeze_claim(stock_id, source_type, source_id) " +
|
"VALUES(#{stockId}, #{sourceType}, #{sourceId})")
|
int acquire(@Param("stockId") Long stockId, @Param("sourceType") String sourceType,
|
@Param("sourceId") Long sourceId);
|
|
@Delete("DELETE FROM mes_wm_material_stock_freeze_claim " +
|
"WHERE stock_id = #{stockId} AND source_type = #{sourceType} AND source_id = #{sourceId}")
|
int release(@Param("stockId") Long stockId, @Param("sourceType") String sourceType,
|
@Param("sourceId") Long sourceId);
|
|
@Select("SELECT COUNT(*) FROM mes_wm_material_stock_freeze_claim WHERE stock_id = #{stockId}")
|
long countByStockId(@Param("stockId") Long stockId);
|
}
|