gaoluyang
4 天以前 8c65f898ed6e5b0c7a94c792c4562f6ec831dccd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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);
}