浏览代码

修复扫码时间分布接口bug

云殇忆 1 年之前
父节点
当前提交
91b40881a0
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      ruoyi-demo/src/main/resources/mapper/demo/StatisticsMapper.xml

+ 4 - 4
ruoyi-demo/src/main/resources/mapper/demo/StatisticsMapper.xml

@@ -57,7 +57,7 @@
             `dl_statistics`
         <where>
             <if test="month != null">
-                STR_TO_DATE(#{month},'%Y-%m')
+                DATE_FORMAT(`time`,'%Y-%m') = DATE_FORMAT(#{month},'%Y-%m')
             </if>
         </where>;
     </select>
@@ -68,7 +68,7 @@
             `dl_statistics`
         <where>
             <if test="day != null">
-                STR_TO_DATE(#{day},'%Y-%m-%d')
+                DATE_FORMAT(`time`,'%Y-%m-%d') = DATE_FORMAT(#{day},'%Y-%m-%d')
             </if>
         </where>;
     </select>
@@ -78,8 +78,8 @@
         FROM
             `dl_statistics`
         <where>
-            <if test="day != null">
-                STR_TO_DATE(#{year},'%Y')
+            <if test="year != null">
+                DATE_FORMAT(`time`,'%Y') = DATE_FORMAT(#{year},'%Y')
             </if>
         </where>;
     </select>