diff --git a/src/main/java/com/zcloud/controller/beidou/BeidouController.java b/src/main/java/com/zcloud/controller/beidou/BeidouController.java index 56f2c47..295ccb7 100644 --- a/src/main/java/com/zcloud/controller/beidou/BeidouController.java +++ b/src/main/java/com/zcloud/controller/beidou/BeidouController.java @@ -104,6 +104,13 @@ public class BeidouController extends BaseController { } operatingVehiclesService.edit(resData); } + if(DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay()) && DateUtil.compareDate(DateUtil.getDay(),pd.getString("REMINDER_DATE"))) { + pd.put("REVERT", 2); + } else if (DateUtil.compareDate(DateUtil.getDay(),pd.getString("DUE_DATE"))) { + pd.put("REVERT", 0); + } else if (DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay())) { + pd.put("REVERT", 1); + } beidouService.save(pd); map.put("pd", pd); map.put("result", errInfo); @@ -165,6 +172,13 @@ public class BeidouController extends BaseController { } operatingVehiclesService.edit(resData); } + if(DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay()) && DateUtil.compareDate(DateUtil.getDay(),pd.getString("REMINDER_DATE"))) { + pd.put("REVERT", 2); + } else if (DateUtil.compareDate(DateUtil.getDay(),pd.getString("DUE_DATE"))) { + pd.put("REVERT", 0); + } else if (DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay())) { + pd.put("REVERT", 1); + } beidouService.edit(pd); map.put("pd", pd); map.put("result", errInfo); @@ -213,7 +227,6 @@ public class BeidouController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID page.setPd(pd); List varList = beidouService.list(page); //列出Question列表 - varList.stream().anyMatch(data -> { if ("1".equals(data.getString("OPEAR_ISSCRAP")) || "1".equals(data.getString("FREIGHT_ISSCRAP"))) { data.put("ARCHIVES_TYPE", "1"); @@ -222,14 +235,6 @@ public class BeidouController extends BaseController { } return false; }); - /*for (PageData operation : varList) { - if("1".equals(operation.get("OPEAR_ISSCRAP")) || "1".equals(operation.get("FREIGHT_ISSCRAP"))) { - operation.put("ARCHIVES_TYPE", "1"); - } - if("1".equals(operation.get("OPEAR_ISASSIGNED")) || "1".equals(operation.get("FREIGHT_ISASSIGNED"))) { - operation.put("ARCHIVES_TYPE", "2"); - } - }*/ map.put("varList", varList); map.put("page", page); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java b/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java index bbefd73..b1acf22 100644 --- a/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java +++ b/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java @@ -67,6 +67,13 @@ public class InspectAnnuallyController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID pd.put("ARCHIVES_TYPE", "0"); //档案状态 pd.put("VEHICLE", pd.get("PLATE_NUMBER")); + if(DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay()) && DateUtil.compareDate(DateUtil.getDay(),pd.getString("REMINDER_DATE"))) { + pd.put("REVERT", 2); + } else if (DateUtil.compareDate(DateUtil.getDay(),pd.getString("DUE_DATE"))) { + pd.put("REVERT", 0); + } else if (DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay())) { + pd.put("REVERT", 1); + } inspectAnnuallyService.save(pd); map.put("pd", pd); map.put("result", errInfo); @@ -114,6 +121,13 @@ public class InspectAnnuallyController extends BaseController { pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id pd.put("OPERATORNAME", Jurisdiction.getName()); //修改人 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + if(DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay()) && DateUtil.compareDate(DateUtil.getDay(),pd.getString("REMINDER_DATE"))) { + pd.put("REVERT", 2); + } else if (DateUtil.compareDate(DateUtil.getDay(),pd.getString("DUE_DATE"))) { + pd.put("REVERT", 0); + } else if (DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay())) { + pd.put("REVERT", 1); + } inspectAnnuallyService.edit(pd); map.put("pd", pd); map.put("result", errInfo); @@ -198,10 +212,9 @@ public class InspectAnnuallyController extends BaseController { vehicle.put("OPERATING_ID", pd.get("VEHICLE")); vehicle.put("CORPINFO_ID", pd.get("CORPINFO_ID")); PageData pageData = operatingVehiclesService.findById(vehicle); - BeanUtil.copyProperties(pageData,pd); - /*pd.put("VEHICLE_BRAND", pageData.get("VEHICLE_BRAND"));*/ + pd.put("VEHICLE_BRAND", pageData.get("VEHICLE_BRAND")); pd.put("VEHICLE_TYPE", pageData.get("VEHICLE_MODEL")); - /*pd.put("PLATE_NUMBER", pageData.get("PLATE_NUMBER"));*/ + pd.put("PLATE_NUMBER", pageData.get("PLATE_NUMBER")); } else { vehicle.put("FREIGHTTRAILER_ID", pd.get("VEHICLE")); vehicle.put("CORPINFO_ID", pd.get("CORPINFO_ID")); diff --git a/src/main/java/com/zcloud/controller/insure/InsureController.java b/src/main/java/com/zcloud/controller/insure/InsureController.java index f19bac0..99fdb58 100644 --- a/src/main/java/com/zcloud/controller/insure/InsureController.java +++ b/src/main/java/com/zcloud/controller/insure/InsureController.java @@ -62,6 +62,13 @@ public class InsureController extends BaseController { pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID pd.put("VEHICLE", pd.getString("PLATE_NUMBER")); + if(DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay()) && DateUtil.compareDate(DateUtil.getDay(),pd.getString("REMINDER_DATE"))) { + pd.put("REVERT", 2); + } else if (DateUtil.compareDate(DateUtil.getDay(),pd.getString("DUE_DATE"))) { + pd.put("REVERT", 0); + } else if (DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay())) { + pd.put("REVERT", 1); + } insureService.save(pd); map.put("pd", pd); map.put("result", errInfo); @@ -110,6 +117,13 @@ public class InsureController extends BaseController { pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id pd.put("OPERATORNAME", Jurisdiction.getName()); //修改人 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + if(DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay()) && DateUtil.compareDate(DateUtil.getDay(),pd.getString("REMINDER_DATE"))) { + pd.put("REVERT", 2); + } else if (DateUtil.compareDate(DateUtil.getDay(),pd.getString("DUE_DATE"))) { + pd.put("REVERT", 0); + } else if (DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay())) { + pd.put("REVERT", 1); + } insureService.edit(pd); map.put("pd", pd); map.put("result", errInfo); @@ -158,6 +172,17 @@ public class InsureController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID page.setPd(pd); List varList = insureService.list(page); //列出Question列表 + // 到期状态 + varList.stream().forEach(data -> { + if(DateUtil.compareDate(data.getString("DUE_DATE"),DateUtil.getDay()) && DateUtil.compareDate(DateUtil.getDay(),data.getString("REMINDER_DATE"))) { + data.put("DUE_DATE_TYPE", 2); + } else if (DateUtil.compareDate(DateUtil.getDay(),data.getString("DUE_DATE"))) { + data.put("DUE_DATE_TYPE", 0); + } else if (DateUtil.compareDate(data.getString("DUE_DATE"),DateUtil.getDay())) { + data.put("DUE_DATE_TYPE", 1); + } + }); + map.put("varList", varList); map.put("page", page); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java b/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java index d9f3407..8b6ac26 100644 --- a/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java +++ b/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java @@ -61,6 +61,13 @@ public class MaintenanceController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID pd.put("ARCHIVES_TYPE", "0"); //档案状态 pd.put("VEHICLE", pd.get("PLATE_NUMBER")); //档案状态 + if(DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay()) && DateUtil.compareDate(DateUtil.getDay(),pd.getString("REMINDER_DATE"))) { + pd.put("REVERT", 2); + } else if (DateUtil.compareDate(DateUtil.getDay(),pd.getString("DUE_DATE"))) { + pd.put("REVERT", 0); + } else if (DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay())) { + pd.put("REVERT", 1); + } maintenanceService.save(pd); map.put("pd", pd); map.put("result", errInfo); @@ -108,6 +115,13 @@ public class MaintenanceController extends BaseController { pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id pd.put("OPERATORNAME", Jurisdiction.getName()); //修改人 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + if(DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay()) && DateUtil.compareDate(DateUtil.getDay(),pd.getString("REMINDER_DATE"))) { + pd.put("REVERT", 2); + } else if (DateUtil.compareDate(DateUtil.getDay(),pd.getString("DUE_DATE"))) { + pd.put("REVERT", 0); + } else if (DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay())) { + pd.put("REVERT", 1); + } maintenanceService.edit(pd); map.put("pd", pd); map.put("result", errInfo); @@ -156,7 +170,6 @@ public class MaintenanceController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID page.setPd(pd); List varList = maintenanceService.list(page); //列出Question列表 - varList.stream().anyMatch(data -> { if ("1".equals(data.getString("OPEAR_ISSCRAP")) || "1".equals(data.getString("FREIGHT_ISSCRAP"))) { data.put("ARCHIVES_TYPE", "2"); diff --git a/src/main/java/com/zcloud/controller/operations/OperationsController.java b/src/main/java/com/zcloud/controller/operations/OperationsController.java index 77c9177..7daf26e 100644 --- a/src/main/java/com/zcloud/controller/operations/OperationsController.java +++ b/src/main/java/com/zcloud/controller/operations/OperationsController.java @@ -61,6 +61,13 @@ public class OperationsController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID pd.put("ARCHIVES_TYPE", "0"); //档案状态 pd.put("VEHICLE", pd.get("PLATE_NUMBER")); + if(DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay()) && DateUtil.compareDate(DateUtil.getDay(),pd.getString("REMINDER_DATE"))) { + pd.put("REVERT", 2); + } else if (DateUtil.compareDate(DateUtil.getDay(),pd.getString("DUE_DATE"))) { + pd.put("REVERT", 0); + } else if (DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay())) { + pd.put("REVERT", 1); + } operationsService.save(pd); map.put("pd", pd); map.put("result", errInfo); @@ -108,6 +115,13 @@ public class OperationsController extends BaseController { pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id pd.put("OPERATORNAME", Jurisdiction.getName()); //修改人 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + if(DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay()) && DateUtil.compareDate(DateUtil.getDay(),pd.getString("REMINDER_DATE"))) { + pd.put("REVERT", 2); + } else if (DateUtil.compareDate(DateUtil.getDay(),pd.getString("DUE_DATE"))) { + pd.put("REVERT", 0); + } else if (DateUtil.compareDate(pd.getString("DUE_DATE"),DateUtil.getDay())) { + pd.put("REVERT", 1); + } operationsService.edit(pd); map.put("pd", pd); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java b/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java index c8091d2..d6657a9 100644 --- a/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java +++ b/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java @@ -57,10 +57,13 @@ public class TaxationManageController extends BaseController { pd.put("ARCHIVES_TYPE", "0"); //档案状态 if ("".equals(pd.getString("EXPIRE_STATUS"))) { String expireDate = pd.getString("EXPIRE_DATE"); + String ReminderData = pd.getString("REMINDER_DATA"); String day = DateUtil.getDay(); - if (DateUtil.compareDate(expireDate, day)) { + if (DateUtil.compareDate(expireDate, day) && DateUtil.compareDate(day, ReminderData)) { + pd.put("EXPIRE_STATUS", "2"); + } else if (DateUtil.compareDate(expireDate, day)) { pd.put("EXPIRE_STATUS", "1"); - } else { + } else if (DateUtil.compareDate(day, expireDate)) { pd.put("EXPIRE_STATUS", "0"); } } @@ -110,11 +113,13 @@ public class TaxationManageController extends BaseController { pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人名字 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 String expireDate = pd.getString("EXPIRE_DATE"); + String ReminderData = pd.getString("REMINDER_DATA"); String day = DateUtil.getDay(); - boolean flag = DateUtil.compareDate(expireDate, day); - if (flag) { + if (DateUtil.compareDate(expireDate, day) && DateUtil.compareDate(day, ReminderData)) { + pd.put("EXPIRE_STATUS", "2"); + } else if (DateUtil.compareDate(expireDate, day)) { pd.put("EXPIRE_STATUS", "1"); - } else { + } else if (DateUtil.compareDate(day, expireDate)) { pd.put("EXPIRE_STATUS", "0"); } taxationManageService.edit(pd); diff --git a/src/main/resources/mybatis/datasource/beidou/BeidouMapper.xml b/src/main/resources/mybatis/datasource/beidou/BeidouMapper.xml index 4e17bc9..2ae86bb 100644 --- a/src/main/resources/mybatis/datasource/beidou/BeidouMapper.xml +++ b/src/main/resources/mybatis/datasource/beidou/BeidouMapper.xml @@ -53,7 +53,8 @@ DELETEOR, DELETEORNAME, DELETTIME, - ARCHIVES_TYPE + ARCHIVES_TYPE, + REVERT @@ -101,7 +102,8 @@ #{DELETEOR}, #{DELETEORNAME}, #{DELETTIME}, - #{ARCHIVES_TYPE} + #{ARCHIVES_TYPE}, + #{REVERT} @@ -152,7 +154,8 @@ OPERATOR = #{OPERATOR}, OPERATORNAME = #{OPERATORNAME}, OPERATTIME = #{OPERATTIME}, - ARCHIVES_TYPE = #{ARCHIVES_TYPE} + ARCHIVES_TYPE = #{ARCHIVES_TYPE}, + REVERT = #{REVERT} where BEIDOU_ID = #{BEIDOU_ID} @@ -265,7 +268,6 @@ diff --git a/src/main/resources/mybatis/datasource/inspectAnnually/InspectAnnuallyMapper.xml b/src/main/resources/mybatis/datasource/inspectAnnually/InspectAnnuallyMapper.xml index aa1b6e7..7f0346a 100644 --- a/src/main/resources/mybatis/datasource/inspectAnnually/InspectAnnuallyMapper.xml +++ b/src/main/resources/mybatis/datasource/inspectAnnually/InspectAnnuallyMapper.xml @@ -33,7 +33,8 @@ ISDELETE, CREATOR, CREATORNAME, - CREATTIME + CREATTIME, + REVERT @@ -61,7 +62,8 @@ #{ISDELETE}, #{CREATOR}, #{CREATORNAME}, - #{CREATTIME} + #{CREATTIME}, + #{REVERT} @@ -113,7 +115,8 @@ ARCHIVES_TYPE = #{ARCHIVES_TYPE}, OPERATOR = #{OPERATOR}, OPERATORNAME = #{OPERATORNAME}, - OPERATTIME = #{OPERATTIME} + OPERATTIME = #{OPERATTIME}, + REVERT = #{REVERT} where INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID} @@ -160,7 +163,6 @@ select b.NAME, f.*, - case when f.DUE_DATE < NOW() then 0 else 1 end as DUE_DATE_TYPE, v1.PLATE_NUMBER, o.ISSCRAP AS OPEAR_ISSCRAP, btmf.ISSCRAP AS FREIGHT_ISSCRAP, @@ -191,8 +193,8 @@ and f.REMINDER_STATUS = #{pd.REMINDER_STATUS} - - and case when f.DUE_DATE < NOW() then 0 else 1 end = #{pd.DUE_DATE_TYPE} + + and f.REVERT = #{pd.REVERT} ORDER BY f.OPERATTIME DESC diff --git a/src/main/resources/mybatis/datasource/insure/InsureMapper.xml b/src/main/resources/mybatis/datasource/insure/InsureMapper.xml index df3e443..f9b57f4 100644 --- a/src/main/resources/mybatis/datasource/insure/InsureMapper.xml +++ b/src/main/resources/mybatis/datasource/insure/InsureMapper.xml @@ -34,7 +34,8 @@ ISDELETE, CREATOR, CREATORNAME, - CREATTIME + CREATTIME, + REVERT @@ -63,7 +64,8 @@ #{ISDELETE}, #{CREATOR}, #{CREATORNAME}, - #{CREATTIME} + #{CREATTIME}, + #{REVERT} @@ -116,7 +118,8 @@ NOTES = #{NOTES}, OPERATOR = #{OPERATOR}, OPERATORNAME = #{OPERATORNAME}, - OPERATTIME = #{OPERATTIME} + OPERATTIME = #{OPERATTIME}, + REVERT = #{REVERT} where INSURE_ID = #{INSURE_ID} @@ -190,7 +193,7 @@ select f.*, DATE_FORMAT(f.PROCESSING_DATE,'%Y') as PROCESSING_DATE_YEAR, - case when f.DUE_DATE < NOW() then 0 else 1 end as DUE_DATE_TYPE, + /*case when f.DUE_DATE < NOW() then 0 else 1 end as DUE_DATE_TYPE,*/ v1.PLATE_NUMBER from @@ -223,8 +226,8 @@ and v1.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%') - - and case when f.DUE_DATE < NOW() then 0 else 1 end = #{pd.DUE_DATE_TYPE} + + and f.REVERT = #{pd.REVERT} ORDER BY f.CREATTIME DESC diff --git a/src/main/resources/mybatis/datasource/maintenance/MaintenanceMapper.xml b/src/main/resources/mybatis/datasource/maintenance/MaintenanceMapper.xml index bb37554..c1afe36 100644 --- a/src/main/resources/mybatis/datasource/maintenance/MaintenanceMapper.xml +++ b/src/main/resources/mybatis/datasource/maintenance/MaintenanceMapper.xml @@ -52,7 +52,8 @@ DELETEOR, DELETEORNAME, DELETTIME, - ARCHIVES_TYPE + ARCHIVES_TYPE, + REVERT @@ -99,7 +100,8 @@ #{DELETEOR}, #{DELETEORNAME}, #{DELETTIME}, - #{ARCHIVES_TYPE} + #{ARCHIVES_TYPE}, + #{REVERT} @@ -151,7 +153,8 @@ OPERATOR = #{OPERATOR}, OPERATORNAME = #{OPERATORNAME}, OPERATTIME = #{OPERATTIME}, - ARCHIVES_TYPE = #{ARCHIVES_TYPE} + ARCHIVES_TYPE = #{ARCHIVES_TYPE}, + REVERT = #{REVERT} where MAINTENANCE_ID = #{MAINTENANCE_ID} @@ -224,7 +227,6 @@ diff --git a/src/main/resources/mybatis/datasource/operations/OperationsMapper.xml b/src/main/resources/mybatis/datasource/operations/OperationsMapper.xml index 5e12bff..788e496 100644 --- a/src/main/resources/mybatis/datasource/operations/OperationsMapper.xml +++ b/src/main/resources/mybatis/datasource/operations/OperationsMapper.xml @@ -49,7 +49,8 @@ DELETEOR, DELETEORNAME, DELETTIME, - ARCHIVES_TYPE + ARCHIVES_TYPE, + REVERT @@ -93,7 +94,8 @@ #{DELETEOR}, #{DELETEORNAME}, #{DELETTIME}, - #{ARCHIVES_TYPE} + #{ARCHIVES_TYPE}, + #{REVERT} @@ -141,7 +143,8 @@ NOTES = #{NOTES}, OPERATOR = #{OPERATOR}, OPERATORNAME = #{OPERATORNAME}, - OPERATTIME = #{OPERATTIME} + OPERATTIME = #{OPERATTIME}, + REVERT = #{REVERT} where OPERATIONS_ID = #{OPERATIONS_ID} @@ -250,15 +253,8 @@ and v1.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%') - - -- 添加条件:只有当当前时间(NOW())处于提醒时间段内时,才会返回相应的记录。 - -- 提醒时间段是由两个日期定义的: - -- 1. 提前提醒的日期,即从DUE_DATE字段指定的到期日期减去REMINDER_DAYS字段指定的天数。 - -- 2. 到期日期(DUE_DATE字段)本身。 - -- DATE_SUB函数用于计算提前提醒的日期。它从到期日期中减去一定天数,以得到提醒开始的日期。 - -- DATE_SUB的第一个参数是到期日期(f.DUE_DATE), - -- 第二个参数INTERVAL f.REMINDER_DAYS DAY指定从到期日期向前推算的天数(f.REMINDER_DAYS字段的值) - and NOW() BETWEEN DATE_SUB(f.DUE_DATE, INTERVAL f.REMINDER_DAYS DAY) AND f.DUE_DATE + + and f.REVERT = #{pd.REVERT} ORDER BY f.CREATTIME DESC @@ -267,7 +263,6 @@ select b.NAME AS CYCLE_NAME, f.*, - case when f.DUE_DATE < NOW() then 0 else 1 end as DUE_DATE_TYPE, v1.PLATE_NUMBER, v1.TRAFFIC_TYPE, o.ISSCRAP AS OPEAR_ISSCRAP, @@ -302,15 +297,8 @@ and v1.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%') - - -- 添加条件:只有当当前时间(NOW())处于提醒时间段内时,才会返回相应的记录。 - -- 提醒时间段是由两个日期定义的: - -- 1. 提前提醒的日期,即从DUE_DATE字段指定的到期日期减去REMINDER_DAYS字段指定的天数。 - -- 2. 到期日期(DUE_DATE字段)本身。 - -- DATE_SUB函数用于计算提前提醒的日期。它从到期日期中减去一定天数,以得到提醒开始的日期。 - -- DATE_SUB的第一个参数是到期日期(f.DUE_DATE), - -- 第二个参数INTERVAL f.REMINDER_DAYS DAY指定从到期日期向前推算的天数(f.REMINDER_DAYS字段的值) - and case when f.DUE_DATE < NOW() then 0 else 1 end = #{pd.DUE_DATE_TYPE} + + and f.REVERT = #{pd.REVERT} ORDER BY f.CREATTIME DESC