mirror of
https://github.com/FreeeBird/hotel.git
synced 2025-09-14 11:19:45 +08:00
枚举类编写
This commit is contained in:
@@ -208,175 +208,4 @@
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where order_id = #{orderId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.Order">
|
||||
<id column="order_id" jdbcType="INTEGER" property="orderId" />
|
||||
<result column="order_type" jdbcType="VARCHAR" property="orderType" />
|
||||
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
||||
<result column="room_type" jdbcType="VARCHAR" property="roomType" />
|
||||
<result column="order_date" jdbcType="DATE" property="orderDate" />
|
||||
<result column="order_days" jdbcType="INTEGER" property="orderDays" />
|
||||
<result column="order_status" jdbcType="INTEGER" property="orderStatus" />
|
||||
<result column="order_cost" jdbcType="DOUBLE" property="orderCost" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
order_id, order_type, user_id, name,phone, room_type, order_date, order_days, order_status,
|
||||
order_cost, create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from order_info
|
||||
where order_id = #{orderId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from order_info
|
||||
where user_id = #{userId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from order_info
|
||||
</select>
|
||||
<select id="userSelectAll" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
*
|
||||
from order_info
|
||||
where order_status >= -2 and user_id = #{userId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from order_info
|
||||
where order_id = #{orderId,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.Order">
|
||||
insert into order_info (order_id, order_type,name, phone,
|
||||
room_type, order_date,
|
||||
order_days, order_status, order_cost,
|
||||
create_time, update_time)
|
||||
values (#{orderId,jdbcType=INTEGER}, #{orderType,jdbcType=VARCHAR},
|
||||
#{name,jdbcType=VARCHAR},#{phone,jdbcType=VARCHAR},
|
||||
#{roomType,jdbcType=VARCHAR},#{orderDate,jdbcType=DATE},
|
||||
#{orderDays,jdbcType=INTEGER}, #{orderStatus,jdbcType=INTEGER}, #{orderCost,jdbcType=DOUBLE},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.Order">
|
||||
insert into order_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">
|
||||
order_id,
|
||||
</if>
|
||||
<if test="orderType != null">
|
||||
order_type,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone,
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type,
|
||||
</if>
|
||||
<if test="orderDate != null">
|
||||
order_date,
|
||||
</if>
|
||||
<if test="orderDays != null">
|
||||
order_days,
|
||||
</if>
|
||||
<if test="orderStatus != null">
|
||||
order_status,
|
||||
</if>
|
||||
<if test="orderCost != null">
|
||||
order_cost,
|
||||
</if>
|
||||
create_time,
|
||||
update_time,
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">
|
||||
#{orderId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="orderType != null">
|
||||
#{orderType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
#{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
#{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="orderDate != null">
|
||||
#{orderDate,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="orderDays != null">
|
||||
#{orderDays,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="orderStatus != null">
|
||||
#{orderStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="orderCost != null">
|
||||
#{orderCost,jdbcType=DOUBLE},
|
||||
</if>
|
||||
now(),
|
||||
now(),
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="cn.mafangui.hotel.entity.Order">
|
||||
update order_info
|
||||
<set>
|
||||
<if test="orderType != null">
|
||||
order_type = #{orderType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="orderDate != null">
|
||||
order_date = #{orderDate,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="orderDays != null">
|
||||
order_days = #{orderDays,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="orderStatus != null">
|
||||
order_status = #{orderStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="orderCost != null">
|
||||
order_cost = #{orderCost,jdbcType=DOUBLE},
|
||||
</if>
|
||||
update_time = now(),
|
||||
</set>
|
||||
where order_id = #{orderId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.Order">
|
||||
update order_info
|
||||
set order_type = #{orderType,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
order_date = #{orderDate,jdbcType=DATE},
|
||||
order_days = #{orderDays,jdbcType=INTEGER},
|
||||
order_status = #{orderStatus,jdbcType=INTEGER},
|
||||
order_cost = #{orderCost,jdbcType=DOUBLE},
|
||||
update_time = now()
|
||||
where order_id = #{orderId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
|
@@ -38,7 +38,7 @@
|
||||
<select id="randomSelectByTypeAndStatus" parameterType="Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room_info
|
||||
from room_info
|
||||
where type_id = #{typeId,jdbcType=INTEGER} and room_status = #{roomStatus,jdbcType=INTEGER}
|
||||
ORDER BY RAND() LIMIT 1
|
||||
</select>
|
||||
|
@@ -26,10 +26,20 @@
|
||||
where type_id = #{typeId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
select * from room_type
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room_type
|
||||
</select>
|
||||
<select id="selectAllWithRest" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room_type where rest > 0
|
||||
</select>
|
||||
<select id="selectByRoomType" parameterType="String" resultMap="BaseResultMap">
|
||||
select * from room_type where room_type = #{roomType,jdbcType=VARCHAR}
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room_type
|
||||
where room_type = #{roomType,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from room_type
|
||||
|
Reference in New Issue
Block a user