wangzhe 2 gadi atpakaļ
vecāks
revīzija
9cb0b6be18

+ 4 - 4
mybusiness/src/main/resources/mapper/system/TUInterfaceinfoMapper.xml

@@ -292,7 +292,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                             COUNT(id)
                         FROM
                             t_u_interfaceinfo
-                        WHERE DATE_FORMAT(create_time,'%Y') = #{year}
+                        WHERE DATE_FORMAT(create_time,'%Y') like concat('%', #{year}, '%')
                         <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
                     ) * 100
                 ),
@@ -303,7 +303,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM
             t_u_interfaceinfo a
         LEFT JOIN sys_dict_data b ON a.share_type = b.dict_value
-        WHERE DATE_FORMAT(a.create_time,'%Y') = #{year}
+        WHERE DATE_FORMAT(a.create_time,'%Y') like concat('%', #{year}, '%')
         <if test="deptId != null  and deptId != ''"> and a.dept_id = #{deptId}</if>
         GROUP BY
             share_type
@@ -319,7 +319,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                             COUNT(id)
                         FROM
                             t_u_interfaceinfo
-                        WHERE DATE_FORMAT(create_time,'%Y') = #{year}
+                        WHERE DATE_FORMAT(create_time,'%Y') like concat('%', #{year}, '%')
                     ) * 100
                 ),
                 DECIMAL (10, 0)
@@ -329,7 +329,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM
             t_u_interfaceinfo a
         LEFT JOIN sys_dict_data b ON a.share_type = b.dict_value
-        WHERE DATE_FORMAT(a.create_time,'%Y') = #{year}
+        WHERE DATE_FORMAT(a.create_time,'%Y') like concat('%', #{year}, '%')
         GROUP BY
             share_type
         ORDER BY dict_value

+ 2 - 1
mybusiness/src/main/resources/static/visualization/js/echarts_div.js

@@ -3,7 +3,8 @@
  */
 function countAndPercent(year){
 	if(year == null){
-		year = new Date().getFullYear();
+		// year = new Date().getFullYear();
+		year = '';
 	}
 	$.post("/visualization/countAndPercent",{
 		year:year

+ 3 - 1
mybusiness/src/main/resources/templates/visualization/index.html

@@ -71,7 +71,9 @@
                 <div class="tit_date">
                     <i></i>
                     <select id="pie" onchange="selectYear()">
-                        <option selected value="2022">2022年</option>
+                        <option selected value="">全年</option>
+                        <option value="2023">2023年</option>
+                        <option value="2022">2022年</option>
                         <option value="2021">2021年</option>
                         <option value="2020">2020年</option>
                     </select>

+ 5 - 2
mybusiness/src/main/resources/templates/visualization/tk_iframe.html

@@ -71,7 +71,9 @@
             <div class="tit_date">
                 <i></i>
                 <select id="sub_pie" onchange="selectYear()">
-                    <option selected value="2022">2022年</option>
+                    <option selected value="">全年</option>
+                    <option value="2023">2023年</option>
+                    <option value="2022">2022年</option>
                     <option value="2021">2021年</option>
                     <option value="2020">2020年</option>
                 </select>
@@ -163,7 +165,8 @@
     /**接口占比**/
     function percent(year) {
         if (year == null) {
-            year = new Date().getFullYear();
+            // year = new Date().getFullYear();
+            year = '';
         }
         $.post("/visualization/subPercent", {
             year: year,