智慧农业后台管理
zhongrj
2022-08-02 a57972deeea72b23f6abfa937d56a254e6973962
src/main/java/org/springblade/modules/farmplant/mapper/FarmProductStockMapper.xml
@@ -382,10 +382,17 @@
        WHERE
            id = #{id}
    </select>
    <!--减去对应库存-->
    <update id="stockReduce">
        UPDATE sys_farm_product_stock SET weight = weight - #{sale}
        WHERE
            id = #{id}
    </update>
    <select id="selectBy2Id" resultType="org.springblade.modules.farmplant.entity.FarmProductStock">
        SELECT id,strain_id,weight,leaves,time,operator,remark,
               create_time,farm_plant_id,dept_id,tenant_id,recovery,land_id
        FROM sys_farm_product_stock  WHERE strain_id = #{strainId} AND land_id = #{landId}
    </select>
</mapper>