BUG优化

dev
xiepeng 2024-04-29 17:54:21 +08:00
parent 58fc5c5043
commit 7d88371eb2
11 changed files with 136 additions and 78 deletions

View File

@ -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<PageData> 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);

View File

@ -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"));

View File

@ -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<PageData> 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);

View File

@ -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<PageData> 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");

View File

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

View File

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

View File

@ -53,7 +53,8 @@
DELETEOR,
DELETEORNAME,
DELETTIME,
ARCHIVES_TYPE
ARCHIVES_TYPE,
REVERT
</sql>
<!-- 字段值定义 -->
@ -101,7 +102,8 @@
#{DELETEOR},
#{DELETEORNAME},
#{DELETTIME},
#{ARCHIVES_TYPE}
#{ARCHIVES_TYPE},
#{REVERT}
</sql>
@ -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}
</update>
@ -265,7 +268,6 @@
<select id="datalistPage" parameterType="page" resultType="pd">
select
f.*,
case when f.DUE_DATE &lt; NOW() then 0 else 1 end as DUE_DATE_TYPE,
v1.PLATE_NUMBER,
o.ISSCRAP AS OPEAR_ISSCRAP,
btmf.ISSCRAP AS FREIGHT_ISSCRAP,
@ -298,15 +300,8 @@
<if test="pd.PLATE_NUMBER != null and pd.PLATE_NUMBER != ''">
and v1.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%')
</if>
<if test="pd.DUE_DATE_TYPE != null and pd.DUE_DATE_TYPE != ''">
-- 添加条件只有当当前时间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
<if test="pd.REVERT != null and pd.REVERT != ''">
and f.REVERT = #{pd.REVERT}
</if>
ORDER BY f.CREATTIME DESC
</select>

View File

@ -33,7 +33,8 @@
ISDELETE,
CREATOR,
CREATORNAME,
CREATTIME
CREATTIME,
REVERT
</sql>
<!-- 字段值 -->
@ -61,7 +62,8 @@
#{ISDELETE},
#{CREATOR},
#{CREATORNAME},
#{CREATTIME}
#{CREATTIME},
#{REVERT}
</sql>
<!-- 新增-->
@ -113,7 +115,8 @@
ARCHIVES_TYPE = #{ARCHIVES_TYPE},
OPERATOR = #{OPERATOR},
OPERATORNAME = #{OPERATORNAME},
OPERATTIME = #{OPERATTIME}
OPERATTIME = #{OPERATTIME},
REVERT = #{REVERT}
where
INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID}
</update>
@ -160,7 +163,6 @@
select
b.NAME,
f.*,
case when f.DUE_DATE &lt; 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 @@
<if test="pd.REMINDER_STATUS != null and pd.REMINDER_STATUS != ''">
and f.REMINDER_STATUS = #{pd.REMINDER_STATUS}
</if>
<if test="pd.DUE_DATE_TYPE != null and pd.DUE_DATE_TYPE != ''">
and case when f.DUE_DATE &lt; NOW() then 0 else 1 end = #{pd.DUE_DATE_TYPE}
<if test="pd.REVERT != null and pd.REVERT != ''">
and f.REVERT = #{pd.REVERT}
</if>
ORDER BY f.OPERATTIME DESC
</select>

View File

@ -34,7 +34,8 @@
ISDELETE,
CREATOR,
CREATORNAME,
CREATTIME
CREATTIME,
REVERT
</sql>
<!-- 字段值 -->
@ -63,7 +64,8 @@
#{ISDELETE},
#{CREATOR},
#{CREATORNAME},
#{CREATTIME}
#{CREATTIME},
#{REVERT}
</sql>
<!-- 新增-->
@ -116,7 +118,8 @@
NOTES = #{NOTES},
OPERATOR = #{OPERATOR},
OPERATORNAME = #{OPERATORNAME},
OPERATTIME = #{OPERATTIME}
OPERATTIME = #{OPERATTIME},
REVERT = #{REVERT}
where
INSURE_ID = #{INSURE_ID}
</update>
@ -190,7 +193,7 @@
select
f.*,
DATE_FORMAT(f.PROCESSING_DATE,'%Y') as PROCESSING_DATE_YEAR,
case when f.DUE_DATE &lt; NOW() then 0 else 1 end as DUE_DATE_TYPE,
/*case when f.DUE_DATE &lt; NOW() then 0 else 1 end as DUE_DATE_TYPE,*/
v1.PLATE_NUMBER
from
<include refid="tableName"></include>
@ -223,8 +226,8 @@
<if test="pd.PLATE_NUMBER != null and pd.PLATE_NUMBER != ''">
and v1.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%')
</if>
<if test="pd.DUE_DATE_TYPE != null and pd.DUE_DATE_TYPE != ''">
and case when f.DUE_DATE &lt; NOW() then 0 else 1 end = #{pd.DUE_DATE_TYPE}
<if test="pd.REVERT != null and pd.REVERT != ''">
and f.REVERT = #{pd.REVERT}
</if>
ORDER BY f.CREATTIME DESC
</select>

View File

@ -52,7 +52,8 @@
DELETEOR,
DELETEORNAME,
DELETTIME,
ARCHIVES_TYPE
ARCHIVES_TYPE,
REVERT
</sql>
<!-- 字段值定义 -->
@ -99,7 +100,8 @@
#{DELETEOR},
#{DELETEORNAME},
#{DELETTIME},
#{ARCHIVES_TYPE}
#{ARCHIVES_TYPE},
#{REVERT}
</sql>
<!-- 新增-->
@ -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}
</update>
@ -224,7 +227,6 @@
<select id="datalistPage" parameterType="page" resultType="pd">
select
f.*,
case when f.DUE_DATE &lt; NOW() then 0 else 1 end as DUE_DATE_TYPE,
v1.PLATE_NUMBER,
o.ISSCRAP AS OPEAR_ISSCRAP,
btmf.ISSCRAP AS FREIGHT_ISSCRAP,
@ -258,15 +260,8 @@
<if test="pd.PLATE_NUMBER != null and pd.PLATE_NUMBER != ''">
and v1.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%')
</if>
<if test="pd.DUE_DATE_TYPE != null and pd.DUE_DATE_TYPE != ''">
-- 添加条件只有当当前时间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
<if test="pd.REVERT != null and pd.REVERT != ''">
and f.REVERT = #{pd.REVERT}
</if>
ORDER BY f.CREATTIME DESC
</select>

View File

@ -49,7 +49,8 @@
DELETEOR,
DELETEORNAME,
DELETTIME,
ARCHIVES_TYPE
ARCHIVES_TYPE,
REVERT
</sql>
<!-- 字段值 -->
@ -93,7 +94,8 @@
#{DELETEOR},
#{DELETEORNAME},
#{DELETTIME},
#{ARCHIVES_TYPE}
#{ARCHIVES_TYPE},
#{REVERT}
</sql>
@ -141,7 +143,8 @@
NOTES = #{NOTES},
OPERATOR = #{OPERATOR},
OPERATORNAME = #{OPERATORNAME},
OPERATTIME = #{OPERATTIME}
OPERATTIME = #{OPERATTIME},
REVERT = #{REVERT}
where
OPERATIONS_ID = #{OPERATIONS_ID}
</update>
@ -250,15 +253,8 @@
<if test="pd.PLATE_NUMBER != null and pd.PLATE_NUMBER != ''">
and v1.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%')
</if>
<if test="pd.DUE_DATE_TYPE != null and pd.DUE_DATE_TYPE != ''">
-- 添加条件只有当当前时间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
<if test="pd.REVERT != null and pd.REVERT != ''">
and f.REVERT = #{pd.REVERT}
</if>
ORDER BY f.CREATTIME DESC
</select>
@ -267,7 +263,6 @@
select
b.NAME AS CYCLE_NAME,
f.*,
case when f.DUE_DATE &lt; 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 @@
<if test="pd.PLATE_NUMBER != null and pd.PLATE_NUMBER != ''">
and v1.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%')
</if>
<if test="pd.DUE_DATE_TYPE != null and pd.DUE_DATE_TYPE != ''">
-- 添加条件只有当当前时间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 &lt; NOW() then 0 else 1 end = #{pd.DUE_DATE_TYPE}
<if test="pd.REVERT != null and pd.REVERT != ''">
and f.REVERT = #{pd.REVERT}
</if>
ORDER BY f.CREATTIME DESC
</select>