package com.org.web.room.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.org.web.room.domain.BcRoom;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BcRoomMapper extends BaseMapper<BcRoom> {

    @Select("<script>" +
            "select * " +
            "from bc_room " +
            "where is_delete = 0 "+

            " <if test = 'name != null and name != \"\"'> " +
            "  and name like concat('%', #{name}, '%') " +
            " </if> " +

            " <if test = 'roomType != null'> " +
            "  and room_type = #{roomType} " +
            " </if> " +

            " order by create_time " +
            "</script>")
    List<BcRoom> queryList(BcRoom room);

}
