智慧农业后台管理
guoshilong
2022-08-19 61b3327cfc96bc9bee384c4a5b417f7a9f1228b3
src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.xml
@@ -70,6 +70,22 @@
        <if test="recovery.endTime != null and recovery.endTime !=''">
            and DATE_FORMAT(sr.create_time,'%Y-%m-%d') &lt;= #{recovery.endTime}
        </if>
        GROUP BY strain_id
        GROUP BY sr.strain_id
    </select>
    <select id="recoveryStatisticsx" resultType="org.springblade.modules.recovery.vo.RecoveryVO">
        SELECT sr.strain_id,SUM(sr.weight) AS weight,sr.dept_id,strain.strain_name,strain.url
        FROM sys_recovery sr
        LEFT JOIN sys_strain strain ON sr.strain_id = strain.id
        WHERE 1=1
        <if test="recovery.deptId !=null and recovery.deptId !=''">
            AND sr.dept_id = #{recovery.deptId}
        </if>
        <if test="recovery.startTime != null and recovery.startTime !=''">
            AND DATE_FORMAT(sr.create_time,'%Y-%m-%d') &gt;= #{recovery.startTime}
        </if>
        <if test="recovery.endTime != null and recovery.endTime !=''">
            and DATE_FORMAT(sr.create_time,'%Y-%m-%d') &lt;= #{recovery.endTime}
        </if>
        GROUP BY sr.strain_id
    </select>
</mapper>