|
@ -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
|