| | |
| | | return selectOne(MesProBatchDO::getCode, code); |
| | | } |
| | | |
| | | default MesProBatchDO selectByTempCode(String tempCode) { |
| | | return selectOne(MesProBatchDO::getTempCode, tempCode); |
| | | } |
| | | |
| | | /** 生成临时批次码用的全局序号:解析 temp_code 的数字后缀,不存在则返回 0 */ |
| | | @Select("SELECT IFNULL(MAX(CAST(SUBSTRING(temp_code, 4) AS UNSIGNED)), 0) FROM mes_pro_batch WHERE deleted = 0") |
| | | Integer selectMaxTempCodeSeq(); |
| | | |
| | | default Long selectCountByLineId(Long lineId) { |
| | | return selectCount(MesProBatchDO::getLineId, lineId); |
| | | } |
| | |
| | | @Select("SELECT * FROM mes_pro_batch WHERE id = #{id} AND deleted = 0 FOR UPDATE") |
| | | MesProBatchDO selectByIdForUpdate(@org.apache.ibatis.annotations.Param("id") Long id); |
| | | |
| | | @org.apache.ibatis.annotations.Update("UPDATE mes_pro_batch SET inbound_time = NOW(), inbound_event_id = #{eventId}, inbound_device_code = #{deviceCode}, inbound_line_code = #{lineCode}, inbound_bag_quantity = COALESCE(inbound_bag_quantity, 0) + 1, update_time = NOW() WHERE id = #{id} AND deleted = 0") |
| | | int markInbound(@org.apache.ibatis.annotations.Param("id") Long id, @org.apache.ibatis.annotations.Param("eventId") Long eventId, |
| | | @org.apache.ibatis.annotations.Param("deviceCode") String deviceCode, @org.apache.ibatis.annotations.Param("lineCode") String lineCode); |
| | | |
| | | default PageResult<MesProBatchDO> selectPage(MesProBatchPageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<MesProBatchDO>() |
| | | .likeIfPresent(MesProBatchDO::getCode, reqVO.getCode()) |
| | | .likeIfPresent(MesProBatchDO::getTempCode, reqVO.getTempCode()) |
| | | .eqIfPresent(MesProBatchDO::getItemId, reqVO.getItemId()) |
| | | .eqIfPresent(MesProBatchDO::getLineId, reqVO.getLineId()) |
| | | .likeIfPresent(MesProBatchDO::getLineCode, reqVO.getLineCode()) |