This commit is contained in:
dirgantarasiahaan
2023-05-29 00:49:00 +07:00
parent 3fe1e05fc0
commit f0d2c3d82c
13 changed files with 304 additions and 12 deletions

View File

@@ -0,0 +1,13 @@
package com.iconplus.smartproc.repository;
import com.iconplus.smartproc.model.entity.DrpDokumen;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface DrpDokumenRepository extends JpaRepository<DrpDokumen, Long> {
List<DrpDokumen> findByDrpIdAndIsDeleteFalse(Long drpId);
}

View File

@@ -17,15 +17,17 @@ public interface DrpRepository extends JpaRepository<Drp, Long> {
Optional<Drp> findByIdAndIsDeleteFalse(Long id);
Optional<Drp> findByTahunAndIsDeleteFalse(Integer tahun);
@Query(value = "SELECT d.id as id, " +
"d.tahun as tahun, " +
"d.isApprove as isApprove, " +
"d.approveDate as approveDate, " +
"d.isActive as isActive, " +
"d.isDelete as isDelete " +
"FROM Drp d" +
"FROM Drp d " +
"WHERE d.isDelete = false " +
"AND (:approveDate = '' or DATE(d.approveDate) = DATE(approveDate)) " +
// "AND (:approveDate = '' or DATE(d.approveDate) = DATE(approveDate)) " +
"ORDER BY d.id")
Page<DrpView> findByIsDeleteFalse(Timestamp approveDate,
Pageable pageable);