mirror of
https://github.com/FreeeBird/hotel.git
synced 2025-05-06 19:49:26 +08:00
142 lines
5.2 KiB
XML
142 lines
5.2 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="cn.mafangui.hotel.mapper.RoomMapper">
|
|
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.Room">
|
|
<id column="room_id" jdbcType="INTEGER" property="roomId" />
|
|
<result column="room_number" jdbcType="VARCHAR" property="roomNumber" />
|
|
<result column="room_floor" jdbcType="INTEGER" property="roomFloor" />
|
|
<result column="room_type" jdbcType="INTEGER" property="roomType" />
|
|
<result column="room_price" jdbcType="DECIMAL" property="roomPrice" />
|
|
<result column="room_discount" jdbcType="REAL" property="roomDiscount" />
|
|
<result column="room_status" jdbcType="VARCHAR" property="roomStatus" />
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
room_id, room_number, room_floor, room_type, room_price, room_discount, room_status,
|
|
create_time, update_time
|
|
</sql>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from room_info
|
|
where room_id = #{roomId,jdbcType=INTEGER}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
delete from room_info
|
|
where room_id = #{roomId,jdbcType=INTEGER}
|
|
</delete>
|
|
<insert id="insert" parameterType="cn.mafangui.hotel.entity.Room">
|
|
insert into room_info (room_id, room_number, room_floor,
|
|
room_type, room_price, room_discount,
|
|
room_status, create_time, update_time
|
|
)
|
|
values (#{roomId,jdbcType=INTEGER}, #{roomNumber,jdbcType=VARCHAR}, #{roomFloor,jdbcType=INTEGER},
|
|
#{roomType,jdbcType=INTEGER}, #{roomPrice,jdbcType=DECIMAL}, #{roomDiscount,jdbcType=REAL},
|
|
#{roomStatus,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
|
|
)
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.Room">
|
|
insert into room_info
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="roomId != null">
|
|
room_id,
|
|
</if>
|
|
<if test="roomNumber != null">
|
|
room_number,
|
|
</if>
|
|
<if test="roomFloor != null">
|
|
room_floor,
|
|
</if>
|
|
<if test="roomType != null">
|
|
room_type,
|
|
</if>
|
|
<if test="roomPrice != null">
|
|
room_price,
|
|
</if>
|
|
<if test="roomDiscount != null">
|
|
room_discount,
|
|
</if>
|
|
<if test="roomStatus != null">
|
|
room_status,
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time,
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="roomId != null">
|
|
#{roomId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="roomNumber != null">
|
|
#{roomNumber,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="roomFloor != null">
|
|
#{roomFloor,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="roomType != null">
|
|
#{roomType,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="roomPrice != null">
|
|
#{roomPrice,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="roomDiscount != null">
|
|
#{roomDiscount,jdbcType=REAL},
|
|
</if>
|
|
<if test="roomStatus != null">
|
|
#{roomStatus,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createTime != null">
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<update id="updateByPrimaryKeySelective" parameterType="cn.mafangui.hotel.entity.Room">
|
|
update room_info
|
|
<set>
|
|
<if test="roomNumber != null">
|
|
room_number = #{roomNumber,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="roomFloor != null">
|
|
room_floor = #{roomFloor,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="roomType != null">
|
|
room_type = #{roomType,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="roomPrice != null">
|
|
room_price = #{roomPrice,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="roomDiscount != null">
|
|
room_discount = #{roomDiscount,jdbcType=REAL},
|
|
</if>
|
|
<if test="roomStatus != null">
|
|
room_status = #{roomStatus,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
</set>
|
|
where room_id = #{roomId,jdbcType=INTEGER}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.Room">
|
|
update room_info
|
|
set room_number = #{roomNumber,jdbcType=VARCHAR},
|
|
room_floor = #{roomFloor,jdbcType=INTEGER},
|
|
room_type = #{roomType,jdbcType=INTEGER},
|
|
room_price = #{roomPrice,jdbcType=DECIMAL},
|
|
room_discount = #{roomDiscount,jdbcType=REAL},
|
|
room_status = #{roomStatus,jdbcType=VARCHAR},
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
|
where room_id = #{roomId,jdbcType=INTEGER}
|
|
</update>
|
|
</mapper> |