|
|
@ -497,66 +497,69 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
qw.apply(StringUtils.isNotEmpty(dueStartDate), "date_format (p.dueDate,'%Y-%m-%d') >= date_format('" + dueStartDate + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(dueEndDate), "date_format (p.dueDate,'%Y-%m-%d') <= date_format('" + dueEndDate + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
List<String> monthHeadAndLast = getMonthHeadAndLast(new Date()); |
|
|
|
String head = monthHeadAndLast.get(0); |
|
|
|
String last = monthHeadAndLast.get(1); |
|
|
|
// List<String> monthHeadAndLast = getMonthHeadAndLast(new Date());
|
|
|
|
// String head = monthHeadAndLast.get(0);
|
|
|
|
// String last = monthHeadAndLast.get(1);
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
String actualStartDate = pagerQuery.getActualStartDate(); |
|
|
|
String actualEndDate = pagerQuery.getActualEndDate(); |
|
|
|
try { |
|
|
|
Date headT = sdf.parse(head); |
|
|
|
Date lastT = sdf.parse(last); |
|
|
|
Date ast = null; |
|
|
|
Date aed = null; |
|
|
|
if (StringUtils.isNotBlank(actualStartDate)) { |
|
|
|
ast = sdf.parse(actualStartDate); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(actualEndDate)) { |
|
|
|
aed = sdf.parse(actualEndDate); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isBlank(actualStartDate) && StringUtils.isNotBlank(actualEndDate)) { |
|
|
|
if (aed.before(lastT)) { |
|
|
|
qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(actualEndDate), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + actualEndDate + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
} else { |
|
|
|
qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + last + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
} |
|
|
|
} else if (StringUtils.isBlank(actualEndDate) && StringUtils.isNotBlank(actualStartDate)) { |
|
|
|
if (headT.before(ast)) { |
|
|
|
qw.apply(StringUtils.isNotEmpty(actualStartDate), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + actualStartDate + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + last + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
} else { |
|
|
|
qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + last + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
} |
|
|
|
} else if (StringUtils.isNotBlank(actualStartDate) && StringUtils.isNotBlank(actualEndDate)) { |
|
|
|
if (headT.before(ast) && aed.before(lastT)) { |
|
|
|
qw.apply(StringUtils.isNotEmpty(actualStartDate), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + actualStartDate + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(actualEndDate), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + actualEndDate + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
} else if (headT.before(ast) && !aed.before(lastT)) { |
|
|
|
qw.apply(StringUtils.isNotEmpty(actualStartDate), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + actualStartDate + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + lastT + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
} else if (!headT.before(ast) && aed.before(lastT)) { |
|
|
|
qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(actualEndDate), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + actualEndDate + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
} else if (!headT.before(ast) && !aed.before(lastT)) { |
|
|
|
qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + last + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (ParseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
qw.apply(StringUtils.isNotEmpty(actualStartDate), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + actualStartDate + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(actualEndDate), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + actualEndDate + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
// try {
|
|
|
|
// Date headT = sdf.parse(head);
|
|
|
|
// Date lastT = sdf.parse(last);
|
|
|
|
// Date ast = null;
|
|
|
|
// Date aed = null;
|
|
|
|
// if (StringUtils.isNotBlank(actualStartDate)) {
|
|
|
|
// ast = sdf.parse(actualStartDate);
|
|
|
|
// }
|
|
|
|
// if (StringUtils.isNotBlank(actualEndDate)) {
|
|
|
|
// aed = sdf.parse(actualEndDate);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// if (StringUtils.isBlank(actualStartDate) && StringUtils.isNotBlank(actualEndDate)) {
|
|
|
|
// if (aed.before(lastT)) {
|
|
|
|
// qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')").
|
|
|
|
// apply(StringUtils.isNotEmpty(actualEndDate), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + actualEndDate + "','%Y-%m-%d')"
|
|
|
|
// );
|
|
|
|
// } else {
|
|
|
|
// qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')").
|
|
|
|
// apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + last + "','%Y-%m-%d')"
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
// } else if (StringUtils.isBlank(actualEndDate) && StringUtils.isNotBlank(actualStartDate)) {
|
|
|
|
// if (headT.before(ast)) {
|
|
|
|
// qw.apply(StringUtils.isNotEmpty(actualStartDate), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + actualStartDate + "','%Y-%m-%d')").
|
|
|
|
// apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + last + "','%Y-%m-%d')"
|
|
|
|
// );
|
|
|
|
// } else {
|
|
|
|
// qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')").
|
|
|
|
// apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + last + "','%Y-%m-%d')"
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
// } else if (StringUtils.isNotBlank(actualStartDate) && StringUtils.isNotBlank(actualEndDate)) {
|
|
|
|
// if (headT.before(ast) && aed.before(lastT)) {
|
|
|
|
// qw.apply(StringUtils.isNotEmpty(actualStartDate), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + actualStartDate + "','%Y-%m-%d')").
|
|
|
|
// apply(StringUtils.isNotEmpty(actualEndDate), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + actualEndDate + "','%Y-%m-%d')"
|
|
|
|
// );
|
|
|
|
// } else if (headT.before(ast) && !aed.before(lastT)) {
|
|
|
|
// qw.apply(StringUtils.isNotEmpty(actualStartDate), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + actualStartDate + "','%Y-%m-%d')").
|
|
|
|
// apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + lastT + "','%Y-%m-%d')"
|
|
|
|
// );
|
|
|
|
// } else if (!headT.before(ast) && aed.before(lastT)) {
|
|
|
|
// qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')").
|
|
|
|
// apply(StringUtils.isNotEmpty(actualEndDate), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + actualEndDate + "','%Y-%m-%d')"
|
|
|
|
// );
|
|
|
|
// } else if (!headT.before(ast) && !aed.before(lastT)) {
|
|
|
|
// qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')").
|
|
|
|
// apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + last + "','%Y-%m-%d')"
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// } catch (ParseException e) {
|
|
|
|
// e.printStackTrace();
|
|
|
|
// }
|
|
|
|
|
|
|
|
String dataStartTime = pagerQuery.getDataStartTime(); |
|
|
|
String dataEndTime = pagerQuery.getDataEndTime(); |
|
|
@ -564,11 +567,6 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
apply(StringUtils.isNotEmpty(dataEndTime), "date_format (h.dataTime,'%Y-%m-%d') <= date_format('" + dataEndTime + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
qw.orderByDesc("h.dataTime"); |
|
|
|
if (StringUtils.isBlank(actualStartDate) && StringUtils.isBlank(actualEndDate)) { |
|
|
|
qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + last + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
} |
|
|
|
IPage<LoanRepaymentHistoryVo> pagging = baseMapper.monthListPage(page, qw); |
|
|
|
List<LoanRepaymentHistoryVo> records = pagging.getRecords(); |
|
|
|
records.removeAll(Collections.singleton(null)); |
|
|
|