| | |
| | | |
| | | <!--自定义查询农场养殖记录分页数据--> |
| | | <select id="selectFarmPlantPage" resultType="org.springblade.modules.farmplant.vo.FarmPlantVO"> |
| | | select sfp.*,ss.strain_name strainName,url,sl.land_name landName from sys_farm_plant sfp |
| | | select sfp.*,ss.strain_name strainName,url,sl.land_name landName,sl.land_area area,land_unit landUnit from sys_farm_plant sfp |
| | | left join sys_strain ss on ss.id = sfp.strain_id |
| | | left join sys_land sl on sl.id = sfp.land_id |
| | | where 1=1 |
| | |
| | | <!--自定义查询农产品库存分页数据--> |
| | | <select id="selectFarmProductStockPage" resultType="org.springblade.modules.farmplant.vo.FarmProductStockVO"> |
| | | select * from sys_farm_product_stock |
| | | where 1=1 |
| | | <if test="farmProductStock.strainId!=null and farmProductStock.strainId!=''"> |
| | | and strain_id = #{farmProductStock.strainId} |
| | | </if> |
| | | <if test="farmProductStock.leaves!=null and farmProductStock.leaves!=''"> |
| | | and leaves = #{farmProductStock.leaves} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | import org.springblade.modules.farmplant.vo.FarmPlantVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 农场养殖记录表服务实现类 |
| | | * @since 2022-05-12 |
| | |
| | | */ |
| | | @Override |
| | | public IPage<FarmPlantVO> selectFarmPlantPage(IPage<FarmPlantVO> page, FarmPlantVO farm) { |
| | | return page.setRecords(baseMapper.selectFarmPlantPage(page, farm)); |
| | | List<FarmPlantVO> farmPlantVOS = baseMapper.selectFarmPlantPage(page, farm); |
| | | //遍历 |
| | | farmPlantVOS.forEach(farmPlantVO -> { |
| | | if (farmPlantVO.getLandUnit().equals("0")){ |
| | | farmPlantVO.setArea(farmPlantVO.getArea()+"亩"); |
| | | } |
| | | if (farmPlantVO.getLandUnit().equals("1")){ |
| | | farmPlantVO.setArea(farmPlantVO.getArea()+"分"); |
| | | } |
| | | if (farmPlantVO.getLandUnit().equals("2")){ |
| | | farmPlantVO.setArea(farmPlantVO.getArea()+"平方米"); |
| | | } |
| | | }); |
| | | return page.setRecords(farmPlantVOS); |
| | | } |
| | | } |
| | |
| | | */ |
| | | private String landName; |
| | | |
| | | /** |
| | | * 土地面积 |
| | | */ |
| | | private String area; |
| | | |
| | | /** |
| | | * 面积单位(0: 亩 1:分 2:平方米) |
| | | */ |
| | | private String landUnit; |
| | | |
| | | } |
| | |
| | | |
| | | <!--自定义查询采收记录分页数据--> |
| | | <select id="selectRecoveryPage" resultType="org.springblade.modules.recovery.vo.RecoveryVO"> |
| | | select sfr.*,sl.land_name landName from sys_recovery sr |
| | | select sr.*,sl.land_name landName from sys_recovery sr |
| | | left join sys_land sl on sl.id = sr.land_id |
| | | where 1=1 |
| | | <if test="recovery.strainId!=null and recovery.strainId!=''"> |
| | | and sr.strain_id = #{recovery.strainId} |
| | | </if> |
| | | <if test="recovery.leaves!=null and recovery.leaves!=''"> |
| | | and sr.leaves = #{recovery.leaves} |
| | | </if> |
| | | <if test="recovery.landId!=null and recovery.landId!=''"> |
| | | and sr.land_id = #{recovery.landId} |
| | | </if> |