智慧农业后台管理
guoshilong
2022-08-31 39716db4373ffb6e3638a5f0dfec274da8f942d2
src/main/java/org/springblade/modules/process/mapper/ProcessMapper.xml
@@ -60,4 +60,17 @@
        WHERE
            id = #{proid}
    </update>
    <select id="statistics" resultType="java.lang.Double">
    SELECT SUM(p.process_num) AS sum
    FROM sys_process p
    LEFT JOIN sys_land land ON land.id = p.land_id
    WHERE 1=1 AND p.is_deleted = 0
    <if test="year!=null and year!=''">
        and YEAR ( p.sale_time ) = #{year}
    </if>
    <if test="farmId!=null and farmId!=''">
        and land.farm_id = #{farmId}
    </if>
    </select>
</mapper>