Explorar o código

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceController.java
mengkang %!s(int64=5) %!d(string=hai) anos
pai
achega
2380c004d0

+ 24 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceController.java

@ -282,4 +282,28 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
    @PostMapping(value = IotRequestMapping.Platform.findInterfaceLog)
    @ApiOperation(value = "根据接口名称分页查询接口日志信息", notes = "根据接口名称分页查询接口日志信息")
    public MixEnvelop<IotInterfaceLogVO, IotInterfaceLogVO> findInterfaceLog(@ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                                                 @RequestParam(value = "page", required = false) Integer page,
                                                                             @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                                                 @RequestParam(value = "size", required = false) Integer size,
                                                                             @ApiParam(name = "interfaceName", value = "接口名称", defaultValue = "")
                                                                                 @RequestParam(value = "interfaceName") String interfaceName) {
        try {
            if(page == null|| page < 0){
                page = 1;
            }
            if(size == null){
                size = 10;
            }
            return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_find, iotInterfaceLogService.findInterfaceLog(page,size,interfaceName));
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 7 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceQualityInspectionPlanService.java

@ -229,6 +229,7 @@ public class IotDeviceQualityInspectionPlanService extends BaseJpaService<IotDev
     * @return
     */
    public MixEnvelop<IotDeviceQualityInspectionPlanVO, IotDeviceQualityInspectionPlanVO> queryPage(String status, String orderNo, String startTime, String endTime, Integer page, Integer size){
//        SELECT  b.* FROM (SELECT  c.* from iot_device_quality_inspection_plan c  WHERE c.del=1 ORDER BY c.plan_time DESC ) b GROUP BY b.order_no;
        StringBuffer sql = new StringBuffer("SELECT  c.* from iot_device_quality_inspection_plan c  WHERE c.del=1 ");
        List<Object> args = new ArrayList<>();
@ -248,8 +249,12 @@ public class IotDeviceQualityInspectionPlanService extends BaseJpaService<IotDev
            sql.append(" and c.plan_time<=? ");
            args.add(endTime);
        }
        sql.append(" GROUP BY c.order_no ORDER BY c.plan_time DESC limit ").append((page-1)*size).append(",").append(size);
        List<IotDeviceQualityInspectionPlanDO> list = jdbcTempalte.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotDeviceQualityInspectionPlanDO.class));
        sql.append(" ORDER BY c.plan_time DESC ");
//    "SELECT  b.* FROM ("+sql+")"+" b GROUP BY b.order_no limit ";
        StringBuffer sql1= new StringBuffer("SELECT  b.* FROM (");
        sql1.append(sql).append(") b GROUP BY b.order_no limit ").append((page-1)*size).append(",").append(size);
        List<IotDeviceQualityInspectionPlanDO> list = jdbcTempalte.query(sql1.toString(),args.toArray(),new BeanPropertyRowMapper(IotDeviceQualityInspectionPlanDO.class));
        long count = list.size();
        //DO转VO