baolhyhzhg
2025-01-16 6969d05f6f4ef0a875756fa98a73bae5051aff88
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/repository/ContractRepository.java
@@ -127,7 +127,7 @@
     * @return
     */
    @Query(value = "SELECT CAST(SUBSTRING(contract_number, 12, 3) AS UNSIGNED) AS val FROM contract \n" +
            "WHERE sign_date LIKE CONCAT(?1, '%') AND contract_number LIKE CONCAT(?2, '%') AND contract_id != ?3 \n" +
            "WHERE SUBSTRING(contract_number, 5, 2) = SUBSTRING(?1, 3, 2) AND contract_number LIKE CONCAT(?2, '%') AND contract_id != ?3 \n" +
            "ORDER BY CAST(SUBSTRING(contract_number, 12, 3) AS UNSIGNED) DESC LIMIT 1", nativeQuery = true)
    Long countContractSort(String year, String companyCode, Long id);
@@ -136,7 +136,7 @@
     * @return
     */
    @Query(value = "SELECT CAST(SUBSTRING(contract_number, 16, 4) AS UNSIGNED) AS val FROM contract \n" +
            "WHERE sign_date LIKE CONCAT(?1, '%') AND contract_id != ?2 \n" +
            "WHERE SUBSTRING(contract_number, 5, 2) = SUBSTRING(?1, 3, 2) AND contract_id != ?2 \n" +
            "ORDER BY CAST(SUBSTRING(contract_number, 16, 4) AS UNSIGNED) DESC LIMIT 1", nativeQuery = true)
    Long countAllContractSort(String year, Long id);
}