|
@ -239,18 +239,19 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
|
|
|
//货道信息列表
|
|
|
public PageEnvelop cabinetInventoryPage(Integer page,Integer size,String idDevice,String startTime,String endTime){
|
|
|
String sql = "select id,id_device idDevice,state,num,layer_no layerNo,wayer_no wayerNo,qty,drug_name drugName" +
|
|
|
",cargo_capacity cargoCapacity,shelf_status shelfStatus,cargo_state cargoState,fault_state faultState" +
|
|
|
",if(fault_state='1','故障',if(fault_state='0','正常','')) faultStateNam,if(cargo_state='1','开启',if(cargo_state='0','关闭','')) cargoStateName" +
|
|
|
",if(shelf_status='1','上架',if(shelf_status='0','下架','')) shelfStatusName,delivery_address" +
|
|
|
",DATE_FORMAT(update_time,'%Y-%m-%d %H:%i:%S') updateTime";
|
|
|
String sql = "select i.id,i.id_device idDevice,i.state,i.num,i.layer_no layerNo,i.wayer_no wayerNo,i.qty,i.drug_name drugName" +
|
|
|
",i.cargo_capacity cargoCapacity,i.shelf_status shelfStatus,i.cargo_state cargoState,i.fault_state faultState" +
|
|
|
",if(i.fault_state='1','故障',if(i.fault_state='0','正常','')) faultStateNam,if(i.cargo_state='1','开启',if(i.cargo_state='0','关闭','')) cargoStateName" +
|
|
|
",if(i.shelf_status='1','上架',if(i.shelf_status='0','下架','')) shelfStatusName,d.delivery_address deliveryAddress " +
|
|
|
",DATE_FORMAT(i.update_time,'%Y-%m-%d %H:%i:%S') updateTime";
|
|
|
String countSql = "select count(id) ";
|
|
|
String filter = " from t_mediicinecabinet_inventory where id_device='"+idDevice+"' ";
|
|
|
String filter = " from t_mediicinecabinet_inventory i,t_mediicine_device d " +
|
|
|
" where i.id_device='"+idDevice+"' and i.id_device=d.id ";
|
|
|
if(!StringUtils.isEmpty(startTime)){
|
|
|
filter += " and update_time>='"+startTime+"'";
|
|
|
filter += " and i.update_time>='"+startTime+"'";
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(endTime)){
|
|
|
filter += " and update_time<='"+endTime+"'";
|
|
|
filter += " and i.update_time<='"+endTime+"'";
|
|
|
}
|
|
|
|
|
|
String orderBy = " order by fault_state desc,update_time desc limit "+(page-1)*size+","+size;
|