| | |
| | | import org.springblade.modules.farmplant.vo.FarmPlantVO; |
| | | import org.springblade.modules.farmplant.vo.StrainVO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | |
| | | List<FarmPlantVO> farmPlantVOS = baseMapper.selectFarmPlantPage(page, farm); |
| | | //遍历 |
| | | farmPlantVOS.forEach(farmPlantVO -> { |
| | | //面积单位(0: 亩 1:分 2:平方米) |
| | | if (farmPlantVO.getLandUnit().equals("0")) { |
| | | farmPlantVO.setArea(String.format("%.2f", Double.parseDouble(farmPlantVO.getArea()) * 1)); |
| | | } |
| | |
| | | } |
| | | }); |
| | | return page.setRecords(farmPlantVOS); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<FarmPlantVO> selectFarmPlantPageCount(IPage<Object> page, FarmPlantVO farmPlant) { |
| | | return baseMapper.selectFarmPlantPageCount(page, farmPlant); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int selectCount() { |
| | | return baseMapper.selectCount(); |
| | | public int selectCount(FarmPlantVO farm) { |
| | | return baseMapper.selectCount(farm); |
| | | } |
| | | |
| | | @Override |