LogMapper.xml 1.2 KB

12345678910111213141516171819202122232425262728
  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.cdf.mapper.ILogMapper">
  4. <select id="getPageByParam" resultType="com.cdf.response.LogVo" parameterType="com.cdf.request.LogRequest">
  5. select * from t_log l
  6. left join t_user u on l.user_id = u.id
  7. left join t_dept d on u.dept_id = d.id
  8. left join t_role r on u.role_id = r.id
  9. WHERE l.tb_status = 0
  10. <if test="param.phone != null and param.phone !=''">
  11. and u.phone like CONCAT('%', #{param.phone},'%')
  12. </if>
  13. <if test="param.nickName != null and param.nickName !=''">
  14. and u.nick_name like CONCAT('%', #{param.nickName},'%')
  15. </if>
  16. <if test="param.deptId != null ">
  17. and u.dept_id = #{param.deptId}
  18. </if>
  19. <if test="param.startTime != null and param.startTime != ''">
  20. and l.create_time &gt;= #{param.startTime}
  21. </if>
  22. <if test="param.endTime != null and param.endTime != ''">
  23. and l.create_time &lt;= #{param.endTime}
  24. </if>
  25. order by l.create_time desc
  26. </select>
  27. </mapper>