This commit is contained in:
DirectionOfMind 2020-12-28 15:08:33 +08:00
parent 1f3fe56bf4
commit 8f40b828a7
3 changed files with 9 additions and 1 deletions

View File

@ -40,4 +40,6 @@ public interface TCountMapper extends BaseMapper<TCount> {
List<TCount> selectListLimit(@Param("limit") int limit);
List selectByReq(@Param("page") IPage page, @Param("req") TCountReq req);
int selectMaxNum();
}

View File

@ -118,7 +118,9 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
}
EquipmentInfo info = equipmentInfoMapper.selectEquipmentInfoById(dto.getId());
if(info==null){
int i = tCountMapper.selectMaxNum();
if(info==null || (info!=null && info.getCount()<i)){
EquipmentInfo insert = new EquipmentInfo();
insert.setType(equipmentType.getType());
insert.setBrandName(equipmentBrand.getBrand());
@ -140,6 +142,7 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
insert.setUser(specialApplyInfo.getTypeDesc());
insert.setSaiId(specialApplyInfo.getId());
}
insert.setCount(i);
equipmentInfoMapper.insert(insert);
addRecord(insert,infoDto);

View File

@ -80,5 +80,8 @@
select * from equipment_t_count where is_delete = 0 order by id desc
</select>
<select id="selectMaxNum" resultType="int">
select num from equipment_t_count where is_delete = 0 order by num desc limit 1
</select>
</mapper>