RoomValueWeekItemMapper.xml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.xjrsoft.module.room.mapper.RoomValueWeekItemMapper">
  6. <select id="getItemPage" parameterType="com.xjrsoft.module.room.dto.RoomValueWeekPageDto" resultType="com.xjrsoft.module.room.vo.RoomValueWeekPageVo">
  7. SELECT t1.id,t2.sort_code,t2.start_time,t2.end_time,t1.user_id,t3.name as user_name,t1.post_name,t1.room_type,t1.number_people FROM room_value_week_item t1
  8. LEFT JOIN room_value_week t2 ON t1.room_value_week_id = t2.id
  9. LEFT JOIN xjr_user t3 ON t1.user_id = t3.id
  10. WHERE t2.delete_mark = 0 AND t1.delete_mark = 0
  11. <if test="dto.startTime != null">
  12. and t2.start_time >= #{dto.startTime}
  13. </if>
  14. <if test="dto.endTime != null">
  15. and #{dto.endTime} >= t2.end_time
  16. </if>
  17. <if test="dto.userName != null and dto.userName != ''">
  18. and t3.name like concat('%', #{dto.userId}, '%')
  19. </if>
  20. <if test="dto.roomType != null and dto.roomType != ''">
  21. and t1.room_type = #{dto.roomType}
  22. </if>
  23. ORDER BY t2.sort_code,t1.sort_code
  24. </select>
  25. <select id="getItemList" parameterType="com.xjrsoft.module.room.dto.RoomValueWeekPageDto" resultType="com.xjrsoft.module.room.vo.RoomValueWeekPageVo">
  26. SELECT t1.id,t2.sort_code,t2.start_time,t2.end_time,t1.user_id,t3.name as user_name,t1.post_name,t1.room_type,t1.number_people,t1.room_value_week_id FROM room_value_week_item t1
  27. LEFT JOIN room_value_week t2 ON t1.room_value_week_id = t2.id
  28. LEFT JOIN xjr_user t3 ON t1.user_id = t3.id
  29. WHERE t2.delete_mark = 0 AND t1.delete_mark = 0
  30. <if test="dto.startTime != null">
  31. and t2.start_time >= #{dto.startTime}
  32. </if>
  33. <if test="dto.endTime != null">
  34. and #{dto.endTime} >= t2.end_time
  35. </if>
  36. <if test="dto.userName != null and dto.userName != ''">
  37. and t3.name like concat('%', #{dto.userName}, '%')
  38. </if>
  39. <if test="dto.roomType != null and dto.roomType != ''">
  40. and t1.room_type = #{dto.roomType}
  41. </if>
  42. ORDER BY t2.sort_code,t1.sort_code
  43. </select>
  44. <select id="getMaxSortCode" resultType="java.lang.Integer">
  45. SELECT IFNULL(MAX(sort_code),0) FROM room_value_week_item WHERE delete_mark = 0
  46. </select>
  47. </mapper>