| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.InventoryLoss.entity.Inventory; |
| | | import org.springblade.modules.InventoryLoss.vo.InventoryVO; |
| | | |
| | |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param lnventory |
| | | * @param inventory |
| | | * @return |
| | | */ |
| | | List<InventoryVO> selectSalePage(IPage page, InventoryVO lnventory); |
| | | List<InventoryVO> selectSalePage(IPage page, @Param("inventory") InventoryVO inventory); |
| | | } |
| | |
| | | strain.strain_name |
| | | from sys_inventory inventory |
| | | LEFT JOIN sys_strain strain on inventory.strain_id = strain.id |
| | | where is_deleted = 0 |
| | | where |
| | | <if test="inventory.strainId !=null and inventory.strainId != '' "> |
| | | inventory.strain_id = #{inventory.strainId} AND |
| | | </if> |
| | | is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | package org.springblade.modules.retrieval.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.retrieval.entity.Retrieval; |
| | | import org.springblade.modules.retrieval.vo.RetrievalVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | * @param retrieval |
| | | * @return |
| | | */ |
| | | List<RetrievalVO> selectRetrievalPage(IPage page, RetrievalVO retrieval); |
| | | List<RetrievalVO> selectRetrievalPage(IPage page, @Param("retrieval") RetrievalVO retrieval); |
| | | |
| | | } |
| | |
| | | <result column="city" property="city"/> |
| | | <result column="county" property="county"/> |
| | | <result column="land_id" property="landId"/> |
| | | <result column="city_name" property="cityName"/> |
| | | <result column="district_name" property="countyName"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | SELECT |
| | | retrieval.*, |
| | | strain.strain_name, |
| | | district.name as district |
| | | district.name as district, |
| | | region.city_name, |
| | | region.district_name |
| | | FROM |
| | | sys_retrieval retrieval |
| | | LEFT JOIN sys_strain strain ON strain.id = retrieval.strain_id |
| | | LEFT JOIN sys_district district ON retrieval.sale_destination = district.code |
| | | LEFT JOIN blade_region region on retrieval.county = region.district_code |
| | | WHERE |
| | | <if test="retrieval.strainId !=null and retrieval.strainId != '' "> |
| | | retrieval.strain_id = #{retrieval.strainId} AND |
| | | </if> |
| | | is_deleted = 0 |
| | | </select> |
| | | |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | import java.util.function.Consumer; |
| | | |
| | | /** |
| | | * 库存出库记录表 服务实现类 |
| | | * |
| | |
| | | |
| | | @Override |
| | | public IPage<RetrievalVO> selectRetrievalPage(IPage<RetrievalVO> page, RetrievalVO retrieval) { |
| | | return page.setRecords(baseMapper.selectRetrievalPage(page, retrieval)); |
| | | List<RetrievalVO> retrievalVO = baseMapper.selectRetrievalPage(page, retrieval); |
| | | retrievalVO.forEach(new Consumer<RetrievalVO>() { |
| | | @Override |
| | | public void accept(RetrievalVO retrievalVO) { |
| | | retrievalVO.setSaleDestination2(retrievalVO.getDistrict()+retrievalVO.getCityName()+retrievalVO.getCountyName()); |
| | | } |
| | | }); |
| | | return page.setRecords(retrievalVO); |
| | | } |
| | | |
| | | } |
| | |
| | | * 出库去向 |
| | | */ |
| | | private String district; |
| | | /** |
| | | * 销售地市中文 |
| | | */ |
| | | private String cityName; |
| | | /** |
| | | * 销售地区中文 |
| | | */ |
| | | private String countyName; |
| | | /** |
| | | * 省市区中文拼接 |
| | | */ |
| | | private String saleDestination2; |
| | | } |
| | |
| | | * @param sale |
| | | * @return |
| | | */ |
| | | List<SaleVO> selectSalePage(IPage page, SaleVO sale); |
| | | List<SaleVO> selectSalePage(IPage page, @Param("sale") SaleVO sale); |
| | | Map<String, String> selctSaletCount(String farmId); |
| | | List<Map<Object,String>> selctSaletZ(@Param("sale") SaleVO sale); |
| | | |
| | |
| | | <result column="url" property="url"/> |
| | | <result column="district" property="district"/> |
| | | <result column="land_id" property="landId"/> |
| | | <result column="city_name" property="cityName"/> |
| | | <result column="district_name" property="countyName"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | user.real_name, |
| | | strain.strain_name, |
| | | strain.url, |
| | | district.name as district |
| | | district.name as district, |
| | | region.city_name, |
| | | region.district_name |
| | | FROM |
| | | sys_sale sale |
| | | LEFT JOIN blade_user user on sale.create_user = user.id |
| | | LEFT JOIN sys_strain strain on sale.strain_id = strain.id |
| | | LEFT JOIN sys_district district on sale.sale_destination = district.code |
| | | LEFT JOIN blade_region region on sale.county = region.district_code |
| | | WHERE |
| | | <if test="sale.strainId !=null and sale.strainId != '' "> |
| | | sale.strain_id = #{sale.strainId} AND |
| | | </if> |
| | | sale.is_deleted = 0 |
| | | </select> |
| | | |
| | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.function.Consumer; |
| | | |
| | | /** |
| | | * 销售记录表 服务实现类 |
| | |
| | | |
| | | @Override |
| | | public IPage<SaleVO> selectSalePage(IPage<SaleVO> page, SaleVO sale) { |
| | | return page.setRecords(baseMapper.selectSalePage(page, sale)); |
| | | |
| | | List<SaleVO> saleVO = baseMapper.selectSalePage(page, sale); |
| | | saleVO.forEach(new Consumer<SaleVO>() { |
| | | @Override |
| | | public void accept(SaleVO saleVO) { |
| | | saleVO.setSaleDestination2(saleVO.getDistrict()+saleVO.getCityName()+saleVO.getCountyName()); |
| | | } |
| | | }); |
| | | return page.setRecords(saleVO); |
| | | } |
| | | |
| | | @Override |
| | |
| | | */ |
| | | private String district; |
| | | /** |
| | | * 销售地市中文 |
| | | */ |
| | | private String cityName; |
| | | /** |
| | | * 销售地区中文 |
| | | */ |
| | | private String countyName; |
| | | /** |
| | | * 省市区中文拼接 |
| | | */ |
| | | private String saleDestination2; |
| | | /** |
| | | * 地块名称 |
| | | */ |
| | | private String landName; |