智慧农业后台管理
tangzy
2022-07-16 79fdda3c7bc986ff8af4403fc6a544bb5419a1ac
src/main/java/org/springblade/modules/farmplant/mapper/FarmProductStockMapper.xml
@@ -61,6 +61,7 @@
        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
        LEFT JOIN sys_land sl ON sl.id = sfps.land_id
        where 1=1
        <if test="farmProductStock.strainId!=null and farmProductStock.strainId!=''">
            and sfps.strain_id = #{farmProductStock.strainId}
@@ -80,6 +81,9 @@
        <if test="farmProductStock.tenantId!=null and farmProductStock.tenantId!=''">
            and sfps.tenant_id = #{farmProductStock.tenantId}
        </if>
        <if test="farmProductStock.farmId!=null and farmProductStock.farmId!=''">
            and sl.farm_id = #{farmProductStock.farmId}
        </if>
        group by sfps.id,sfps.strain_id,ss.url,ss.strain_name
    </select>