|
@ -169,7 +169,7 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
|
|
|
*/
|
|
|
public MixEnvelop queryPatientBaseInfo(String nameOrIdcard, int page, int size, String sorts) throws Exception {
|
|
|
List<Map<String, Object>> result = new ArrayList<>();
|
|
|
String param = null == nameOrIdcard ? "" : nameOrIdcard;
|
|
|
|
|
|
String sql = "SELECT\n" +
|
|
|
"\tID AS \"id\",\n" +
|
|
|
"\tidcard AS \"idcard\",\n" +
|
|
@ -200,9 +200,7 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
|
|
|
sql += "ORDER BY\n" +
|
|
|
"\tcreate_time DESC";
|
|
|
String condition = "";
|
|
|
if (StringUtils.isNoneBlank(param)) {
|
|
|
condition = "where name like '%" + param + "%' or idcard like '%" + param + "%'";
|
|
|
}
|
|
|
|
|
|
String countSql = "select count(id) from base_patient " + condition;
|
|
|
Long count = jdbcTemplate.queryForObject(countSql, Long.class);
|
|
|
if (count <= 0) {
|