SysLogCQuery.xml 1.3 KB

1234567891011121314151617181920212223242526272829
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.bowintek.smartsearch.mapper.cquery.SysLogCQuery">
  4. <select id="selectLogList" resultType="com.bowintek.smartsearch.vo.system.LogModel">
  5. select l.logID,l.pageUrl,l.actionName,l.userID,l.logTime,us.name as userName,us.loginID,l.pageName
  6. from sys_log l
  7. inner join sys_user us on l.userID = us.userID
  8. where 1=1
  9. <if test="userName!='' and userName!=null">
  10. and us.name like Concat('%',#{userName},'%')
  11. </if>
  12. <if test="loginID!='' and loginID!=null">
  13. and us.loginID like Concat('%',#{loginID},'%')
  14. </if>
  15. <if test="endDate != null">
  16. and l.logTime <![CDATA[ >= ]]> STR_TO_DATE(#{startDate},'%Y-%m-%d')
  17. </if>
  18. <if test="endDate != null ">
  19. and l.logTime <![CDATA[ < ]]> date_add(#{endDate}, interval 1 day)
  20. </if>
  21. <if test="idList!=null and idList.size>0">
  22. and l.logID in
  23. <foreach collection="idList" item="id" index="index" open="(" close=")" separator=",">
  24. #{id}
  25. </foreach>
  26. </if>
  27. order by l.logTime desc
  28. </select>
  29. </mapper>