SceneXspaceMapper.xml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  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.fdkankan.jp.xspace.mapper.ISceneXspaceMapper">
  4. <select id="pageXspace" resultType="com.fdkankan.jp.xspace.vo.XspaceVO" parameterType="com.fdkankan.jp.xspace.dto.XspacePageDTO">
  5. SELECT sx.id, p.`title`,sx.`num`,sx.`serial`,u2.`nick_name` as creator ,sx.`create_time`,sx.`update_time`,sx.`status`
  6. FROM t_scene_xspace sx
  7. LEFT JOIN t_scene_plus p ON sx.`num` = p.`num`
  8. LEFT JOIN t_user u ON sx.`user_id` = u.`id`
  9. left join t_user u2 on sx.creator = u2.id
  10. WHERE sx.`rec_status` = 'A'
  11. <if test="param.userId != null">
  12. AND sx.`user_id` = #{param.userId}
  13. </if>
  14. <if test="param.companyId != null">
  15. AND u.`company_id` = #{param.companyId}
  16. </if>
  17. <if test="param.title != null and param.title != ''">
  18. AND p.`title` LIKE concat('%', #{param.title}, '%')
  19. </if>
  20. <if test="param.creator != null and param.creator != ''">
  21. AND u2.`nick_name` LIKE concat('%', #{param.creator}, '%')
  22. </if>
  23. <if test="param.timeStart != null">
  24. AND sx.`create_time` >= #{param.timeStart}
  25. </if>
  26. <if test="param.timeEnd != null">
  27. AND sx.`create_time` <![CDATA[ <= ]]> #{param.timeEnd}
  28. </if>
  29. <if test="param.status != null">
  30. AND sx.`status` = #{param.status}
  31. </if>
  32. order by sx.id desc
  33. </select>
  34. </mapper>