| | |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsInspectStVo> queryPageList(EimsInspectStBo bo, PageQuery pageQuery) { |
| | | QueryWrapper<EimsInspectSt> lqw = buildWrapper(bo); |
| | | Page<EimsInspectStVo> result = baseMapper.selectInspStList(pageQuery.build(), lqw); |
| | | // 填充数据 |
| | | fillStData(result); |
| | | return TableDataInfo.build(result); |
| | | // 月视图 |
| | | if(bo.getViewMode().equals("Month")){ |
| | | QueryWrapper<EimsInspectSt> qw = buildWrapper(bo); |
| | | Page<EimsInspectStVo> result = baseMapper.selectInspStList(pageQuery.build(), qw); |
| | | // 填充数据 |
| | | fillStData(result); |
| | | return TableDataInfo.build(result); |
| | | // 日视图 |
| | | }else if(bo.getViewMode().equals("Day")){ |
| | | Page<EimsInspectStVo> result = recordMapper.selectInspRecordDayList(pageQuery.build(), buildGroupWrapper(bo)); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | private void fillStData(Page<EimsInspectStVo> result) { |
| | |
| | | |
| | | } |
| | | |
| | | private QueryWrapper<EimsInspectSt> buildGroupWrapper(EimsInspectStBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | QueryWrapper<EimsInspectSt> qw = Wrappers.query(); |
| | | qw.like(StringUtils.isNotBlank(bo.getTitle()), "CONCAT(DATE_FORMAT(ir.plan_time, '%Y%m%d'), equ.equ_name)", bo.getTitle()); |
| | | qw.like(StringUtils.isNotBlank(bo.getEquName()), "equ.equ_name", bo.getEquName()); |
| | | qw.like(StringUtils.isNotBlank(bo.getAssetNo()), "equ.asset_no", bo.getAssetNo()); |
| | | qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null, |
| | | "ir.plan_time", params.get("beginPlanTime"), params.get("endPlanTime")); |
| | | qw.eq(bo.getInspUser() != null, "ir.insp_user", bo.getInspUser()); |
| | | qw.eq(bo.getVerifyUser() != null, "ir.verify_user", bo.getVerifyUser()); |
| | | qw.eq(bo.getStatus() != null, "ir.status", bo.getStatus()); |
| | | qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null, |
| | | "ir.plan_time", params.get("beginPlanTime"), params.get("endPlanTime")); |
| | | qw.groupBy(Arrays.asList("ir.equ_id","ir.plan_time")); |
| | | qw.orderByDesc( "ir.plan_time"); |
| | | |
| | | return qw; |
| | | } |
| | | |
| | | /** |
| | | * 查询符合条件的点检汇总列表 |
| | | * |