Jelajahi Sumber

时间检索bug修改,二进制数据存储和取出是乱码问题

车车 4 bulan lalu
induk
melakukan
e724a6cfd9

+ 2 - 2
ktg-system/src/main/resources/mapper/system/SysLogininforMapper.xml

@@ -34,10 +34,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 				AND user_name like concat('%', #{userName}, '%')
 			</if>
 			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-				and date_format(login_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+				and login_time &gt;= #{params.beginTime} + ' 00:00:00'
 			</if>
 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-				and date_format(login_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+				and login_time &lt;= #{params.endTime} + ' 23:59:59'
 			</if>
 		</where>
 		order by info_id desc

+ 3 - 3
ktg-system/src/main/resources/mapper/system/SysNoticeMapper.xml

@@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectNoticeVo">
-        select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark
+        select notice_id, notice_title, notice_type, CONVERT(NVARCHAR(MAX), notice_content, 0) as notice_content, status, create_by, create_time, update_by, update_time, remark
 		from sys_notice
     </sql>
 
@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		)values(
 			<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
 			<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
-			<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
+			<if test="noticeContent != null and noticeContent != ''">CONVERT(varbinary(max), #{noticeContent}, 0), </if>
 			<if test="status != null and status != ''">#{status}, </if>
 			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
@@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <set>
             <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
             <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
-            <if test="noticeContent != null">notice_content = #{noticeContent}, </if>
+            <if test="noticeContent != null">notice_content = CONVERT(varbinary(max), #{noticeContent}, 0), </if>
             <if test="status != null and status != ''">status = #{status}, </if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = CURRENT_TIMESTAMP

+ 2 - 2
ktg-system/src/main/resources/mapper/system/SysOperLogMapper.xml

@@ -55,10 +55,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 date_format(oper_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+				and oper_time &gt;= #{params.beginTime} + ' 00:00:00'
 			</if>
 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-				and date_format(oper_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+				and oper_time &lt;= #{params.endTime} + ' 23:59:59'
 			</if>
 		</where>
 		order by oper_id desc