Forráskód Böngészése

公司/部门 项目报表的判断条件修改+每次运行时删除老数据

[user3] 3 éve
szülő
commit
cb134422e6

+ 4 - 4
src/main/java/com/jeeplus/modules/workcalendar/service/WorkCalendarTaskService.java

@@ -43,7 +43,7 @@ public class WorkCalendarTaskService  {
     @Autowired
     private StatementCompanyComprehensiveService statementCompanyComprehensiveService;
 
-    @Scheduled(cron= "0 0/1 * * * ?")
+    //@Scheduled(cron= "0 0/1 * * * ?")
     public void notifyTask() {
         logger.info("-----------定时任务开始------------------");
         //查询待发送提醒的日历
@@ -147,7 +147,7 @@ public class WorkCalendarTaskService  {
      */
     //每个月最后一天晚上23点推送
     //@Scheduled(cron= "0 0 23 28-31 * ?")
-    //@Scheduled(cron= "0 01 17 * * ?")
+    //@Scheduled(cron= "0 0/2 * * * ?")
     @Transactional(readOnly = false)
     public void getStatementCompanyComprehensiveOnMonth() {
         final Calendar c = Calendar.getInstance();
@@ -173,7 +173,7 @@ public class WorkCalendarTaskService  {
      */
     //每个季度最后一天晚上23点推送
     //@Scheduled(cron= "0 0 23 28-31 3,6,9,12 ?")
-    //@Scheduled(cron= "0 02 17 * * ?")
+    //@Scheduled(cron= "0 0/2 * * * ?")
     @Transactional(readOnly = false)
     public void getStatementCompanyComprehensiveOnQuarter() {
         final Calendar c = Calendar.getInstance();
@@ -196,7 +196,7 @@ public class WorkCalendarTaskService  {
      */
     //每年最后一天晚上23点推送
     //@Scheduled(cron= "0 0 23 31 12 ?")
-    //@Scheduled(cron= "0 03 17 * * ?")
+   // @Scheduled(cron= "0 0/2 * * * ?")
     @Transactional(readOnly = false)
     public void getStatementCompanyComprehensiveOnYear() {
         final Calendar c = Calendar.getInstance();

+ 24 - 24
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -2605,16 +2605,16 @@
 		,prsi.id as "prsiId"
 		FROM statement_data_info sdi
 
-		<if test="statementCompanyComprehensiveInfo.field5 != null and statementCompanyComprehensiveInfo.field5 != ''">
+		<if test="statementCompanyComprehensiveInfo.field5 == '5'.toString() ">
 			LEFT JOIN rural_project_records a ON sdi.field1 = a.id
 		</if>
-		<if test="statementCompanyComprehensiveInfo.field6 != null and statementCompanyComprehensiveInfo.field6 != ''">
+		<if test="statementCompanyComprehensiveInfo.field6 == '5'.toString() ">
 			LEFT JOIN rural_project_records a ON sdi.field2 = a.id
 		</if>
-		<if test="statementCompanyComprehensiveInfo.field7 != null and statementCompanyComprehensiveInfo.field7 != ''">
+		<if test="statementCompanyComprehensiveInfo.field7 == '5'.toString() ">
 			LEFT JOIN rural_project_records a ON sdi.field3 = a.id
 		</if>
-		<if test="statementCompanyComprehensiveInfo.field8 != null and statementCompanyComprehensiveInfo.field8 != ''">
+		<if test="statementCompanyComprehensiveInfo.field8 == '5'.toString() ">
 			LEFT JOIN rural_project_records a ON sdi.field4 = a.id
 		</if>
 
@@ -2648,12 +2648,12 @@
 			and sdi.big_date_type = #{statementCompanyComprehensiveInfo.bigDateType}
 			and sdi.small_date_type = #{statementCompanyComprehensiveInfo.smallDateType}
 			and sdi.office_id = #{statementCompanyComprehensiveInfo.officeId}
-			<if test="statementCompanyComprehensiveInfo.field5 != null and statementCompanyComprehensiveInfo.field5 != ''">
+			<if test="statementCompanyComprehensiveInfo.field5 == '5'.toString() ">
 				and a.record_state = 6
 				and a.over_record_status = 1
 				and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
 			</if>
-			<if test="statementCompanyComprehensiveInfo.field6 != null and statementCompanyComprehensiveInfo.field6 != ''">
+			<if test="statementCompanyComprehensiveInfo.field6 == '5'.toString() ">
 				and a.record_state = 7
 				and a.over_record_status = 1
 				and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
@@ -2662,12 +2662,12 @@
 				and prr.accomplish_date >= #{beginDate}
 				and prr.accomplish_date &lt;= #{endDate}
 			</if>
-			<if test="statementCompanyComprehensiveInfo.field7 != null and statementCompanyComprehensiveInfo.field7 != ''">
+			<if test="statementCompanyComprehensiveInfo.field7 == '5'.toString() ">
 				and a.reported_state = 6
 				and a.over_due_status = 1
 				and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
 			</if>
-			<if test="statementCompanyComprehensiveInfo.field8 != null and statementCompanyComprehensiveInfo.field8 != ''">
+			<if test="statementCompanyComprehensiveInfo.field8 == '5'.toString() ">
 				and a.reported_state = 7
 				and a.over_due_status = 1
 				and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
@@ -2793,16 +2793,16 @@
 			and big_date_type = #{bigDateType}
 			and small_date_type = #{smallDateType}
 			and office_id = #{officeId}
-			<if test="field5 != null and field5 != ''">
+			<if test="field5 == '5'.toString() ">
 				and field1 IS NOT NULL and field1 != ''
 			</if>
-			<if test="field6 != null and field6 != ''">
+			<if test="field6 == '5'.toString() ">
 				and field2 IS NOT NULL and field2 != ''
 			</if>
-			<if test="field7 != null and field7 != ''">
+			<if test="field7 == '5'.toString() ">
 				and field3 IS NOT NULL and field3 != ''
 			</if>
-			<if test="field8 != null and field8 != ''">
+			<if test="field8 == '5'.toString() ">
 				and field4 IS NOT NULL and field4 != ''
 			</if>
 		</where>
@@ -3258,16 +3258,16 @@
 		,prsi.id as "prsiId"
 		FROM statement_office_data_info sodi
 
-		<if test="statementCompanyComprehensiveInfo.field5 != null and statementCompanyComprehensiveInfo.field5 != ''">
+		<if test="statementCompanyComprehensiveInfo.field5 == '5'.toString() ">
 			LEFT JOIN rural_project_records a ON sodi.field1 = a.id
 		</if>
-		<if test="statementCompanyComprehensiveInfo.field6 != null and statementCompanyComprehensiveInfo.field6 != ''">
+		<if test="statementCompanyComprehensiveInfo.field6 == '5'.toString() ">
 			LEFT JOIN rural_project_records a ON sodi.field2 = a.id
 		</if>
-		<if test="statementCompanyComprehensiveInfo.field7 != null and statementCompanyComprehensiveInfo.field7 != ''">
+		<if test="statementCompanyComprehensiveInfo.field7 == '5'.toString() ">
 			LEFT JOIN rural_project_records a ON sodi.field3 = a.id
 		</if>
-		<if test="statementCompanyComprehensiveInfo.field8 != null and statementCompanyComprehensiveInfo.field8 != ''">
+		<if test="statementCompanyComprehensiveInfo.field8 == '5'.toString() ">
 			LEFT JOIN rural_project_records a ON sodi.field4 = a.id
 		</if>
 
@@ -3302,12 +3302,12 @@
 			and sodi.small_date_type = #{statementCompanyComprehensiveInfo.smallDateType}
 			and sodi.office_id = #{statementCompanyComprehensiveInfo.officeId}
 			and a.create_by = #{statementCompanyComprehensiveInfo.userId}
-			<if test="statementCompanyComprehensiveInfo.field5 != null and statementCompanyComprehensiveInfo.field5 != ''">
+			<if test="statementCompanyComprehensiveInfo.field5 == '5'.toString() ">
 				and a.record_state = 6
 				and a.over_record_status = 1
 				and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
 			</if>
-			<if test="statementCompanyComprehensiveInfo.field6 != null and statementCompanyComprehensiveInfo.field6 != ''">
+			<if test="statementCompanyComprehensiveInfo.field6 == '5'.toString() ">
 				and a.record_state = 7
 				and a.over_record_status = 1
 				and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
@@ -3316,12 +3316,12 @@
 				and rprr.accomplish_date >= #{beginDate}
 				and rprr.accomplish_date &lt;= #{endDate}
 			</if>
-			<if test="statementCompanyComprehensiveInfo.field7 != null and statementCompanyComprehensiveInfo.field7 != ''">
+			<if test="statementCompanyComprehensiveInfo.field7 == '5'.toString() ">
 				and a.reported_state = 6
 				and a.over_due_status = 1
 				and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
 			</if>
-			<if test="statementCompanyComprehensiveInfo.field8 != null and statementCompanyComprehensiveInfo.field8 != ''">
+			<if test="statementCompanyComprehensiveInfo.field8 == '5'.toString() ">
 				and a.reported_state = 7
 				and a.over_due_status = 1
 				and a.office_id in(select id  from sys_office where id = #{statementCompanyComprehensiveInfo.officeId} or parent_ids like concat('%',#{statementCompanyComprehensiveInfo.officeId},'%'))
@@ -3448,16 +3448,16 @@
 			and small_date_type = #{smallDateType}
 			and office_id = #{officeId}
 			and user_id = #{userId}
-			<if test="field5 != null and field5 != ''">
+			<if test="field5 == '5'.toString() ">
 				and field1 IS NOT NULL and field1 != ''
 			</if>
-			<if test="field6 != null and field6 != ''">
+			<if test="field6 == '5'.toString() ">
 				and field2 IS NOT NULL and field2 != ''
 			</if>
-			<if test="field7 != null and field7 != ''">
+			<if test="field7 == '5'.toString() ">
 				and field3 IS NOT NULL and field3 != ''
 			</if>
-			<if test="field8 != null and field8 != ''">
+			<if test="field8 == '5'.toString() ">
 				and field4 IS NOT NULL and field4 != ''
 			</if>
 		</where>

+ 32 - 0
src/main/resources/mappings/modules/statement/StatementCompanyComprehensiveDao.xml

@@ -418,6 +418,22 @@
 			and big_date_type = #{bigDateType}
 			and small_date_type = #{smallDateType}
 			and office_id = #{officeId}
+
+			<if test="field1 != null and field1 != ''">
+				and field1 = #{field1}
+			</if>
+
+			<if test="field2 != null and field2 != ''">
+				and field2 = #{field2}
+			</if>
+
+			<if test="field3 != null and field3 != ''">
+				and field3 = #{field3}
+			</if>
+
+			<if test="field4 != null and field4 != ''">
+				and field4 = #{field4}
+			</if>
 		</where>
 	</delete>
 
@@ -629,6 +645,22 @@
 			and small_date_type = #{smallDateType}
 			and office_id = #{officeId}
 			and user_id = #{userId}
+
+			<if test="field1 != null and field1 != ''">
+				and field1 = #{field1}
+			</if>
+
+			<if test="field2 != null and field2 != ''">
+				and field2 = #{field2}
+			</if>
+
+			<if test="field3 != null and field3 != ''">
+				and field3 = #{field3}
+			</if>
+
+			<if test="field4 != null and field4 != ''">
+				and field4 = #{field4}
+			</if>
 		</where>
 	</delete>