智慧农业后台管理
guoshilong
2022-08-19 61b3327cfc96bc9bee384c4a5b417f7a9f1228b3
小程序产量统计
5 files modified
42 ■■■■■ changed files
src/main/java/org/springblade/modules/recovery/controller/RecoveryController.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.xml 18 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recovery/service/RecoveryService.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recovery/service/impl/RecoveryServiceImpl.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recovery/controller/RecoveryController.java
@@ -30,6 +30,7 @@
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
 * 农事记录控制器
@@ -210,6 +211,15 @@
    }
    /**
     * xcx数据统计采收详情
     */
    @GetMapping("/recoveryStatisticsx")
    public  R recoveryStatisticsx( RecoveryVO recoveryVO, Query query){
        IPage<RecoveryVO> pages = recoveryService.recoveryStatisticsx(Condition.getPage(query), recoveryVO);
        return R.data(pages);
    }
    /**
     * 小程序采收详情列表自定义分页
     */
    @GetMapping("/pagec")
src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.java
@@ -6,6 +6,7 @@
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.recovery.entity.Recovery;
import org.springblade.modules.recovery.vo.RecoveryVO;
import org.springblade.modules.stock.vo.StocksVO;
import java.util.List;
@@ -40,4 +41,6 @@
    RecoveryVO getRecoveryDetail(@Param("recoveryId") Integer recoveryId);
    IPage<RecoveryVO> recoveryStatistics(IPage<Object> page, @Param("recovery") RecoveryVO recoveryVO);
    IPage<RecoveryVO>  recoveryStatisticsx(IPage<Object> page, @Param("recovery")RecoveryVO recoveryVO);
}
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>
src/main/java/org/springblade/modules/recovery/service/RecoveryService.java
@@ -5,6 +5,9 @@
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.recovery.entity.Recovery;
import org.springblade.modules.recovery.vo.RecoveryVO;
import org.springblade.modules.stock.vo.StocksVO;
import java.util.List;
/**
 * 采收记录服务类
@@ -37,4 +40,6 @@
    RecoveryVO getRecoveryDetail(Integer recoveryId);
    IPage<RecoveryVO> recoveryStatistics(IPage<Object> page, RecoveryVO recoveryVO);
    IPage<RecoveryVO> recoveryStatisticsx(IPage<Object> page, RecoveryVO recoveryVO);
}
src/main/java/org/springblade/modules/recovery/service/impl/RecoveryServiceImpl.java
@@ -5,6 +5,7 @@
import org.springblade.modules.recovery.mapper.RecoveryMapper;
import org.springblade.modules.recovery.service.RecoveryService;
import org.springblade.modules.recovery.vo.RecoveryVO;
import org.springblade.modules.stock.vo.StocksVO;
import org.springframework.stereotype.Service;
/**
@@ -50,4 +51,9 @@
    public IPage<RecoveryVO> recoveryStatistics(IPage<Object> page, RecoveryVO recoveryVO) {
        return baseMapper.recoveryStatistics(page,recoveryVO);
    }
    @Override
    public IPage<RecoveryVO>  recoveryStatisticsx(IPage<Object> page, RecoveryVO recoveryVO) {
        return baseMapper.recoveryStatisticsx(page,recoveryVO);
    }
}