feat: Enhance SQL queries with additional filtering options for department and login information

This commit is contained in:
2026-07-21 10:19:14 +08:00
parent eeaf2f5afc
commit e53dc7da4e
2 changed files with 6 additions and 3 deletions

View File

@@ -39,6 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptName != null and deptName != ''"> <if test="deptName != null and deptName != ''">
AND dept_name like concat('%', cast(#{deptName, jdbcType=VARCHAR} as varchar), '%') AND dept_name like concat('%', cast(#{deptName, jdbcType=VARCHAR} as varchar), '%')
</if> </if>
<if test="orderNum != null">
AND d.order_num = #{orderNum}
</if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND status = #{status} AND status = #{status}
</if> </if>

View File

@@ -25,13 +25,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
<where> <where>
<if test="ipaddr != null and ipaddr != ''"> <if test="ipaddr != null and ipaddr != ''">
AND ipaddr like concat('%', #{ipaddr}, '%') AND ipaddr like concat('%', CAST(#{ipaddr} AS VARCHAR), '%')
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND status = #{status} AND status = #{status}
</if> </if>
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
AND user_name like concat('%', #{userName}, '%') AND user_name like concat('%', CAST(#{userName} AS VARCHAR), '%')
</if> </if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND login_time &gt;= #{params.beginTime} AND login_time &gt;= #{params.beginTime}