|
@@ -12,6 +12,28 @@
|
|
|
<select id="getLogCount" resultType="java.lang.Long">
|
|
|
select count(*)
|
|
|
from sys_log
|
|
|
+ where 1=1
|
|
|
+ <if test="serverName != null">
|
|
|
+ AND server_name LIKE CONCAT('%', #{serverName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="modelName != null">
|
|
|
+ AND model_name LIKE CONCAT('%', #{modelName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="content != null">
|
|
|
+ AND content LIKE CONCAT('%', #{content}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ AND user_id =#{userId}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ AND create_time LIKE CONCAT('%', #{createTime}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="ipAddress != null">
|
|
|
+ AND ip_address LIKE CONCAT('%', #{ipAddress}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="methodName != null">
|
|
|
+ AND method_name LIKE CONCAT('%', #{methodName}, '%')
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getLogPage" resultType="com.judong.chuanyiserver.entity.Log">
|
|
@@ -26,6 +48,28 @@
|
|
|
method_name,
|
|
|
remark
|
|
|
from sys_log
|
|
|
+ where 1=1
|
|
|
+ <if test="serverName != null">
|
|
|
+ AND server_name LIKE CONCAT('%', #{serverName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="modelName != null">
|
|
|
+ AND model_name LIKE CONCAT('%', #{modelName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="content != null">
|
|
|
+ AND content LIKE CONCAT('%', #{content}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ AND user_id =#{userId}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ AND create_time LIKE CONCAT('%', #{createTime}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="ipAddress != null">
|
|
|
+ AND ip_address LIKE CONCAT('%', #{ipAddress}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="methodName != null">
|
|
|
+ AND method_name LIKE CONCAT('%', #{methodName}, '%')
|
|
|
+ </if>
|
|
|
order by create_time DESC
|
|
|
limit #{startNum},#{limitNum}
|
|
|
</select>
|