|
@ -333,7 +333,9 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
" t.aisles as aisles,\n" +
|
|
|
" t.capacity as capacity,\n" +
|
|
|
" t.ratio as ratio,\n" +
|
|
|
" t.cargo_capacity as cargoCapacity\n" +
|
|
|
" t.cargo_capacity as cargoCapacity,\n" +
|
|
|
" t.layer as layer,\n" +
|
|
|
" t.wayer as wayer\n" +
|
|
|
"FROM\n" +
|
|
|
" t_mediicine_device AS t where 1=1 AND t.del = 1\n";
|
|
|
|
|
@ -376,7 +378,7 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
" from " +
|
|
|
" t_mediicine_device t " +
|
|
|
" where " +
|
|
|
" 1=1 " +
|
|
|
" 1=1 and t.del = 1 " +
|
|
|
conditionSql;
|
|
|
Logger.getAnonymousLogger().info("finalCountSql="+countSql);
|
|
|
int count = jdbcTemplate.queryForObject(countSql,Integer.class);
|
|
@ -428,7 +430,9 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
" t.aisles as aisles,\n" +
|
|
|
" t.capacity as capacity,\n" +
|
|
|
" t.ratio as ratio,\n" +
|
|
|
" t.cargo_capacity as cargoCapacity\n" +
|
|
|
" t.cargo_capacity as cargoCapacity,\n" +
|
|
|
" t.layer as layer,\n" +
|
|
|
" t.wayer as wayer\n" +
|
|
|
"FROM\n" +
|
|
|
" t_mediicine_device AS t where 1=1\n";
|
|
|
|
|
@ -552,12 +556,14 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
" t.aisles as aisles,\n" +
|
|
|
" t.capacity as capacity,\n" +
|
|
|
" t.ratio as ratio,\n" +
|
|
|
" t.cargo_capacity as cargoCapacity\n" +
|
|
|
" t.cargo_capacity as cargoCapacity,\n" +
|
|
|
" t.layer as layer,\n" +
|
|
|
" t.wayer as wayer\n" +
|
|
|
"FROM\n" +
|
|
|
" t_mediicine_device AS t where\n";
|
|
|
" t_mediicine_device AS t where t.del = 1\n";
|
|
|
|
|
|
// String conditionSql = " t.id in (select du.device_id from t_mediicine_device_user du where del = 1 and ',"+userId+",' LIKE CONCAT('%,',du.user_id,',%'))";
|
|
|
String conditionSql = " t.id in (select du.device_id from t_mediicine_device_user du where del = 1 and du.user_id = '" + userId + "'";
|
|
|
String conditionSql = " and t.id in (select du.device_id from t_mediicine_device_user du where del = 1 and du.user_id = '" + userId + "'";
|
|
|
|
|
|
sql = sql + conditionSql;
|
|
|
|
|
@ -680,7 +686,7 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
JSONObject result = new JSONObject();
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
|
String sql = "select count(1) from t_mediicine_device a";
|
|
|
String sql = "select count(1) from t_mediicine_device a where a.del = 1";
|
|
|
int count = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
jsonObject.put("count", count);
|
|
|
result.put("response",ConstantUtils.SUCCESS);
|
|
@ -701,7 +707,7 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
*/
|
|
|
public JSONObject countOnline() throws Exception{
|
|
|
JSONObject result = new JSONObject();
|
|
|
String sql = "select count(1) from t_mediicine_device a where a.status = 1";
|
|
|
String sql = "select count(1) from t_mediicine_device a where a.del = 1 and a.status = 1";
|
|
|
int count = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("count",count);
|
|
@ -812,11 +818,13 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
"\tt.aisles as aisles,\n" +
|
|
|
"\tt.capacity as capacity,\n" +
|
|
|
"\tt.ratio as ratio,\n" +
|
|
|
"\tt.cargo_capacity as cargoCapacity\n" +
|
|
|
"\tt.cargo_capacity as cargoCapacity,\n" +
|
|
|
"\tt.layer as layer,\n" +
|
|
|
"\tt.wayer as wayer\n" +
|
|
|
"FROM\n" +
|
|
|
"\tt_mediicine_device t\n" +
|
|
|
"LEFT JOIN t_mediicinecabinet_inventory tmi ON t.id = tmi.id_device\n" +
|
|
|
"WHERE 1=1\n" ;
|
|
|
"WHERE 1=1 and t.del = 1\n" ;
|
|
|
if (!StringUtils.isEmpty(replenishEr)) {
|
|
|
sql +=" AND t.id in (select device_id from t_mediicine_device_user tmdu left join t_mediicine_user tmu on tmdu.user_id = tmu.id where tmdu.del = 1 and CONCAT(tmu.name,tmu.account) like '%" + replenishEr + "%')\n";
|
|
|
}
|
|
@ -896,9 +904,11 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
" t.aisles AS aisles,\n" +
|
|
|
" t.capacity AS capacity,\n" +
|
|
|
" t.ratio AS ratio,\n" +
|
|
|
" t.cargo_capacity AS cargoCapacity\n" +
|
|
|
" t.cargo_capacity AS cargoCapacity,\n" +
|
|
|
" t.layer AS layer,\n" +
|
|
|
" t.wayer AS wayer\n" +
|
|
|
"FROM\n" +
|
|
|
" t_mediicine_device AS t WHERE ',"+ ids +",' LIKE CONCAT('%,',t.id,',%')";
|
|
|
" t_mediicine_device AS t WHERE t.del = 1 and ',"+ ids +",' LIKE CONCAT('%,',t.id,',%')";
|
|
|
String sencordSql = "SELECT\n" +
|
|
|
"\ttmi.layer_no AS layerNo,\n" +
|
|
|
"\ttmi.wayer_no AS wayerNo,\n" +
|
|
@ -1014,9 +1024,11 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
" t.aisles AS aisles,\n" +
|
|
|
" t.capacity AS capacity,\n" +
|
|
|
" t.ratio AS ratio,\n" +
|
|
|
" t.cargo_capacity AS cargoCapacity\n" +
|
|
|
" t.cargo_capacity AS cargoCapacity,\n" +
|
|
|
" t.layer AS layer,\n" +
|
|
|
" t.wayer AS wayer\n" +
|
|
|
"FROM\n" +
|
|
|
" t_mediicine_device AS t WHERE 1=1";
|
|
|
" t_mediicine_device AS t WHERE 1=1 and t.del = 1";
|
|
|
|
|
|
if (!StringUtils.isEmpty(deviceId)) {
|
|
|
sql += " AND t.id = '" + deviceId + "'";
|