|
|
@ -259,7 +259,7 @@ public class CtrCntrlQueryRepository{ |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
public List<AnlsHstryModel> cntrlBasNormalHstryList(AnlsHstryGroupModel rq, List<ComIdntfBas> idntfList, List<FltPlanBas> basResult, List<FltPlanBas> pilotResult){ |
|
|
|
public PageImpl<AnlsHstryModel> cntrlBasNormalHstryList(AnlsHstryGroupModel rq, Pageable pageable, List<ComIdntfBas> idntfList, List<FltPlanBas> basResult, List<FltPlanBas> pilotResult){ |
|
|
|
|
|
|
|
|
|
|
|
QCtrCntrlBas qCntrlBasEntity = QCtrCntrlBas.ctrCntrlBas; |
|
|
|
QCtrCntrlBas qCntrlBasEntity = QCtrCntrlBas.ctrCntrlBas; |
|
|
|
QCtrCntrlHstryArea qCntrlHstryAreaEntity = QCtrCntrlHstryArea.ctrCntrlHstryArea; |
|
|
|
QCtrCntrlHstryArea qCntrlHstryAreaEntity = QCtrCntrlHstryArea.ctrCntrlHstryArea; |
|
|
@ -293,7 +293,7 @@ public List<AnlsHstryModel> cntrlBasNormalHstryList(AnlsHstryGroupModel rq, List |
|
|
|
builder.and(qCntrlBasEntity.idntfNum.like("%" + rq.getSearch1() + "%")); |
|
|
|
builder.and(qCntrlBasEntity.idntfNum.like("%" + rq.getSearch1() + "%")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ArrayList<AnlsHstryModel> result = new ArrayList<AnlsHstryModel>(); |
|
|
|
List<AnlsHstryModel> result = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
List<AnlsHstryModel> queryList = query.select(Projections.bean(AnlsHstryModel.class , |
|
|
|
List<AnlsHstryModel> queryList = query.select(Projections.bean(AnlsHstryModel.class , |
|
|
|
qCntrlBasEntity.cntrlId, |
|
|
|
qCntrlBasEntity.cntrlId, |
|
|
@ -340,6 +340,8 @@ public List<AnlsHstryModel> cntrlBasNormalHstryList(AnlsHstryGroupModel rq, List |
|
|
|
.or(basBuilder) |
|
|
|
.or(basBuilder) |
|
|
|
.or(pilotBuilder))) |
|
|
|
.or(pilotBuilder))) |
|
|
|
.orderBy(qCntrlBasEntity.cntrlStDt.asc()) |
|
|
|
.orderBy(qCntrlBasEntity.cntrlStDt.asc()) |
|
|
|
|
|
|
|
.offset(pageable.getOffset()) |
|
|
|
|
|
|
|
.limit(pageable.getPageSize()) |
|
|
|
.fetch(); |
|
|
|
.fetch(); |
|
|
|
|
|
|
|
|
|
|
|
for(AnlsHstryModel model: queryList) { |
|
|
|
for(AnlsHstryModel model: queryList) { |
|
|
@ -370,7 +372,7 @@ public List<AnlsHstryModel> cntrlBasNormalHstryList(AnlsHstryGroupModel rq, List |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
return new PageImpl<>(result, pageable, result.size()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<AnlsHstryModel> cntrlBasNormalList(AnlsHstryRqModel rq, String idntfNum){ |
|
|
|
public List<AnlsHstryModel> cntrlBasNormalList(AnlsHstryRqModel rq, String idntfNum){ |
|
|
@ -465,14 +467,17 @@ public List<AnlsHstryModel> cntrlBasNormalHstryList(AnlsHstryGroupModel rq, List |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<AnlsHstryModel> cntrlBasNormalPlanHstryList(AnlsHstryGroupModel rq, int planSno){ |
|
|
|
public long cntrlBasNormalHstryCount(AnlsHstryGroupModel rq, List<ComIdntfBas> idntfList, List<FltPlanBas> basResult, List<FltPlanBas> pilotResult){ |
|
|
|
|
|
|
|
|
|
|
|
QCtrCntrlBas qCntrlBasEntity = QCtrCntrlBas.ctrCntrlBas; |
|
|
|
QCtrCntrlBas qCntrlBasEntity = QCtrCntrlBas.ctrCntrlBas; |
|
|
|
QCtrCntrlHstryArea qCntrlHstryAreaEntity = QCtrCntrlHstryArea.ctrCntrlHstryArea; |
|
|
|
QCtrCntrlHstryArea qCntrlHstryAreaEntity = QCtrCntrlHstryArea.ctrCntrlHstryArea; |
|
|
|
QFltPlanCtrCntrlRel qFltPlanCtrCntrlRelEntity = QFltPlanCtrCntrlRel.fltPlanCtrCntrlRel; |
|
|
|
QFltPlanCtrCntrlRel qFltPlanCtrCntrlRelEntity = QFltPlanCtrCntrlRel.fltPlanCtrCntrlRel; |
|
|
|
|
|
|
|
QFltPlanBas qFltPlanBasEntity = QFltPlanBas.fltPlanBas; |
|
|
|
|
|
|
|
|
|
|
|
BooleanBuilder builder = new BooleanBuilder(); |
|
|
|
BooleanBuilder builder = new BooleanBuilder(); |
|
|
|
|
|
|
|
BooleanBuilder idntfBuilder = new BooleanBuilder(); |
|
|
|
|
|
|
|
BooleanBuilder basBuilder = new BooleanBuilder(); |
|
|
|
|
|
|
|
BooleanBuilder pilotBuilder = new BooleanBuilder(); |
|
|
|
|
|
|
|
|
|
|
|
Calendar end = Calendar.getInstance(); |
|
|
|
Calendar end = Calendar.getInstance(); |
|
|
|
end.setTime(DateUtils.stringToDate(rq.getEndDate())); |
|
|
|
end.setTime(DateUtils.stringToDate(rq.getEndDate())); |
|
|
@ -481,15 +486,24 @@ public List<AnlsHstryModel> cntrlBasNormalHstryList(AnlsHstryGroupModel rq, List |
|
|
|
builder.and(qCntrlBasEntity.cntrlStDt.after(DateUtils.stringToDate(rq.getStDate()))); |
|
|
|
builder.and(qCntrlBasEntity.cntrlStDt.after(DateUtils.stringToDate(rq.getStDate()))); |
|
|
|
builder.and(qCntrlBasEntity.cntrlEndDt.before(endDate)); |
|
|
|
builder.and(qCntrlBasEntity.cntrlEndDt.before(endDate)); |
|
|
|
|
|
|
|
|
|
|
|
builder.and(qFltPlanCtrCntrlRelEntity.planSno.eq(planSno)); |
|
|
|
|
|
|
|
builder.and(qCntrlBasEntity.statusCd.eq("99")); |
|
|
|
builder.and(qCntrlBasEntity.statusCd.eq("99")); |
|
|
|
|
|
|
|
for(ComIdntfBas list : idntfList) { |
|
|
|
|
|
|
|
idntfBuilder.and(qCntrlBasEntity.idntfNum.eq(list.getIdntfNum())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for(FltPlanBas list : basResult) { |
|
|
|
|
|
|
|
basBuilder.and(qFltPlanCtrCntrlRelEntity.planSno.eq(list.getPlanSno())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for(FltPlanBas list : pilotResult) { |
|
|
|
|
|
|
|
pilotBuilder.and(qFltPlanCtrCntrlRelEntity.planSno.eq(list.getPlanSno())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(rq.getSearch1())) { |
|
|
|
if(!StringUtils.isEmpty(rq.getSearch1())) { |
|
|
|
builder.and(qCntrlBasEntity.idntfNum.like("%" + rq.getSearch1() + "%")); |
|
|
|
builder.and(qCntrlBasEntity.idntfNum.like("%" + rq.getSearch1() + "%")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ArrayList<AnlsHstryModel> result = new ArrayList<AnlsHstryModel>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<AnlsHstryModel> queryList = query.select(Projections.bean(AnlsHstryModel.class , |
|
|
|
|
|
|
|
|
|
|
|
long result = query.select(Projections.bean(AnlsHstryModel.class , |
|
|
|
qCntrlBasEntity.cntrlId, |
|
|
|
qCntrlBasEntity.cntrlId, |
|
|
|
qCntrlBasEntity.idntfNum, |
|
|
|
qCntrlBasEntity.idntfNum, |
|
|
|
qCntrlBasEntity.statusCd, |
|
|
|
qCntrlBasEntity.statusCd, |
|
|
@ -526,37 +540,15 @@ public List<AnlsHstryModel> cntrlBasNormalHstryList(AnlsHstryGroupModel rq, List |
|
|
|
.on(qCntrlHstryAreaEntity.actnType.eq("01")) |
|
|
|
.on(qCntrlHstryAreaEntity.actnType.eq("01")) |
|
|
|
.leftJoin(qFltPlanCtrCntrlRelEntity) |
|
|
|
.leftJoin(qFltPlanCtrCntrlRelEntity) |
|
|
|
.on(qCntrlBasEntity.cntrlId.eq(qFltPlanCtrCntrlRelEntity.cntrlId)) |
|
|
|
.on(qCntrlBasEntity.cntrlId.eq(qFltPlanCtrCntrlRelEntity.cntrlId)) |
|
|
|
.where(builder) |
|
|
|
.leftJoin(qFltPlanBasEntity) |
|
|
|
|
|
|
|
.on(qFltPlanCtrCntrlRelEntity.planSno.eq(qFltPlanBasEntity.planSno)) |
|
|
|
|
|
|
|
.where((builder) |
|
|
|
|
|
|
|
.and( |
|
|
|
|
|
|
|
(idntfBuilder) |
|
|
|
|
|
|
|
.or(basBuilder) |
|
|
|
|
|
|
|
.or(pilotBuilder))) |
|
|
|
.orderBy(qCntrlBasEntity.cntrlStDt.asc()) |
|
|
|
.orderBy(qCntrlBasEntity.cntrlStDt.asc()) |
|
|
|
.fetch(); |
|
|
|
.fetchCount(); |
|
|
|
|
|
|
|
|
|
|
|
for(AnlsHstryModel model: queryList) { |
|
|
|
|
|
|
|
String addr = ""; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(model.getArea1())) { |
|
|
|
|
|
|
|
addr = addr + " " + model.getArea1(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(model.getArea2())) { |
|
|
|
|
|
|
|
addr = addr + " " + model.getArea2(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(model.getArea3())) { |
|
|
|
|
|
|
|
addr = addr + " " + model.getArea3(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(model.getLandNm())) { |
|
|
|
|
|
|
|
addr = addr + " " + model.getLandNm(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(model.getLandNum())) { |
|
|
|
|
|
|
|
addr = addr + " " + model.getLandNum(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
model.setStArea(addr); |
|
|
|
|
|
|
|
result.add(model); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|