智慧农业后台管理
guoshilong
2022-08-31 39716db4373ffb6e3638a5f0dfec274da8f942d2
src/main/java/org/springblade/modules/process/mapper/ProcessMapper.xml
@@ -39,7 +39,7 @@
        <if test="process.strainId !=null and process.strainId !=''">
            and p.strain_id = #{process.strainId}
        </if>
        GROUP BY p.strain_id,m.machining_type,m.machining_tp,p.land_id,sale_time,sale_num,process_id,p.id
        GROUP BY p.strain_id,m.machining_type,m.machining_tp,p.land_id,sale_time,sale_num,process_id,p.id ORDER BY p.create_time DESC
    </select>
    <select id="stockCompare" resultType="boolean">
@@ -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>