chenweida 8 rokov pred
rodič
commit
bb2c0adf72

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDispensaryCodeDao.java

@ -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);
}

+ 9 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionLogController.java

@ -95,19 +95,16 @@ public class PrescriptionLogController extends BaseController {
                prescriptionLogs.add(prescriptionLog);
            }
            //排序
            Collections.sort(prescriptionLogs, new Comparator<PrescriptionLog>() {
                public int compare(PrescriptionLog o1, PrescriptionLog o2) {
            Collections.sort(prescriptionLogs, (o1, o2) -> {
                long map1value = o1.getCreateTime().getTime();
                long map2value = o2.getCreateTime().getTime();
                    long map1value = o1.getCreateTime().getTime();
                    long map2value = o2.getCreateTime().getTime();
                    if (map1value - map2value > 0) {
                        return sort == 1 ? -1 : 1;
                    } else if (map1value - map2value < 0) {
                        return sort == 1 ? 1 : -1;
                    } else {
                        return 0;
                    }
                if (map1value - map2value > 0) {
                    return sort == 1 ? -1 : 1;
                } else if (map1value - map2value < 0) {
                    return sort == 1 ? 1 : -1;
                } else {
                    return 0;
                }
            });
            if (prescriptionLogs != null) {

+ 9 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionLogController.java

@ -68,18 +68,16 @@ public class PatientPrescriptionLogController extends BaseController {
                prescriptionLogs.add(prescriptionLog);
            }
            //排序
            Collections.sort(prescriptionLogs, new Comparator<PrescriptionLog>() {
                public int compare(PrescriptionLog o1, PrescriptionLog o2) {
                    long map1value = o1.getCreateTime().getTime();
                    long map2value = o2.getCreateTime().getTime();
            Collections.sort(prescriptionLogs, (o1, o2) -> {
                long map1value = o1.getCreateTime().getTime();
                long map2value = o2.getCreateTime().getTime();
                    if (map1value - map2value > 0) {
                        return sort == 1 ? -1 : 1;
                    } else if (map1value - map2value < 0) {
                        return sort == 1 ? 1 : -1;
                    } else {
                        return 0;
                    }
                if (map1value - map2value > 0) {
                    return sort == 1 ? -1 : 1;
                } else if (map1value - map2value < 0) {
                    return sort == 1 ? 1 : -1;
                } else {
                    return 0;
                }
            });
            if (prescriptionLogs != null) {