智慧农业后台管理
xiebin
2022-08-09 01b846921613edfbccfb4f28a64db7af5ea78b07
src/main/java/org/springblade/modules/sale/mapper/SaleMapper.xml
@@ -128,8 +128,17 @@
            sys_sale sale
            LEFT JOIN sys_district dis ON sale.sale_destination = dis.CODE
            LEFT JOIN sys_land sl ON sl.id = sale.land_id
        WHERE
            YEAR ( sale_time ) = YEAR ( NOW( ) )
        WHERE 1 = 1
        <if test="startTime != null and startTime != ''">
            and sale_time &gt;= #{startTime}
        </if>
        <if test="endTime != null and endTime != ''">
            and sale_time &lt;= #{endTime}
        </if>
        <if test="startTime == null and endTime == null ">
            and YEAR ( sale_time ) = YEAR ( NOW( ) )
        </if>
        <if test="farmId != null and farmId != ''">
            and sl.farm_id = #{farmId}
        </if>