count
This commit is contained in:
parent
1f3fe56bf4
commit
8f40b828a7
@ -40,4 +40,6 @@ public interface TCountMapper extends BaseMapper<TCount> {
|
|||||||
List<TCount> selectListLimit(@Param("limit") int limit);
|
List<TCount> selectListLimit(@Param("limit") int limit);
|
||||||
|
|
||||||
List selectByReq(@Param("page") IPage page, @Param("req") TCountReq req);
|
List selectByReq(@Param("page") IPage page, @Param("req") TCountReq req);
|
||||||
|
|
||||||
|
int selectMaxNum();
|
||||||
}
|
}
|
||||||
@ -118,7 +118,9 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
|||||||
}
|
}
|
||||||
|
|
||||||
EquipmentInfo info = equipmentInfoMapper.selectEquipmentInfoById(dto.getId());
|
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();
|
EquipmentInfo insert = new EquipmentInfo();
|
||||||
insert.setType(equipmentType.getType());
|
insert.setType(equipmentType.getType());
|
||||||
insert.setBrandName(equipmentBrand.getBrand());
|
insert.setBrandName(equipmentBrand.getBrand());
|
||||||
@ -140,6 +142,7 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
|||||||
insert.setUser(specialApplyInfo.getTypeDesc());
|
insert.setUser(specialApplyInfo.getTypeDesc());
|
||||||
insert.setSaiId(specialApplyInfo.getId());
|
insert.setSaiId(specialApplyInfo.getId());
|
||||||
}
|
}
|
||||||
|
insert.setCount(i);
|
||||||
equipmentInfoMapper.insert(insert);
|
equipmentInfoMapper.insert(insert);
|
||||||
addRecord(insert,infoDto);
|
addRecord(insert,infoDto);
|
||||||
|
|
||||||
|
|||||||
@ -80,5 +80,8 @@
|
|||||||
select * from equipment_t_count where is_delete = 0 order by id desc
|
select * from equipment_t_count where is_delete = 0 order by id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMaxNum" resultType="int">
|
||||||
|
select num from equipment_t_count where is_delete = 0 order by num desc limit 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user