WelcomeLogMapper.xml 1.5 KB

1234567891011121314151617181920212223242526272829303132
  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.template.mapper.WelcomeLogMapper">
  4. <resultMap type="com.template.model.vo.LogVo" id="LogPageMap">
  5. <result property="id" column="id"/>
  6. <result property="createTime" column="create_time"/>
  7. <result property="userName" column="user_name"/>
  8. <result property="accountNum" column="account_num"/>
  9. <result property="operMode" column="oper_mode"/>
  10. <result property="otype" column="otype"/>
  11. <result property="operation" column="operation"/>
  12. <result property="ip" column="ip"/>
  13. <result property="olevel" column="olevel"/>
  14. </resultMap>
  15. <select id="queryLogPages" resultType="com.template.model.vo.LogVo" resultMap="LogPageMap">
  16. SELECT id,create_time,account_num,user_name,oper_mode,otype,operation,ip,olevel FROM `welcome_log`
  17. where deleted = 0
  18. <if test="userName != null and userName != ''">
  19. and user_name like '%' #{userName} '%'
  20. </if>
  21. <if test="operMode != null and operMode != ''">
  22. and oper_mode like '%' #{operMode} '%'
  23. </if>
  24. <if test="olevelId != null and olevelId != 0">
  25. and olevel_id = #{olevelId}
  26. </if>
  27. <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
  28. and create_time BETWEEN #{startTime} AND #{endTime}
  29. </if>
  30. order by create_time desc
  31. </select>
  32. </mapper>