| | |
| | | return R.data(pages); |
| | | } |
| | | |
| | | @GetMapping("/getFarmProductStockByFarmIdAndStrainId") |
| | | public R<FarmProductStock> findFarmProductStockByFarmIdAndStrainId(String farmId,Integer strainId) { |
| | | List<FarmProductStock> farmProductStockList = farmProductStockService.findFarmProductStockByFarmIdAndStrainId(farmId,strainId); |
| | | if (farmProductStockList.size() == 0) { |
| | | return R.data(null); |
| | | } |
| | | return R.data(farmProductStockList.get(0)); |
| | | } |
| | | |
| | | /** |
| | | * 统计产量 |
| | | * |
| | |
| | | List<FarmProductStockVO> selectFarmProductStockPage(@Param("page") IPage page, @Param("farmProductStock") FarmProductStockVO farmProductStock); |
| | | List<FarmProductStockVO> selectFarmProductStockPages(@Param("farmProductStock") FarmProductStockVO farmProductStock); |
| | | |
| | | List<FarmProductStock> findFarmProductStockByFarmIdAndStrainId(@Param("farmId") String farmId, @Param("strainId") Integer strainId); |
| | | |
| | | /** |
| | | * 统计产量 |
| | | * @param farmProductStock |
| | |
| | | group by sfps.strain_id,ss.url,ss.strain_name,sfps.land_id |
| | | </select> |
| | | |
| | | <!--根据农场id和品种类型查询 关系:农产品库存表关联地块 -》 地块关联农场 -》 需要联合查询 --> |
| | | <select id="findFarmProductStockByFarmIdAndStrainId" resultType="org.springblade.modules.farmplant.entity.FarmProductStock"> |
| | | select a.* from sys_farm_product_stock a |
| | | left join sys_land b on a.land_id = b.id |
| | | where 1=1 and a.strain_id = #{strainId} and b.farm_id = #{farmId} |
| | | </select> |
| | | |
| | | |
| | | <!--查询农产品库存数据--> |
| | | <select id="statisticsProduct" resultType="org.springblade.modules.farmplant.vo.FarmProductStockVO"> |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.farmplant.entity.FarmProductStock; |
| | | import org.springblade.modules.farmplant.service.impl.FarmProductStockServiceImpl; |
| | | import org.springblade.modules.farmplant.vo.FarmProductStockVO; |
| | | |
| | | import java.util.List; |
| | |
| | | IPage<FarmProductStockVO> selectFarmProductStockPage(IPage<FarmProductStockVO> page, FarmProductStockVO farmProductStock); |
| | | List<FarmProductStockVO> selectFarmProductStockPages(FarmProductStockVO farmProductStock); |
| | | |
| | | List<FarmProductStock> findFarmProductStockByFarmIdAndStrainId(String farmId, Integer strainId); |
| | | |
| | | /** |
| | | * 统计产量 |
| | | * @param farmProductStock |
| | |
| | | package org.springblade.modules.farmplant.service.impl; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.modules.farmplant.entity.FarmProductStock; |
| | | import org.springblade.modules.farmplant.mapper.FarmProductStockMapper; |
| | | import org.springblade.modules.farmplant.service.FarmProductStockService; |
| | |
| | | return baseMapper.selectFarmProductStockPages(farmProductStock); |
| | | } |
| | | |
| | | @Override |
| | | public List<FarmProductStock> findFarmProductStockByFarmIdAndStrainId(String farmId, Integer strainId) { |
| | | return baseMapper.findFarmProductStockByFarmIdAndStrainId(farmId,strainId); |
| | | } |
| | | |
| | | /** |
| | | * 统计产量 |
| | | * @param farmProductStock |