|
@ -470,9 +470,10 @@ public class PrescriptionExpressageService extends BaseService {
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> getEsListByIDCardOrSSC(String keyWord, Integer page, Integer pageSize) {
|
|
|
public Map<String, Object> getEsListByIDCardOrSSC(String keyWord, Integer page, Integer pageSize) {
|
|
|
|
|
|
Patient p = null;
|
|
|
Map<String,Object> map = new HashedMap();
|
|
|
if (StringUtils.isNotBlank(keyWord)) {
|
|
|
p = patientDao.findByIdcard(keyWord);
|
|
|
if (p == null) {
|
|
@ -480,6 +481,26 @@ public class PrescriptionExpressageService extends BaseService {
|
|
|
}
|
|
|
if (p != null) {
|
|
|
int start = (page - 1) * pageSize;
|
|
|
|
|
|
String sqlTotal ="SELECT count(1) AS total" +
|
|
|
" FROM " +
|
|
|
" wlyy_prescription p " +
|
|
|
" JOIN wlyy_prescription_pay py ON py.prescription_code = p.`code` " +
|
|
|
" WHERE " +
|
|
|
" p.patient = '" + p.getCode() + "' " +
|
|
|
" AND p.`status`>=50 " +
|
|
|
" ORDER BY p.`status` ASC ";
|
|
|
List<Map<String, Object>> totallist = jdbcTemplate.queryForList(sqlTotal);
|
|
|
Long total = (Long)totallist.get(0).get("total");
|
|
|
|
|
|
if(total==0){
|
|
|
map.put("list",null);
|
|
|
map.put("page",page);
|
|
|
map.put("total",0);
|
|
|
map.put("records",0);
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
String sql = "SELECT " +
|
|
|
" py.charge_no AS chargeNo, " +
|
|
|
" p.patient_name AS patientName, " +
|
|
@ -497,10 +518,17 @@ public class PrescriptionExpressageService extends BaseService {
|
|
|
" ORDER BY p.`status` ASC " +
|
|
|
" LIMIT " + start + "," + pageSize;
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
return list;
|
|
|
|
|
|
map.put("page",page);
|
|
|
map.put("records",total);
|
|
|
map.put("list",list);
|
|
|
double t = (double)total;
|
|
|
map.put("total",Math.ceil(t/pageSize));
|
|
|
|
|
|
return map;
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
public String saveDrugDelivery(String doctor, String prescriptionCode, String reasonCode, String reasonName, String reason) {
|
|
@ -578,7 +606,29 @@ public class PrescriptionExpressageService extends BaseService {
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> getPresEsPayList(String keyWord, String state, String type, String startDate, String endDate, String operator,String flag,Integer page, Integer pageSize) {
|
|
|
public Map<String, Object> getPresEsPayList(String keyWord, String state, String type, String startDate, String endDate, String operator,String flag,Integer page, Integer pageSize) {
|
|
|
|
|
|
Map<String, Object> map = new HashedMap();
|
|
|
|
|
|
String totalSql = "SELECT count(1) AS total " +
|
|
|
" FROM " +
|
|
|
" wlyy_prescription p " +
|
|
|
" JOIN wlyy_prescription_pay py ON py.prescription_code = p.`code` " +
|
|
|
" WHERE" +
|
|
|
" 1=1 ";
|
|
|
totalSql = setSQL( totalSql,keyWord,state,type,startDate,endDate,operator,flag);
|
|
|
totalSql += " AND p.`status`>=50 ";
|
|
|
List<Map<String, Object>> totallist = jdbcTemplate.queryForList(totalSql);
|
|
|
Long total = (Long)totallist.get(0).get("total");
|
|
|
|
|
|
if(total==0){
|
|
|
map.put("list",null);
|
|
|
map.put("page",page);
|
|
|
map.put("total",0);
|
|
|
map.put("records",0);
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
int start = (page - 1) * pageSize;
|
|
|
String sql = "SELECT " +
|
|
|
" py.charge_no AS chargeNo, " +
|
|
@ -601,7 +651,14 @@ public class PrescriptionExpressageService extends BaseService {
|
|
|
" ORDER BY py.create_time DESC " +
|
|
|
" LIMIT " + start + "," + pageSize;
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
return list;
|
|
|
|
|
|
map.put("page",page);
|
|
|
map.put("records",total);
|
|
|
map.put("list",list);
|
|
|
double t = (double)total;
|
|
|
map.put("total",Math.ceil(t/pageSize));
|
|
|
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
public String setSQL(String sql,String keyWord, String state, String type, String startDate, String endDate,String operator,String flag){
|