|
@@ -10,8 +10,8 @@ import java.util.Date;
|
|
|
|
|
|
public interface ProdBatchWeightRepo extends JpaRepository<ProdBatchWeightEntity, Integer>, JpaSpecificationExecutor<ProdBatchWeightEntity> {
|
|
public interface ProdBatchWeightRepo extends JpaRepository<ProdBatchWeightEntity, Integer>, JpaSpecificationExecutor<ProdBatchWeightEntity> {
|
|
//
|
|
//
|
|
- @Query(nativeQuery = true,value = "SELECT * FROM prod_weight WHERE farm_id=?1 AND DATE_FORMAT(add_time,'%Y-%m-%d')>=DATE_FORMAT(?2,'%Y-%m-%d') AND DATE_FORMAT(add_time,'%Y-%m-%d')<=DATE_FORMAT(?3,'%Y-%m-%d') ORDER BY id DESC",
|
|
|
|
- countQuery = "SELECT COUNT(*) FROM prod_weight WHERE farm_id=?1 AND DATE_FORMAT(add_time,'%Y-%m-%d')>=DATE_FORMAT(?2,'%Y-%m-%d') AND DATE_FORMAT(add_time,'%Y-%m-%d')<=DATE_FORMAT(?3,'%Y-%m-%d')")
|
|
|
|
|
|
+ @Query(nativeQuery = true,value = "SELECT * FROM prod_batch_weight WHERE farm_id=?1 AND DATE_FORMAT(add_time,'%Y-%m-%d')>=DATE_FORMAT(?2,'%Y-%m-%d') AND DATE_FORMAT(add_time,'%Y-%m-%d')<=DATE_FORMAT(?3,'%Y-%m-%d') ORDER BY id DESC",
|
|
|
|
+ countQuery = "SELECT COUNT(*) FROM prod_batch_weight WHERE farm_id=?1 AND DATE_FORMAT(add_time,'%Y-%m-%d')>=DATE_FORMAT(?2,'%Y-%m-%d') AND DATE_FORMAT(add_time,'%Y-%m-%d')<=DATE_FORMAT(?3,'%Y-%m-%d')")
|
|
Page<ProdBatchWeightEntity> findByFarmIdAndStartDateAndEndDate(Integer farmId, Date startDate, Date endDate, Pageable pageable);
|
|
Page<ProdBatchWeightEntity> findByFarmIdAndStartDateAndEndDate(Integer farmId, Date startDate, Date endDate, Pageable pageable);
|
|
|
|
|
|
}
|
|
}
|