| | |
| | | @Select("SELECT IFNULL(MAX(bag_no), 0) FROM mes_pro_bag_code WHERE batch_id = #{batchId}") |
| | | Integer selectMaxBagNo(@Param("batchId") Long batchId); |
| | | |
| | | default List<MesProBagCodeDO> selectListByIdsForUpdate(Collection<Long> ids) { |
| | | return selectList(new LambdaQueryWrapperX<MesProBagCodeDO>() |
| | | .in(MesProBagCodeDO::getId, ids) |
| | | .orderByAsc(MesProBagCodeDO::getId) |
| | | .last("FOR UPDATE")); |
| | | } |
| | | |
| | | @Update("<script>UPDATE mes_pro_bag_code SET status = #{toStatus}, cancel_time = #{cancelTime}, " + |
| | | "cancel_reason = #{cancelReason}, pallet_id = NULL, pallet_code = NULL, update_time = NOW() " + |
| | | "WHERE deleted = 0 AND id = #{id} AND status = #{fromStatus}</script>") |
| | | int cancelById(@Param("id") Long id, @Param("fromStatus") Integer fromStatus, |
| | | @Param("toStatus") Integer toStatus, @Param("cancelTime") LocalDateTime cancelTime, |
| | | @Param("cancelReason") String cancelReason); |
| | | |
| | | @Select("SELECT COUNT(*) FROM mes_pro_bag_code WHERE batch_id = #{batchId} " + |
| | | "AND deleted = 0 AND status <> 30") |
| | | int selectEffectiveCountByBatchId(@Param("batchId") Long batchId); |
| | | |
| | | /** |
| | | * 批量标记为已导出印刷(仅更新处于目标原状态的记录) |
| | | * |