RoomRuleMapper.xml 1.0 KB

1234567891011121314151617181920
  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.RoomRuleMapper">
  6. <select id="getPage" resultType="com.xjrsoft.module.room.vo.RoomRulePageVo">
  7. SELECT id,sort_code,NAME,rule,(
  8. SELECT GROUP_CONCAT(t2.name) FROM room_rule_item t1
  9. LEFT JOIN base_office_build t2 ON t1.office_build_id = t2.id
  10. WHERE t1.delete_mark = 0 AND t2.delete_mark = 0 AND t1.room_rule_id = room_rule.id
  11. ) AS build_names FROM room_rule WHERE delete_mark = 0 ORDER BY sort_code
  12. </select>
  13. <select id="getMaxSortCode" resultType="java.lang.Integer">
  14. SELECT IFNULL(MAX(sort_code),0) FROM room_rule WHERE delete_mark = 0
  15. </select>
  16. <select id="getItemMaxSortCode" resultType="java.lang.Integer">
  17. SELECT IFNULL(MAX(sort_code),0) FROM room_rule_item WHERE delete_mark = 0
  18. </select>
  19. </mapper>