|
@@ -119,7 +119,11 @@ public class ApiAppDeviceController {
|
|
|
@ApiOperation(value = "设备批次分页搜索列表")
|
|
|
@RequestMapping(value = "batchNum/pageQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO batchNumPageQuery(@RequestBody DeviceBathQueryParam param) {
|
|
|
- StringBuffer sql = new StringBuffer("select t1.batch_num,t1.sn,t1.deliver_time,count(0) as total,count(if(status > 0,true,null)) as in_storage,count(if(status = 0,true,null)) as transfer,t1.add_time,t1.received_place from app_device t1");
|
|
|
+ //@ToDo: 添加各种状态
|
|
|
+ StringBuffer sql = new StringBuffer();
|
|
|
+ sql.append("select t1.batch_num,t1.sn,t1.deliver_time,count(0) as total,count(if(status = 1,true,null)) as in_storage,count(if(status = 2,true,null)) as transfer,");
|
|
|
+ sql.append("count(if(status = 3,true,null)) as out_storage,count(if(status = 3,true,null)) as handle,");
|
|
|
+ sql.append("t1.add_time,t1.received_place from app_device t1");
|
|
|
|
|
|
if (!StringUtils.isEmpty(param.getBatchNum())) {
|
|
|
sql.append(" where t1.batch_num like '%").append(param.getBatchNum()).append("%'");
|