|
@ -29,33 +29,33 @@ public interface MediicinecabinetInventoryDao extends PagingAndSortingRepository
|
|
|
// List<MediicinecabinetInventory> findMediicinecabinetInventoriesByIdDeviceAndStateInAndDrugCodeNotNullAndAndOrgCodeNotNull(String deviceId, String[] states);
|
|
|
|
|
|
|
|
|
@Query("select sum(qty) as qty, drugId as drugId, drugCode as drugCode, orgCode as orgCode, sum(ratedInventory) as ratedInventory from MediicinecabinetInventory where idDevice = ?1 and state in (?2) and drugCode is not null and orgCode is not null group by drugCode,orgCode")
|
|
|
List<Map<String, Object>> selectsomethingBysomeCondition(String deviceId, String states);
|
|
|
@Query("select sum(qty) as qty, drugId as drugId, drugCode as drugCode, orgCode as orgCode, sum(ratedInventory) as ratedInventory from MediicinecabinetInventory where idDevice = ?1 and (state = ?2 or state = ?3) and drugCode is not null and orgCode is not null group by drugCode,orgCode")
|
|
|
List<Map<String, Object>> selectsomethingBysomeCondition(String deviceId, String firstState, String secondState);
|
|
|
|
|
|
|
|
|
@Query("select sum(qty) as qty, drugId as drugId, drugCode as drugCode, orgCode as orgCode, sum(ratedInventory) as ratedInventory from MediicinecabinetInventory where equNum = ?1 and state in (?2) and drugCode is not null and orgCode is not null group by drugCode,orgCode")
|
|
|
List<Map<String, Object>> selectsomethingBysomeConditionWithEquNum(String equNum, String states);
|
|
|
@Query("select sum(qty) as qty, drugId as drugId, drugCode as drugCode, orgCode as orgCode, sum(ratedInventory) as ratedInventory from MediicinecabinetInventory where equNum = ?1 and (state = ?2 or state = ?3) and drugCode is not null and orgCode is not null group by drugCode,orgCode")
|
|
|
List<Map<String, Object>> selectsomethingBysomeConditionWithEquNum(String equNum, String firstState, String secondState);
|
|
|
|
|
|
@Query(" select sum(qty) as qty " +
|
|
|
"from MediicinecabinetInventory " +
|
|
|
"where orgCode = ?1 " +
|
|
|
"and drugCode = ?2 " +
|
|
|
"and idDevice = ?3 " +
|
|
|
"and state in (?4) " +
|
|
|
"and (state = ?4 or state = ?5) " +
|
|
|
"and orgCode is not null and drugCode is not null ")
|
|
|
Integer sumqty(String orgCode, String drugCode, String deviceId, String state);
|
|
|
Integer sumqty(String orgCode, String drugCode, String deviceId, String firstState, String secondState);
|
|
|
|
|
|
@Query(" select a " +
|
|
|
"from MediicinecabinetInventory a " +
|
|
|
"where a.orgCode = ?1 " +
|
|
|
"and a.drugCode = ?2 " +
|
|
|
"and a.idDevice = ?3 " +
|
|
|
"and a.state in (?4) " +
|
|
|
"and (a.state = ?4 or a.state = ?5) " +
|
|
|
"and a.orgCode is not null and a.drugCode is not null ")
|
|
|
List<MediicinecabinetInventory> getMediicinecabinetInventoriesByOrgCodeAndDurgCode(String orgCode, String drugCode, String deviceId, String state);
|
|
|
List<MediicinecabinetInventory> getMediicinecabinetInventoriesByOrgCodeAndDurgCode(String orgCode, String drugCode, String deviceId, String firstState, String secondState);
|
|
|
|
|
|
|
|
|
@Query("select sum(qty) as qty from MediicinecabinetInventory where equNum = ?1 and state in (?2) and drugCode is not null and orgCode is not null")
|
|
|
Integer sumInventoryWithEquNum(String equNum, String states);
|
|
|
@Query("select sum(qty) as qty from MediicinecabinetInventory where equNum = ?1 and (state = ?2 or state = ?3) and drugCode is not null and orgCode is not null")
|
|
|
Integer sumInventoryWithEquNum(String equNum, String firstState, String secondState);
|
|
|
|
|
|
}
|