diff --git a/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java b/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java index 39fbd7d..37b95a0 100644 --- a/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java +++ b/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java @@ -56,9 +56,6 @@ public class AssignedManageController extends BaseController { pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 - pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id - pd.put("OPERATORNAME", Jurisdiction.getUsername()); // 修改人名字 - pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 pd.put("ASSIGNED_DATE", pd.get("TRANSACTION_DATE")); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("VEHICLE_TYPE",pd.get("ASSIGNED_VEHICLE_MODEL")); diff --git a/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java b/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java index cddfea7..5ab9a9a 100644 --- a/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java +++ b/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java @@ -243,20 +243,45 @@ public class FreighttTrailerController extends BaseController { String[] ArrayDATA_IDS = DATA_IDS.split(","); pd.put("ArrayDATA_IDS",ArrayDATA_IDS); } - pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); Map dataMap = new HashMap(); List titles = new ArrayList(); - titles.add("所属企业"); //1 - titles.add("风险点(单元)名称"); //2 - titles.add("所属部门"); //3 + titles.add("车牌号"); //1 + titles.add("车架号"); //2 + titles.add("车身编号"); //3 + titles.add("挂车类型"); //4 + titles.add("运营证号"); //5 + titles.add("归属部门"); //6 + titles.add("车主"); //7 + titles.add("车主电话"); //8 + titles.add("初登日期"); //9 + titles.add("发证日期"); //10 + titles.add("到期日期"); //11 + titles.add("挂车品牌"); //12 + titles.add("挂车型号"); //13 + titles.add("核定总质量"); //14 + titles.add("核定载质量"); //15 + titles.add("容积"); //16 dataMap.put("titles", titles); List varOList = freightTrailerService.listOut(pd); List varList = new ArrayList(); for(int i=0;i and f.TRANSPORT_ENTERPRISES = #{pd.TRANSPORT_ENTERPRISES} + ORDER BY f.CREATTIME desc select f.*, case when f.DUE_DATE < NOW() then 0 else 1 end as DUE_DATE_TYPE, - v1.PLATE_NUMBER + v1.PLATE_NUMBER, + case + when btsm.PLATE_NUMBER is not null then '1' + when bta.RAW_PLATE_NUMBER is not null then '2' + else f.ARCHIVES_TYPE + end as NEW_ARCHIVES_TYPE from - - f + f INNER JOIN v_traffic v1 on f.VEHICLE=v1.ID + LEFT JOIN BUS_TRAFFIC_SCRAP_MANAGEMENT btsm on v1.PLATE_NUMBER = btsm.PLATE_NUMBER + LEFT JOIN BUS_TRAFFIC_ASSIGNED bta on v1.PLATE_NUMBER = bta.RAW_PLATE_NUMBER where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID} and f.BASICINFO_LICENSE_PLATE LIKE CONCAT(CONCAT('%', #{pd.BASICINFO_LICENSE_PLATE}),'%') @@ -251,10 +296,16 @@ 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} + -- 添加条件:只有当当前时间(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 ORDER BY f.CREATTIME DESC - diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityAccidentInvestigationMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityAccidentInvestigationMapper.xml index f931e1f..9cfb0e1 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityAccidentInvestigationMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityAccidentInvestigationMapper.xml @@ -343,9 +343,10 @@ and f.USER_ID = #{pd.USER_ID} - - and f.PENALTYTIME = #{pd.PENALTYTIME} + + and f.ACCIDENTDATE = #{pd.ACCIDENTDATE} + ORDER BY f.CREATETIME DESC select - , + from f - inner join bus_corp_info b on f.CORPINFO_ID = b.CORPINFO_ID - where f.FREIGHTTRAILER_ID = #{FREIGHTTRAILER_ID} + where f.ISDELETE = '0' + and f.FREIGHTTRAILER_ID in #{item} diff --git a/src/main/resources/mybatis/datasource/maintenance/MaintenanceMapper.xml b/src/main/resources/mybatis/datasource/maintenance/MaintenanceMapper.xml index d49d5e2..a17f555 100644 --- a/src/main/resources/mybatis/datasource/maintenance/MaintenanceMapper.xml +++ b/src/main/resources/mybatis/datasource/maintenance/MaintenanceMapper.xml @@ -191,7 +191,6 @@ f.REMINDER_STATUS, (select t.FILEPATH from bus_imgfiles t where t.TYPE = 127 and t.FOREIGN_KEY = f.MAINTENANCE_ID limit 1) as MAINTENANCEINFO, f.NOTES, - f.ARCHIVES_TYPE, f.ISDELETE, f.CREATOR, f.CREATORNAME, @@ -222,11 +221,19 @@ select f.*, case when f.DUE_DATE < NOW() then 0 else 1 end as DUE_DATE_TYPE, - v1.PLATE_NUMBER + v1.PLATE_NUMBER, + case + when btsm.PLATE_NUMBER is not null then '1' + when bta.RAW_PLATE_NUMBER is not null then '2' + else f.ARCHIVES_TYPE + end as NEW_ARCHIVES_TYPE, + COALESCE(bta.RAW_PLATE_NUMBER, '0') as RAW_PLATE_NUMBER from f INNER JOIN v_traffic v1 on f.VEHICLE=v1.ID + LEFT JOIN BUS_TRAFFIC_SCRAP_MANAGEMENT btsm on v1.PLATE_NUMBER = btsm.PLATE_NUMBER + LEFT JOIN BUS_TRAFFIC_ASSIGNED bta on v1.PLATE_NUMBER = bta.RAW_PLATE_NUMBER where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID} and f.BASICINFO_LICENSE_PLATE LIKE CONCAT(CONCAT('%', #{pd.BASICINFO_LICENSE_PLATE}),'%') @@ -250,7 +257,14 @@ 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} + -- 添加条件:只有当当前时间(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 ORDER BY f.CREATTIME DESC diff --git a/src/main/resources/mybatis/datasource/operations/OperationsMapper.xml b/src/main/resources/mybatis/datasource/operations/OperationsMapper.xml index eb525c7..999e162 100644 --- a/src/main/resources/mybatis/datasource/operations/OperationsMapper.xml +++ b/src/main/resources/mybatis/datasource/operations/OperationsMapper.xml @@ -38,6 +38,7 @@ REMINDER_STATUS, OPERATIONSINFO, NOTES, + NUM, ISDELETE, CREATOR, CREATORNAME, @@ -80,6 +81,7 @@ #{REMINDER_STATUS}, #{OPERATIONSINFO}, #{NOTES}, + #{NUM}, #{ISDELETE}, #{CREATOR}, #{CREATORNAME}, @@ -122,7 +124,6 @@ update set - NUM = #{NUM}, VEHICLE_MODEL = #{VEHICLE_MODEL}, VEHICLE = #{VEHICLE}, CAR_OWNERS = #{CAR_OWNERS}, @@ -163,7 +164,6 @@ select f.OPERATIONS_ID, f.CORPINFO_ID, - f.NUM, f.VEHICLE_MODEL, f.VEHICLE, f.CAR_OWNERS, @@ -174,10 +174,10 @@ f.DUE_DATE, f.REMINDER_DAYS, f.REMINDER_DATE, + f.NUM, f.REMINDER_STATUS, (select t.FILEPATH from bus_imgfiles t where t.TYPE = 126 and t.FOREIGN_KEY = f.OPERATIONS_ID limit 1) as OPERATIONSINFO, f.NOTES, - f.ARCHIVES_TYPE, f.ISDELETE, f.CREATOR, f.CREATORNAME, @@ -209,11 +209,19 @@ f.*, case when f.DUE_DATE < NOW() then 0 else 1 end as DUE_DATE_TYPE, v1.PLATE_NUMBER, - (SELECT sd.NAME FROM sys_dictionaries sd where sd.DICTIONARIES_ID=f.CYCLE) as CYCLE_NAME + case + when btsm.PLATE_NUMBER is not null then '1' + when bta.RAW_PLATE_NUMBER is not null then '2' + else f.ARCHIVES_TYPE + end as NEW_ARCHIVES_TYPE, + COALESCE((SELECT sd.NAME FROM sys_dictionaries sd WHERE sd.DICTIONARIES_ID=f.CYCLE), '0') as CYCLE_NAME, + COALESCE(bta.RAW_PLATE_NUMBER, '0') as RAW_PLATE_NUMBER from f INNER JOIN v_traffic v1 on f.VEHICLE=v1.ID + LEFT JOIN BUS_TRAFFIC_SCRAP_MANAGEMENT btsm on v1.PLATE_NUMBER = btsm.PLATE_NUMBER + LEFT JOIN BUS_TRAFFIC_ASSIGNED bta on v1.PLATE_NUMBER = bta.RAW_PLATE_NUMBER where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID} and f.BASICINFO_LICENSE_PLATE LIKE CONCAT(CONCAT('%', #{pd.BASICINFO_LICENSE_PLATE}),'%') @@ -237,10 +245,16 @@ 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} + -- 添加条件:只有当当前时间(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 ORDER BY f.CREATTIME DESC - diff --git a/src/main/resources/mybatis/datasource/scrapManage/ScrapManage.xml b/src/main/resources/mybatis/datasource/scrapManage/ScrapManage.xml index 0e199cc..4ea6a95 100644 --- a/src/main/resources/mybatis/datasource/scrapManage/ScrapManage.xml +++ b/src/main/resources/mybatis/datasource/scrapManage/ScrapManage.xml @@ -389,6 +389,7 @@ and f.REGISTRANT LIKE CONCAT(CONCAT('%', #{pd.REGISTRANT}),'%') + ORDER BY f.CREATTIME DESC - select - - from + SELECT + f.*, + CASE + WHEN btsm.PLATE_NUMBER IS NOT NULL THEN '1' + WHEN bta.RAW_PLATE_NUMBER IS NOT NULL THEN '2' + ELSE '0' + END AS NEW_ARCHIVES_TYPE + FROM f - where f.ISDELETE = '0' - - and f.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}),'%') + LEFT JOIN BUS_TRAFFIC_SCRAP_MANAGEMENT btsm ON f.PLATE_NUMBER = btsm.PLATE_NUMBER + LEFT JOIN BUS_TRAFFIC_ASSIGNED bta ON f.PLATE_NUMBER = bta.RAW_PLATE_NUMBER + WHERE f.ISDELETE = '0' + + AND f.PLATE_NUMBER LIKE CONCAT(CONCAT('%', #{pd.PLATE_NUMBER}), '%') - - and f.VEHICLEOWNER LIKE CONCAT(CONCAT('%', #{pd.VEHICLEOWNER}),'%') + + AND f.VEHICLEOWNER LIKE CONCAT(CONCAT('%', #{pd.VEHICLEOWNER}), '%') - - and f.REGISTRANT LIKE CONCAT(CONCAT('%', #{pd.REGISTRANT}),'%') + + AND f.REGISTRANT LIKE CONCAT(CONCAT('%', #{pd.REGISTRANT}), '%') - - and f.EXPIRE_DATE = #{pd.EXPIRE_DATE} + + + + + -- 添加条件:只有当当前时间(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.EXPIRE_DATE, INTERVAL f.REMINDER_DAY DAY) AND f.EXPIRE_DATE - - and f.EXPIRE_STATUS = #{pd.EXPIRE_STATUS} + + AND f.EXPIRE_STATUS = #{pd.EXPIRE_STATUS} - - and f.REMINDER_STATUS = #{pd.REMINDER_STATUS} + + AND f.REMINDER_STATUS = #{pd.REMINDER_STATUS} - - and f.TRANSPORT_ENTERPRISES = #{pd.TRANSPORT_ENTERPRISES} + + AND f.TRANSPORT_ENTERPRISES = #{pd.TRANSPORT_ENTERPRISES} - - -