Browse Source

调整关于系统管理报错

chenendian 1 tháng trước cách đây
mục cha
commit
1349923149

+ 1 - 1
siwei-modules/siwei-system/src/main/java/com/siwei/system/service/impl/SysLogininforServiceImpl.java

@@ -3,9 +3,9 @@ package com.siwei.system.service.impl;
 import java.util.List;
 
 import com.siwei.system.api.domain.SysLogininfor;
+import com.siwei.system.mapper.SysLogininforMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.siwei.system.mapper.SysLogininforMapper;
 import com.siwei.system.service.ISysLogininforService;
 
 /**

+ 6 - 6
siwei-modules/siwei-system/src/main/resources/mapper/postgresql/system/SysDictTypeMapper.xml

@@ -32,12 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="dictType != null and dictType != ''">
 				AND dict_type like concat('%', #{dictType}, '%')
 			</if>
-			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-				and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
-			</if>
-			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-				and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
-			</if>
+            <if test="params.beginTime != null and params.beginTime != ''">
+                AND to_char(create_time, 'YYYYMMDD')  &gt;= to_char(#{params.beginTime}::timestamp, 'YYYYMMDD')
+            </if>
+            <if test="params.endTime != null and params.endTime != ''">
+                AND to_char(create_time, 'YYYYMMDD') &lt;= to_char(#{params.endTime}::timestamp, 'YYYYMMDD')
+            </if>
 	    </where>
 	</select>
 	

+ 8 - 7
siwei-modules/siwei-system/src/main/resources/mapper/postgresql/system/SysLogininforMapper.xml

@@ -30,13 +30,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="userName != null and userName != ''">
 				AND user_name like concat('%', #{userName}, '%')
 			</if>
-			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-				AND access_time &gt;= #{params.beginTime}
-			</if>
-			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-				AND access_time &lt;= #{params.endTime}
-			</if>
-		</where>
+            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+                AND access_time &gt;= cast(#{params.beginTime} as timestamp with time zone)
+            </if>
+            <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+                AND access_time &lt;= cast(#{params.endTime} as timestamp with time zone)
+            </if>
+
+        </where>
 		order by info_id desc
 	</select>
 	

+ 2 - 2
siwei-modules/siwei-system/src/main/resources/mapper/postgresql/system/SysOperLogMapper.xml

@@ -58,10 +58,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 				AND oper_name like concat('%', #{operName}, '%')
 			</if>
 			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-				AND oper_time &gt;= #{params.beginTime}
+				AND oper_time &gt;= cast(#{params.beginTime} as timestamp with time zone)
 			</if>
 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-				AND oper_time &lt;= #{params.endTime}
+				AND oper_time &lt;= cast(#{params.endTime} as timestamp with time zone)
 			</if>
 		</where>
 		order by oper_id desc