Sfoglia il codice sorgente

fix the 1000 consoCode and code

master
parent
commit
ebfe0481d4
1 ha cambiato i file con 21 aggiunte e 8 eliminazioni
  1. +21
    -8
      src/main/java/com/ffii/fpsms/modules/pickOrder/entity/PickOrderRepository.kt

+ 21
- 8
src/main/java/com/ffii/fpsms/modules/pickOrder/entity/PickOrderRepository.kt Vedi File

@@ -45,14 +45,27 @@ interface PickOrderRepository : AbstractRepository<PickOrder, Long> {
pageable: Pageable, pageable: Pageable,
): Page<PickOrderInfo> ): Page<PickOrderInfo>


@Query("""
select po.consoCode from PickOrder po where po.consoCode like :prefix% order by po.consoCode desc limit 1
""")
fun findLatestConsoCodeByPrefix(prefix: String): String?
@Query("""
select po.code from PickOrder po where po.code like :prefix% order by po.code desc limit 1
""")
fun findLatestCodeByPrefix(prefix: String): String?
@Query(
"""
SELECT po.consoCode FROM pick_order po
WHERE po.consoCode LIKE CONCAT(:prefix, '%')
ORDER BY CAST(SUBSTRING_INDEX(po.consoCode, '-', -1) AS UNSIGNED) DESC
LIMIT 1
""",
nativeQuery = true,
)
fun findLatestConsoCodeByPrefix(@Param("prefix") prefix: String): String?

@Query(
"""
SELECT po.code FROM pick_order po
WHERE po.code LIKE CONCAT(:prefix, '%')
ORDER BY CAST(SUBSTRING_INDEX(po.code, '-', -1) AS UNSIGNED) DESC
LIMIT 1
""",
nativeQuery = true,
)
fun findLatestCodeByPrefix(@Param("prefix") prefix: String): String?
fun findAllByIdInAndStatus(id: List<Serializable>, status: PickOrderStatus): List<PickOrder> fun findAllByIdInAndStatus(id: List<Serializable>, status: PickOrderStatus): List<PickOrder>


fun findAllByIdInAndConsoCodeIsNullAndStatus(id: List<Serializable>, status: PickOrderStatus): List<PickOrder> fun findAllByIdInAndConsoCodeIsNullAndStatus(id: List<Serializable>, status: PickOrderStatus): List<PickOrder>


Caricamento…
Annulla
Salva