删除部门类,修改房间、房型、订单相关接口

This commit is contained in:
freeebird
2018-11-28 18:48:04 +08:00
parent 556e257d45
commit ed0f7f87aa
18 changed files with 189 additions and 198 deletions

View File

@@ -94,11 +94,6 @@
<!--enableDeleteByExample="false" enableSelectByExample="false"-->
<!--enableUpdateByExample="false">-->
<!--</table>-->
<!--<table schema="hotel" tableName="department_info"-->
<!--domainObjectName="Department" enableCountByExample="false"-->
<!--enableDeleteByExample="false" enableSelectByExample="false"-->
<!--enableUpdateByExample="false">-->
<!--</table>-->
<!--<table schema="hotel" tableName="check_in"-->
<!--domainObjectName="CheckIn" enableCountByExample="false"-->
<!--enableDeleteByExample="false" enableSelectByExample="false"-->

View File

@@ -1,93 +0,0 @@
<?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.DepartmentMapper">
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.Department">
<id column="department_id" jdbcType="INTEGER" property="departmentId" />
<result column="department_name" jdbcType="VARCHAR" property="departmentName" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
department_id, department_name, remark, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from department_info
where department_id = #{departmentId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from department_info
where department_id = #{departmentId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="cn.mafangui.hotel.entity.Department">
insert into department_info (department_id, department_name, remark,
create_time, update_time)
values (#{departmentId,jdbcType=INTEGER}, #{departmentName,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.Department">
insert into department_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="departmentId != null">
department_id,
</if>
<if test="departmentName != null">
department_name,
</if>
<if test="remark != null">
remark,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="departmentId != null">
#{departmentId,jdbcType=INTEGER},
</if>
<if test="departmentName != null">
#{departmentName,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,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.Department">
update department_info
<set>
<if test="departmentName != null">
department_name = #{departmentName,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,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 department_id = #{departmentId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.Department">
update department_info
set department_name = #{departmentName,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where department_id = #{departmentId,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -18,29 +18,41 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
order_id, order_type_id, order_type, user_id, name, phone, room_type_id, room_type,
order_id, order_type_id, order_type, user_id, name, phone, room_type_id, 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
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="selectAllByUser" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from order_info
where user_id = #{userId,jdbcType=INTEGER} and order_status > #{orderStatus,jdbcType=INTEGER}
</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_id, order_type,
user_id, name, phone,
room_type_id, room_type, order_date,
order_days, order_status, order_cost,
insert into order_info (order_id, order_type_id, order_type,
user_id, name, phone,
room_type_id, room_type, order_date,
order_days, order_status, order_cost,
create_time, update_time)
values (#{orderId,jdbcType=INTEGER}, #{orderTypeId,jdbcType=INTEGER}, #{orderType,jdbcType=VARCHAR},
#{userId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
#{roomTypeId,jdbcType=INTEGER}, #{roomType,jdbcType=VARCHAR}, #{orderDate,jdbcType=DATE},
#{orderDays,jdbcType=INTEGER}, #{orderStatus,jdbcType=INTEGER}, #{orderCost,jdbcType=DOUBLE},
values (#{orderId,jdbcType=INTEGER}, #{orderTypeId,jdbcType=INTEGER}, #{orderType,jdbcType=VARCHAR},
#{userId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
#{roomTypeId,jdbcType=INTEGER}, #{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">
@@ -367,4 +379,4 @@
update_time = now()
where order_id = #{orderId,jdbcType=INTEGER}
</update>
</mapper>
</mapper>

View File

@@ -14,37 +14,50 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
room_id, room_number, type_id, room_type, room_price, room_discount, room_status,
room_id, room_number, type_id, room_type, room_price, room_discount, room_status,
remark, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
select
<include refid="Base_Column_List" />
from room_info
where room_id = #{roomId,jdbcType=INTEGER}
</select>
<select id="selectByType" parameterType="Integer" resultMap="BaseResultMap">
select * from room_info
select
<include refid="Base_Column_List" />
from room_info
where type_id = #{typeId,jdbcType=INTEGER}
</select>
<select id="selectByStatus" parameterType="Integer" resultMap="BaseResultMap">
select * from room_info
select
<include refid="Base_Column_List" />
from room_info
where room_status = #{roomStatus,jdbcType=INTEGER}
</select>
<select id="randomSelectByTypeAndStatus" parameterType="Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from room_info
where type_id = #{typeId,jdbcType=INTEGER} and room_status = #{roomStatus,jdbcType=INTEGER}
ORDER BY RAND() LIMIT 1
</select>
<select id="selectAll" resultMap="BaseResultMap">
select * from room_info
select
<include refid="Base_Column_List" />
from room_info
</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, type_id,
room_type, room_price, room_discount,
room_status, remark, create_time,
insert into room_info (room_id, room_number, type_id,
room_type, room_price, room_discount,
room_status, remark, create_time,
update_time)
values (#{roomId,jdbcType=INTEGER}, #{roomNumber,jdbcType=VARCHAR}, #{typeId,jdbcType=INTEGER},
#{roomType,jdbcType=VARCHAR}, #{roomPrice,jdbcType=DOUBLE}, #{roomDiscount,jdbcType=DOUBLE},
values (#{roomId,jdbcType=INTEGER}, #{roomNumber,jdbcType=VARCHAR}, #{typeId,jdbcType=INTEGER},
#{roomType,jdbcType=VARCHAR}, #{roomPrice,jdbcType=DOUBLE}, #{roomDiscount,jdbcType=DOUBLE},
#{roomStatus,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, now(),
now())
</insert>
@@ -147,4 +160,4 @@
update_time = now()
where room_id = #{roomId,jdbcType=INTEGER}
</update>
</mapper>
</mapper>