|
@ -168,7 +168,6 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
|
|
*/
|
|
*/
|
|
public MixEnvelop queryPatientBaseInfo(String nameOrIdcard, int page, int size, String sorts)throws Exception{
|
|
public MixEnvelop queryPatientBaseInfo(String nameOrIdcard, int page, int size, String sorts)throws Exception{
|
|
List<Map<String, Object>> result = new ArrayList<>();
|
|
List<Map<String, Object>> result = new ArrayList<>();
|
|
String param = null == nameOrIdcard ? "": nameOrIdcard;
|
|
|
|
String sql = "SELECT\n" +
|
|
String sql = "SELECT\n" +
|
|
"\tID AS \"id\",\n" +
|
|
"\tID AS \"id\",\n" +
|
|
"\tidcard AS \"idcard\",\n" +
|
|
"\tidcard AS \"idcard\",\n" +
|
|
@ -196,8 +195,9 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
|
|
"\tNAME LIKE '%"+nameOrIdcard+"%'\n" +
|
|
"\tNAME LIKE '%"+nameOrIdcard+"%'\n" +
|
|
"OR idcard LIKE '%"+nameOrIdcard+"%'\n";
|
|
"OR idcard LIKE '%"+nameOrIdcard+"%'\n";
|
|
}
|
|
}
|
|
sql+="ORDER BY\n" +
|
|
|
|
"\tcreate_time DESC";
|
|
|
|
|
|
/*sql+="ORDER BY\n" +
|
|
|
|
"\tcreate_time DESC"*/;
|
|
|
|
result = hibenateUtils.createSQLQuery(sql,page,size);
|
|
String countSql = "select count(id) from base_patient where 1=1 " ;
|
|
String countSql = "select count(id) from base_patient where 1=1 " ;
|
|
if (StringUtils.isNoneBlank(nameOrIdcard)){
|
|
if (StringUtils.isNoneBlank(nameOrIdcard)){
|
|
countSql+= " and name like '%" + nameOrIdcard + "%' or idcard like '%" + nameOrIdcard + "%' ";
|
|
countSql+= " and name like '%" + nameOrIdcard + "%' or idcard like '%" + nameOrIdcard + "%' ";
|
|
@ -208,7 +208,6 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
MixEnvelop envelop = new MixEnvelop();
|
|
MixEnvelop envelop = new MixEnvelop();
|
|
result = hibenateUtils.createSQLQuery(sql,page,size);
|
|
|
|
envelop.setDetailModelList(result);
|
|
envelop.setDetailModelList(result);
|
|
envelop.setTotalCount(count.intValue());
|
|
envelop.setTotalCount(count.intValue());
|
|
envelop.setCurrPage(page);
|
|
envelop.setCurrPage(page);
|