From b05808b812a4dc7caed39c265ad9b00b6ddc9300 Mon Sep 17 00:00:00 2001 From: wangpeng Date: Thu, 22 Feb 2024 10:34:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=92=E6=9F=A5=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=A2=9E=E5=8A=A0=E9=9A=90=E6=82=A3=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E6=8E=92=E6=9F=A5=E7=9A=84=E6=95=B0=E6=8D=AE=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/zcloud/util/DateUtil.java | 14 ++++++++++++++ .../mybatis/datasource/check/CheckUserMapper.xml | 12 ++++++------ .../mybatis/datasource/check/ListManagerMapper.xml | 2 +- .../mybatis/datasource/hidden/HiddenMapper.xml | 8 ++++---- .../CustomDisableTimeMapper.xml | 2 +- .../hiddenDangerCheckStandard/CustomMapper.xml | 6 +++--- 6 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/zcloud/util/DateUtil.java b/src/main/java/com/zcloud/util/DateUtil.java index d35374c..bd25e3b 100644 --- a/src/main/java/com/zcloud/util/DateUtil.java +++ b/src/main/java/com/zcloud/util/DateUtil.java @@ -746,6 +746,20 @@ public class DateUtil { /*System.out.println(quarterStart()+" 00:00:00"); System.out.println(getCurrYearLast()+" 23:59:59");*/ + + Calendar cal1 = Calendar.getInstance(); + Calendar cal2 = Calendar.getInstance(); + Date date = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + cal1.setTime(date); + cal2.setTime(date); + cal1.set(Calendar.DAY_OF_MONTH,1); + cal1.add(Calendar.MONTH, -1); + cal2.add(Calendar.MONTH, -1); + cal2.set(Calendar.DAY_OF_MONTH, cal2.getActualMaximum(Calendar.DAY_OF_MONTH)); + System.out.println(sdf.format(cal1.getTime()) + "-01 00:00:00"); + System.out.println(sdf.format(cal2.getTime()) + "-31 00:00:00"); + } } diff --git a/src/main/resources/mybatis/datasource/check/CheckUserMapper.xml b/src/main/resources/mybatis/datasource/check/CheckUserMapper.xml index abd05e0..f586ab3 100644 --- a/src/main/resources/mybatis/datasource/check/CheckUserMapper.xml +++ b/src/main/resources/mybatis/datasource/check/CheckUserMapper.xml @@ -15,7 +15,7 @@ sum(f.NOTEXAMINEDNUM) NUM, u.DEPARTMENT_ID FROM - bus_list_statistics f + vi_list_statistics_all f LEFT JOIN SYS_USER u ON u.USER_ID = f.USER_ID WHERE ( @@ -33,8 +33,8 @@ count( distinct cr.LISTMANAGER_ID ) NUM, c.DEPARTMENT_ID FROM - bus_checkuser c - LEFT JOIN bus_checkrecord cr ON c.CHECKRECORD_ID = cr.CHECKRECORD_ID + vi_list_checkuser_all c + LEFT JOIN vi_list_checkrecord_all cr ON c.CHECKRECORD_ID = cr.CHECKRECORD_ID and c.HIDDEN_RISKSTANDARD=cr.HIDDEN_RISKSTANDARD WHERE cr.isdelete = '0' AND cr.FINISHED = '1' @@ -58,7 +58,7 @@ sum(f.NOTEXAMINEDNUM) NUM, f.USER_ID FROM - bus_list_statistics f + vi_list_statistics_all f WHERE ( f.STARTTIME BETWEEN #{STARTTIME} and #{ENDTIME} @@ -75,8 +75,8 @@ count( distinct cr.LISTMANAGER_ID ) NUM, c.USER_ID FROM - bus_checkuser c - LEFT JOIN bus_checkrecord cr ON c.CHECKRECORD_ID = cr.CHECKRECORD_ID + vi_list_checkuser_all c + LEFT JOIN vi_list_checkrecord_all cr ON c.CHECKRECORD_ID = cr.CHECKRECORD_ID and c.HIDDEN_RISKSTANDARD=cr.HIDDEN_RISKSTANDARD WHERE cr.isdelete = '0' AND cr.FINISHED = '1' diff --git a/src/main/resources/mybatis/datasource/check/ListManagerMapper.xml b/src/main/resources/mybatis/datasource/check/ListManagerMapper.xml index 3d2fe29..42bb34d 100644 --- a/src/main/resources/mybatis/datasource/check/ListManagerMapper.xml +++ b/src/main/resources/mybatis/datasource/check/ListManagerMapper.xml @@ -1506,7 +1506,7 @@ ) h ON h.LISTMANAGER_ID = f.LISTMANAGER_ID WHERE f.isdelete = '0' - AND now() > f.END_TIME + AND now() > f.END_DATE AND f.TYPE = 'listType0005' AND ( h.NUM < 1 OR h.NUM IS NULL ) AND o.OFFDUTY_ID IS NULL diff --git a/src/main/resources/mybatis/datasource/hidden/HiddenMapper.xml b/src/main/resources/mybatis/datasource/hidden/HiddenMapper.xml index 237d0ba..f19d4c5 100644 --- a/src/main/resources/mybatis/datasource/hidden/HiddenMapper.xml +++ b/src/main/resources/mybatis/datasource/hidden/HiddenMapper.xml @@ -36,8 +36,8 @@ SELECT d.DEPARTMENT_ID, ifnull(un.user_count,0) as user_count, - (select count( 1 ) from BUS_HIDDEN h where h.ISDELETE=0 and h.HIDDENFINDDEPT=d.DEPARTMENT_ID and h.CREATTIME LIKE CONCAT(CONCAT('%', #{MONTH}),'%') ) as hidden_count, - (select count( 1 ) from BUS_HIDDEN h where h.ISDELETE=0 and h.RECTIFICATIONDEPT=d.DEPARTMENT_ID and h.RECTIFICATIONTIME LIKE CONCAT(CONCAT('%', #{MONTH}),'%') ) as rectify_count + (select count( 1 ) from VI_HIDDEN_ALL h where h.ISDELETE=0 and h.HIDDENFINDDEPT=d.DEPARTMENT_ID and h.CREATTIME LIKE CONCAT(CONCAT('%', #{MONTH}),'%') ) as hidden_count, + (select count( 1 ) from VI_HIDDEN_ALL h where h.ISDELETE=0 and h.RECTIFICATIONDEPT=d.DEPARTMENT_ID and h.RECTIFICATIONTIME LIKE CONCAT(CONCAT('%', #{MONTH}),'%') ) as rectify_count FROM OA_DEPARTMENT d LEFT JOIN @@ -59,7 +59,7 @@ count( 1 ) count, h.CREATOR FROM - BUS_HIDDEN h + vi_hidden_all h WHERE h.ISDELETE = 0 AND h.CREATTIME LIKE CONCAT( CONCAT( '%', #{MONTH}), '%' ) @@ -70,7 +70,7 @@ count( 1 ) count, h.RECTIFICATIONOR FROM - BUS_HIDDEN h + vi_hidden_all h WHERE h.ISDELETE = 0 AND h.RECTIFICATIONTIME LIKE CONCAT( CONCAT( '%', #{MONTH} ), '%' ) diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.xml index 7f8f143..9e4ae37 100644 --- a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.xml @@ -4,7 +4,7 @@ - BUS_HIDDENDANGERCHECKSTANDARD_CUSTOMDISABLETIME + bus_hiddendangercheckstandard_disabletime diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomMapper.xml index 7275039..c851552 100644 --- a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomMapper.xml @@ -204,7 +204,7 @@ BUS_HIDDENDANGERCHECKSTANDARD_CUSTOM f LEFT JOIN bus_offduty o ON o.USER_ID = f.USER_ID AND concat( o.STARTTIME, ' 00:00:00' ) <= #{STARTTIME} AND concat( o.ENDTIME, ' 23:59:59' ) >= #{ENDTIME} - left join BUS_HIDDENDANGERCHECKSTANDARD_CUSTOMDISABLETIME ld on ld.CUSTOM_ID = f.CUSTOM_ID and ld.ENDTIME is not null + left join bus_hiddendangercheckstandard_disabletime ld on ld.CUSTOM_ID = f.CUSTOM_ID and ld.ENDTIME is not null and ld.STARTTIME <= #{STARTTIME} and ld.ENDTIME >= #{ENDTIME} LEFT JOIN SYS_USER u on u.USER_ID = f.USER_ID LEFT JOIN BUS_SHIFTWORKRULES swr ON u.SHIFTDUTYTWO = swr.SHIFTWORKRULES_ID @@ -256,7 +256,7 @@ BUS_HIDDENDANGERCHECKSTANDARD_CUSTOM f LEFT JOIN bus_offduty o ON o.USER_ID = f.USER_ID AND concat( o.STARTTIME, ' 00:00:00' ) <= #{STARTTIME} AND concat( o.ENDTIME, ' 23:59:59' ) >= #{ENDTIME} - left join BUS_HIDDENDANGERCHECKSTANDARD_CUSTOMDISABLETIME ld on ld.CUSTOM_ID = f.CUSTOM_ID and ld.ENDTIME is not null + left join bus_hiddendangercheckstandard_disabletime ld on ld.CUSTOM_ID = f.CUSTOM_ID and ld.ENDTIME is not null and ld.STARTTIME <= #{STARTTIME} and ld.ENDTIME >= #{ENDTIME} WHERE f.CUSTOM_ID NOT IN ( @@ -299,7 +299,7 @@ BUS_HIDDENDANGERCHECKSTANDARD_CUSTOM f LEFT JOIN bus_offduty o ON o.USER_ID = f.USER_ID AND concat( o.STARTTIME, ' 00:00:00' ) <= concat( f.START_DATE, ' 00:00:00' ) AND concat( o.ENDTIME, ' 23:59:59' ) >= concat( f.End_DATE, ' 23:59:59' ) - LEFT JOIN BUS_HIDDENDANGERCHECKSTANDARD_CUSTOMDISABLETIME ld ON ld.CUSTOM_ID = f.CUSTOM_ID + LEFT JOIN bus_hiddendangercheckstandard_disabletime ld ON ld.CUSTOM_ID = f.CUSTOM_ID AND ld.ENDTIME IS NOT NULL AND ld.STARTTIME <= concat( f.START_DATE, ' 00:00:00' ) AND ld.ENDTIME >= concat( f.End_DATE, ' 23:59:59' ) LEFT JOIN (