sql=[NSStringstringWithFormat:@"SELECT * FROM %@ WHERE userUuid = '%@' AND ENABLED = 1",tableStr,[ICRUserUtilsharedInstance].userId];//@"4028b88150a987080150a987dce5007a"
//进仓库选择仓库页面第一次进入时查询的语句
sql=[NSStringstringWithFormat:@"select * from %@ a where enabled = '1' and exists (select 1 from UserWarehouse b where b.warehouseUuid = a.uuid and b.userUuid = '%@' and b.enabled='1')",tableStr,[ICRUserUtilsharedInstance].userId];//@"4028b88150a987080150a987dce5007a"
sql=[NSStringstringWithFormat:@"SELECT * FROM %@ WHERE (NAME LIKE '%%%@%%' or CODE LIKE '%%%@%%') AND ENABLED = 1 ORDER BY %@",tableStr,titleStr,titleStr,@"code"];
...
...
@@ -229,9 +230,10 @@
}
}else{
if(titleStr.length>0){
sql=[NSStringstringWithFormat:@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' or CODE LIKE '%%%@%%' ORDER BY %@",tableStr,titleStr,titleStr,@"uuid"];
// NSString *aaa = [NSString stringWithFormat:@"select * from %@ a where enabled = '1' and exists (select 1 from UserWarehouse b where b.warehouseUuid = a.uuid and b.userUuid = '%@' and b.enabled='1')", titleStr,[ICRUserUtil sharedInstance].userId];
sql=[NSStringstringWithFormat:@"SELECT * from %@ a WHERE (NAME LIKE '%%%@%%' or CODE LIKE '%%%@%%') AND enabled = '1' AND EXISTS (SELECT 1 FROM UserWarehouse b WHERE b.warehouseUuid = a.uuid AND b.userUuid = '%@' AND b.enabled='1')",tableStr,titleStr,titleStr,[ICRUserUtilsharedInstance].userId];
}else{
sql=[NSStringstringWithFormat:@"SELECT * FROM %@ ORDER BY %@",tableStr,@"uuid"];
sql=[NSStringstringWithFormat:@"select * from %@ a where enabled = '1' and exists (select 1 from UserWarehouse b where b.warehouseUuid = a.uuid and b.userUuid = '%@' and b.enabled='1')",tableStr,[ICRUserUtilsharedInstance].userId];