|
@ -4648,8 +4648,9 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
* @param deviceId
|
|
* @param deviceId
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public PageEnvelop selectByIdPage(String deviceId,Integer page,Integer pageSize){
|
|
|
|
page = page>0?page-1:0;
|
|
|
|
|
|
public JSONArray selectByIdPage(String deviceId, Integer start, Integer end){
|
|
|
|
String layerSql = " and t.layer_no BETWEEN "+start+" and "+end+" ";
|
|
|
|
|
|
String sql = " SELECT\n" +
|
|
String sql = " SELECT\n" +
|
|
"t.id AS id,\n" +
|
|
"t.id AS id,\n" +
|
|
"t.id_device AS idDevice,\n" +
|
|
"t.id_device AS idDevice,\n" +
|
|
@ -4685,20 +4686,20 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
"FROM\n" +
|
|
"FROM\n" +
|
|
"\tt_mediicinecabinet_inventory t left join t_mediicine_drugs d on d.id = t.drug_id \n" +
|
|
"\tt_mediicinecabinet_inventory t left join t_mediicine_drugs d on d.id = t.drug_id \n" +
|
|
"WHERE\n" +
|
|
"WHERE\n" +
|
|
"\tt.id_device = '" +deviceId + "'\n" +
|
|
|
|
|
|
"\tt.id_device = '" +deviceId + "'\n" +layerSql+
|
|
"ORDER BY\n" +
|
|
"ORDER BY\n" +
|
|
"cast(t.layer_no AS UNSIGNED),cast(t.wayer_no AS UNSIGNED)\n";
|
|
"cast(t.layer_no AS UNSIGNED),cast(t.wayer_no AS UNSIGNED)\n";
|
|
sql = sql+sqlTab+" limit "+page*pageSize+","+pageSize;
|
|
|
|
|
|
sql = sql+sqlTab;
|
|
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
Long total = jdbcTemplate.queryForObject(sqlCount+sqlTab,Long.class);
|
|
|
|
|
|
// Long total = jdbcTemplate.queryForObject(sqlCount+sqlTab,Long.class);
|
|
{
|
|
{
|
|
sql = "SELECT\n" +
|
|
sql = "SELECT\n" +
|
|
"\tlayer_no AS layerNo\n" +
|
|
"\tlayer_no AS layerNo\n" +
|
|
"FROM\n" +
|
|
"FROM\n" +
|
|
"\tt_mediicinecabinet_inventory\n" +
|
|
|
|
|
|
"\tt_mediicinecabinet_inventory t\n" +
|
|
"WHERE\n" +
|
|
"WHERE\n" +
|
|
"\tid_device = '" + deviceId +"'\n" +
|
|
|
|
|
|
"\tid_device = '" + deviceId +"'\n" +layerSql+
|
|
"GROUP BY\n" +
|
|
"GROUP BY\n" +
|
|
"\tlayer_no\n" +
|
|
"\tlayer_no\n" +
|
|
"ORDER BY\n" +
|
|
"ORDER BY\n" +
|
|
@ -4740,7 +4741,7 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
object.put(id,jsonArray);
|
|
object.put(id,jsonArray);
|
|
array.add(object);
|
|
array.add(object);
|
|
}
|
|
}
|
|
return PageEnvelop.getSuccessListWithPage("success",array,page,pageSize,total);
|
|
|
|
|
|
return array;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|