|
|
@@ -5,6 +5,7 @@ import com.ffii.fpsms.modules.master.entity.Items |
|
|
import com.ffii.fpsms.modules.stock.entity.projection.InventoryInfo |
|
|
import com.ffii.fpsms.modules.stock.entity.projection.InventoryInfo |
|
|
import org.springframework.data.domain.Page |
|
|
import org.springframework.data.domain.Page |
|
|
import org.springframework.data.domain.Pageable |
|
|
import org.springframework.data.domain.Pageable |
|
|
|
|
|
import org.springframework.data.jpa.repository.Query |
|
|
import org.springframework.stereotype.Repository |
|
|
import org.springframework.stereotype.Repository |
|
|
import java.io.Serializable |
|
|
import java.io.Serializable |
|
|
import java.util.Optional |
|
|
import java.util.Optional |
|
|
@@ -13,7 +14,12 @@ import java.util.Optional |
|
|
interface InventoryRepository: AbstractRepository<Inventory, Long> { |
|
|
interface InventoryRepository: AbstractRepository<Inventory, Long> { |
|
|
fun findInventoryInfoByDeletedIsFalse(): List<InventoryInfo> |
|
|
fun findInventoryInfoByDeletedIsFalse(): List<InventoryInfo> |
|
|
|
|
|
|
|
|
fun findInventoryInfoByItemCodeContainsAndItemNameContainsAndItemTypeContainsAndDeletedIsFalse(code: String, name: String, type: String, pageable: Pageable): Page<InventoryInfo> |
|
|
|
|
|
|
|
|
@Query("SELECT i FROM Inventory i " + |
|
|
|
|
|
"WHERE (:code IS NULL OR i.item.code LIKE CONCAT('%', :code, '%')) " + |
|
|
|
|
|
"AND (:name IS NULL OR i.item.name LIKE CONCAT('%', :name, '%')) " + |
|
|
|
|
|
"AND (:type IS NULL OR :type = '' OR i.item.type = :type) " + |
|
|
|
|
|
"AND i.deleted = false") |
|
|
|
|
|
fun findInventoryInfoByItemCodeContainsAndItemNameContainsAndItemTypeAndDeletedIsFalse(code: String, name: String, type: String, pageable: Pageable): Page<InventoryInfo> |
|
|
|
|
|
|
|
|
fun findInventoryInfoByItemIdInAndDeletedIsFalse(itemIds: List<Serializable>): List<InventoryInfo> |
|
|
fun findInventoryInfoByItemIdInAndDeletedIsFalse(itemIds: List<Serializable>): List<InventoryInfo> |
|
|
|
|
|
|
|
|
|