1234567891011121314151617181920212223242526272829 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.bowintek.smartsearch.mapper.cquery.SysLogCQuery">
- <select id="selectLogList" resultType="com.bowintek.smartsearch.vo.system.LogModel">
- select l.logID,l.pageUrl,l.actionName,l.userID,l.logTime,us.name as userName,us.loginID,l.pageName
- from sys_log l
- inner join sys_user us on l.userID = us.userID
- where 1=1
- <if test="userName!='' and userName!=null">
- and us.name like Concat('%',#{userName},'%')
- </if>
- <if test="loginID!='' and loginID!=null">
- and us.loginID like Concat('%',#{loginID},'%')
- </if>
- <if test="endDate != null">
- and l.logTime <![CDATA[ >= ]]> STR_TO_DATE(#{startDate},'%Y-%m-%d')
- </if>
- <if test="endDate != null ">
- and l.logTime <![CDATA[ < ]]> date_add(#{endDate}, interval 1 day)
- </if>
- <if test="idList!=null and idList.size>0">
- and l.logID in
- <foreach collection="idList" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- order by l.logTime desc
- </select>
- </mapper>
|