RoomThirdSettingDao.xml 1.1 KB

12345678910111213141516171819202122232425
  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.chuanghai.ihotel.dao.RoomThirdSettingDao">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.chuanghai.ihotel.entity.RoomThirdSettingEntity" id="roomThirdSettingMap">
  6. <result property="id" column="id"/>
  7. <result property="roomId" column="room_id"/>
  8. <result property="electricId" column="electric_id"/>
  9. <result property="waterId" column="water_id"/>
  10. <result property="lockId" column="lock_id"/>
  11. <result property="lockMac" column="lock_mac"/>
  12. </resultMap>
  13. <select id="getByRoomid" resultType="com.chuanghai.ihotel.entity.RoomThirdSettingEntity" resultMap="roomThirdSettingMap">
  14. select * from room_third_setting
  15. <where>
  16. <if test="roomid != null and roomid != ''">
  17. and room_third_setting.room_id = #{roomid}
  18. </if>
  19. </where>
  20. limit 1
  21. </select>
  22. </mapper>