hanfucheng 1 год назад
Родитель
Сommit
0a3309b34f

+ 4 - 1
src/main/java/com/sooka/sponest/data/index/domain/MenuInfo.java

@@ -59,7 +59,10 @@ public class MenuInfo extends BaseBusinessEntity {
     /*
     * 部门id
     */
-    @ApiModelProperty(value = "结束时间", required = false)
+    @ApiModelProperty(value = "部门id", required = false)
     private String deptIds;
 
+    //总数和更新数标识
+    private String mark;
+
 }

+ 2 - 0
src/main/java/com/sooka/sponest/data/index/service/impl/IndexViewServiceImpl.java

@@ -141,6 +141,7 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
                     menuInfo1.setStartDate(date[0]);
                     menuInfo1.setEndDate(date[1]);
                 }
+                menuInfo1.setMark("xiugai");
                 Long updateCount = indexViewMapper.getBasicDataCount(menuInfo1);
                 indexViewInfo.setUpdataCount(indexViewInfo.getUpdataCount() + updateCount);
 
@@ -363,6 +364,7 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
                     info1.setStartDate(date[0]);
                     info1.setEndDate(date[1]);
                 }
+                info1.setMark("xiugai");
                 updateCount += indexViewMapper.getBasicDataCount(info1);
             }
             td.put("count"+a,count);

+ 13 - 2
src/main/resources/mapper/index/IndexViewMapper.xml

@@ -27,8 +27,19 @@
         left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
         <where>
             <if test="type != null and type != ''">and a.type = #{type}</if>
-            <if test="startDate != null and startDate != ''">and a.update_time &gt;= concat(#{startDate},' 00:00:00')</if>
-            <if test="endDate != null and endDate != ''">and a.update_time &lt;= concat(#{endDate},' 23:59:59')</if>
+            <choose>
+                <when test="mark != null  and mark != ''">
+                    <choose>
+                        <when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
+                            and a.update_time &gt;= concat(#{startDate},' 00:00:00')
+                            and a.update_time &lt;= concat(#{endDate},' 23:59:59')
+                        </when>
+                        <otherwise>
+                            and a.update_time is not null
+                        </otherwise>
+                    </choose>
+                </when>
+            </choose>
             <if test="deptIds != null and deptIds != ''">and CONCAT(d.ancestors,',',a.dept_id) = #{deptIds}</if>
         </where>
     </select>