|  | @ -15,20 +15,20 @@ import java.util.List;
 | 
	
		
			
				|  |  |  * 处方取码
 | 
	
		
			
				|  |  |  */
 | 
	
		
			
				|  |  | public interface PrescriptionDispensaryCodeDao extends PagingAndSortingRepository<PrescriptionDispensaryCode, Long>, JpaSpecificationExecutor<PrescriptionDispensaryCode> {
 | 
	
		
			
				|  |  |     @Query("from PrescriptionDispensaryCode where code=?1 order by createTime  limit 0,1")
 | 
	
		
			
				|  |  |     @Query(nativeQuery = true, value = "select * from wlyy_prescription_dispensary_code  where code=?1 order by create_time desc limit 0,1 ")
 | 
	
		
			
				|  |  |     PrescriptionDispensaryCode finByCode(String code);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    @Query("select  count(1) from wlyy_prescription_dispensary_code p1 \n" +
 | 
	
		
			
				|  |  |     //    @Query("select  count(1) from wlyy_prescription_dispensary_code p1 \n" +
 | 
	
		
			
				|  |  | //            "LEFT JOIN wlyy_prescription p2 on p1.prescription_Code = p2.code where p2.status in(21,20,100) and p2.patient =?1 ")
 | 
	
		
			
				|  |  | //    int dispensaryCodeCount(String patientCode);
 | 
	
		
			
				|  |  |     @Query("select count(1) from PrescriptionDispensaryCode a where a.code= ?1 and a.isUse =0")
 | 
	
		
			
				|  |  |     Integer getResidentQRCodeCount(String code);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Query("select a.code from PrescriptionDispensaryCode a where a.prescriptionCode= ?1 and a.type =?2 ")
 | 
	
		
			
				|  |  |     String getCodeByPrescriptionCodeAndType(String prescriptionCode,Integer type);
 | 
	
		
			
				|  |  |     String getCodeByPrescriptionCodeAndType(String prescriptionCode, Integer type);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //    @Query("select p1 from PrescriptionInfo p1 left join Prescription p2 on p1.prescriptionCode=p2.code where p1.prescriptionCode = ?1")
 | 
	
		
			
				|  |  | //    List<PrescriptionInfo> getPrescriptionInfo(String prescriptionCode);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     PrescriptionDispensaryCode findByCodeAndIsUse(String code,Integer isUse);
 | 
	
		
			
				|  |  |     PrescriptionDispensaryCode findByCodeAndIsUse(String code, Integer isUse);
 | 
	
		
			
				|  |  | }
 |