| | |
| | | |
| | | <!--自定义查询农产品库存分页数据--> |
| | | <select id="selectFarmProductStockPage" resultType="org.springblade.modules.farmplant.vo.FarmProductStockVO"> |
| | | select sfps.strain_id strainId,sfps.land_id,sum(sfps.weight) weight,ss.url,ss.strain_name strainName from |
| | | select sfps.id,sfps.strain_id strainId,sfps.land_id,sum(sfps.weight) weight,ss.url,ss.strain_name strainName from |
| | | sys_farm_product_stock sfps |
| | | left join sys_strain ss on ss.id = sfps.strain_id |
| | | where 1=1 |
| | |
| | | <if test="farmProductStock.tenantId!=null and farmProductStock.tenantId!=''"> |
| | | and sfps.tenant_id = #{farmProductStock.tenantId} |
| | | </if> |
| | | group by sfps.strain_id,ss.url,ss.strain_name,sfps.land_id |
| | | group by sfps.id,sfps.strain_id,ss.url,ss.strain_name,sfps.land_id |
| | | </select> |
| | | |
| | | <select id="selectFarmProductStockPages" resultType="org.springblade.modules.farmplant.vo.FarmProductStockVO"> |
| | |
| | | |
| | | <!--查询农产品库存数据--> |
| | | <select id="statisticsProduct" resultType="org.springblade.modules.farmplant.vo.FarmProductStockVO"> |
| | | select sfps.strain_id strainId,sum(sfps.weight) weight,ss.url,ss.strain_name strainName from |
| | | select sfps.id,sfps.strain_id strainId,sum(sfps.weight) weight,ss.url,ss.strain_name strainName from |
| | | sys_farm_product_stock sfps |
| | | left join sys_strain ss on ss.id = sfps.strain_id |
| | | where 1=1 |
| | |
| | | FROM |
| | | sys_farm_product_stock |
| | | WHERE |
| | | strain_id = #{id} |
| | | id = #{id} |
| | | </select> |
| | | <!--减去对应库存--> |
| | | <update id="stockReduce"> |
| | | UPDATE sys_farm_product_stock SET weight = weight - #{sale} |
| | | WHERE |
| | | strain_id = #{id} |
| | | id = #{id} |
| | | </update> |
| | | </mapper> |