mirror of
https://github.com/FreeeBird/hotel.git
synced 2025-09-14 11:19:45 +08:00
完成WorkerService类编写,通过单元测试
This commit is contained in:
@@ -10,5 +10,5 @@ spring:
|
||||
url: jdbc:mysql://127.0.0.1:3306/hotel?useUnicode=true&characterEncoding=UTF-8
|
||||
mybatis:
|
||||
type-aliases-package: classpath*:cn.mafangui.hotel.entity
|
||||
mapper-locations: classpath*:mapper/*.xml
|
||||
mapper-locations: classpath*:mybatis/mapper/*.xml
|
||||
|
||||
|
@@ -44,7 +44,7 @@
|
||||
</javaModelGenerator>
|
||||
|
||||
<!-- 生成mapper xml文件 -->
|
||||
<sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources">
|
||||
<sqlMapGenerator targetPackage="mybatis/mapper" targetProject="src/main/resources">
|
||||
<!-- enableSubPackages:是否让schema作为包的后缀 -->
|
||||
<property name="enableSubPackages" value="false" />
|
||||
</sqlMapGenerator>
|
||||
|
@@ -1,153 +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.CheckInMapper">
|
||||
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.CheckIn">
|
||||
<id column="check_in_id" jdbcType="INTEGER" property="checkInId" />
|
||||
<result column="order_id" jdbcType="INTEGER" property="orderId" />
|
||||
<result column="room_number" jdbcType="VARCHAR" property="roomNumber" />
|
||||
<result column="room_type" jdbcType="VARCHAR" property="roomType" />
|
||||
<result column="peo_count" jdbcType="INTEGER" property="peoCount" />
|
||||
<result column="persons" jdbcType="VARCHAR" property="persons" />
|
||||
<result column="ids" jdbcType="VARCHAR" property="ids" />
|
||||
<result column="check_in_time" jdbcType="TIMESTAMP" property="checkInTime" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
check_in_id, order_id, room_number, room_type, peo_count, persons, ids, check_in_time,
|
||||
create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from check_in
|
||||
where check_in_id = #{checkInId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from check_in
|
||||
where check_in_id = #{checkInId,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.CheckIn">
|
||||
insert into check_in (check_in_id, order_id, room_number,
|
||||
room_type, peo_count, persons,
|
||||
ids, check_in_time, create_time,
|
||||
update_time)
|
||||
values (#{checkInId,jdbcType=INTEGER}, #{orderId,jdbcType=INTEGER}, #{roomNumber,jdbcType=VARCHAR},
|
||||
#{roomType,jdbcType=VARCHAR}, #{peoCount,jdbcType=INTEGER}, #{persons,jdbcType=VARCHAR},
|
||||
#{ids,jdbcType=VARCHAR}, #{checkInTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.CheckIn">
|
||||
insert into check_in
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="checkInId != null">
|
||||
check_in_id,
|
||||
</if>
|
||||
<if test="orderId != null">
|
||||
order_id,
|
||||
</if>
|
||||
<if test="roomNumber != null">
|
||||
room_number,
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type,
|
||||
</if>
|
||||
<if test="peoCount != null">
|
||||
peo_count,
|
||||
</if>
|
||||
<if test="persons != null">
|
||||
persons,
|
||||
</if>
|
||||
<if test="ids != null">
|
||||
ids,
|
||||
</if>
|
||||
<if test="checkInTime != null">
|
||||
check_in_time,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="checkInId != null">
|
||||
#{checkInId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="orderId != null">
|
||||
#{orderId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="roomNumber != null">
|
||||
#{roomNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
#{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="peoCount != null">
|
||||
#{peoCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="persons != null">
|
||||
#{persons,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="ids != null">
|
||||
#{ids,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="checkInTime != null">
|
||||
#{checkInTime,jdbcType=TIMESTAMP},
|
||||
</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.CheckIn">
|
||||
update check_in
|
||||
<set>
|
||||
<if test="orderId != null">
|
||||
order_id = #{orderId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="roomNumber != null">
|
||||
room_number = #{roomNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="peoCount != null">
|
||||
peo_count = #{peoCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="persons != null">
|
||||
persons = #{persons,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="ids != null">
|
||||
ids = #{ids,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="checkInTime != null">
|
||||
check_in_time = #{checkInTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where check_in_id = #{checkInId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.CheckIn">
|
||||
update check_in
|
||||
set order_id = #{orderId,jdbcType=INTEGER},
|
||||
room_number = #{roomNumber,jdbcType=VARCHAR},
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
peo_count = #{peoCount,jdbcType=INTEGER},
|
||||
persons = #{persons,jdbcType=VARCHAR},
|
||||
ids = #{ids,jdbcType=VARCHAR},
|
||||
check_in_time = #{checkInTime,jdbcType=TIMESTAMP},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where check_in_id = #{checkInId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@@ -1,141 +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.HotelMapper">
|
||||
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.Hotel">
|
||||
<id column="hotel_id" jdbcType="INTEGER" property="hotelId" />
|
||||
<result column="hotel_name" jdbcType="VARCHAR" property="hotelName" />
|
||||
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
||||
<result column="telephone" jdbcType="VARCHAR" property="telephone" />
|
||||
<result column="email" jdbcType="VARCHAR" property="email" />
|
||||
<result column="address" jdbcType="VARCHAR" property="address" />
|
||||
<result column="website" jdbcType="VARCHAR" property="website" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
hotel_id, hotel_name, phone, telephone, email, address, website, create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from hotel_info
|
||||
where hotel_id = #{hotelId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from hotel_info
|
||||
where hotel_id = #{hotelId,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.Hotel">
|
||||
insert into hotel_info (hotel_id, hotel_name, phone,
|
||||
telephone, email, address,
|
||||
website, create_time, update_time
|
||||
)
|
||||
values (#{hotelId,jdbcType=INTEGER}, #{hotelName,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
|
||||
#{telephone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
|
||||
#{website,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.Hotel">
|
||||
insert into hotel_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="hotelId != null">
|
||||
hotel_id,
|
||||
</if>
|
||||
<if test="hotelName != null">
|
||||
hotel_name,
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone,
|
||||
</if>
|
||||
<if test="telephone != null">
|
||||
telephone,
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email,
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address,
|
||||
</if>
|
||||
<if test="website != null">
|
||||
website,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="hotelId != null">
|
||||
#{hotelId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="hotelName != null">
|
||||
#{hotelName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
#{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="telephone != null">
|
||||
#{telephone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
#{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
#{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="website != null">
|
||||
#{website,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.Hotel">
|
||||
update hotel_info
|
||||
<set>
|
||||
<if test="hotelName != null">
|
||||
hotel_name = #{hotelName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="telephone != null">
|
||||
telephone = #{telephone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="website != null">
|
||||
website = #{website,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 hotel_id = #{hotelId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.Hotel">
|
||||
update hotel_info
|
||||
set hotel_name = #{hotelName,jdbcType=VARCHAR},
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
telephone = #{telephone,jdbcType=VARCHAR},
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
website = #{website,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where hotel_id = #{hotelId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@@ -1,164 +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.OrderMapper">
|
||||
<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="phone" jdbcType="VARCHAR" property="phone" />
|
||||
<result column="room_type" jdbcType="VARCHAR" property="roomType" />
|
||||
<result column="num_of_room" jdbcType="INTEGER" property="numOfRoom" />
|
||||
<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, phone, room_type, num_of_room, 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>
|
||||
<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, phone,
|
||||
room_type, num_of_room, order_date,
|
||||
order_days, order_status, order_cost,
|
||||
create_time, update_time)
|
||||
values (#{orderId,jdbcType=INTEGER}, #{orderType,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
|
||||
#{roomType,jdbcType=VARCHAR}, #{numOfRoom,jdbcType=INTEGER}, #{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="phone != null">
|
||||
phone,
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type,
|
||||
</if>
|
||||
<if test="numOfRoom != null">
|
||||
num_of_room,
|
||||
</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>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">
|
||||
#{orderId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="orderType != null">
|
||||
#{orderType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
#{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
#{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="numOfRoom != null">
|
||||
#{numOfRoom,jdbcType=INTEGER},
|
||||
</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>
|
||||
<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.Order">
|
||||
update order_info
|
||||
<set>
|
||||
<if test="orderType != null">
|
||||
order_type = #{orderType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="numOfRoom != null">
|
||||
num_of_room = #{numOfRoom,jdbcType=INTEGER},
|
||||
</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>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</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},
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
num_of_room = #{numOfRoom,jdbcType=INTEGER},
|
||||
order_date = #{orderDate,jdbcType=DATE},
|
||||
order_days = #{orderDays,jdbcType=INTEGER},
|
||||
order_status = #{orderStatus,jdbcType=INTEGER},
|
||||
order_cost = #{orderCost,jdbcType=DOUBLE},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where order_id = #{orderId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@@ -1,153 +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.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="type_id" jdbcType="INTEGER" property="typeId" />
|
||||
<result column="room_type" jdbcType="VARCHAR" property="roomType" />
|
||||
<result column="room_price" jdbcType="DOUBLE" property="roomPrice" />
|
||||
<result column="room_discount" jdbcType="DOUBLE" property="roomDiscount" />
|
||||
<result column="room_status" jdbcType="INTEGER" property="roomStatus" />
|
||||
<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">
|
||||
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
|
||||
<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, 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},
|
||||
#{roomStatus,jdbcType=INTEGER}, #{remark,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="typeId != null">
|
||||
type_id,
|
||||
</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="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="roomId != null">
|
||||
#{roomId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="roomNumber != null">
|
||||
#{roomNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
#{typeId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
#{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomPrice != null">
|
||||
#{roomPrice,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="roomDiscount != null">
|
||||
#{roomDiscount,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="roomStatus != null">
|
||||
#{roomStatus,jdbcType=INTEGER},
|
||||
</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.Room">
|
||||
update room_info
|
||||
<set>
|
||||
<if test="roomNumber != null">
|
||||
room_number = #{roomNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id = #{typeId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomPrice != null">
|
||||
room_price = #{roomPrice,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="roomDiscount != null">
|
||||
room_discount = #{roomDiscount,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="roomStatus != null">
|
||||
room_status = #{roomStatus,jdbcType=INTEGER},
|
||||
</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 room_id = #{roomId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.Room">
|
||||
update room_info
|
||||
set room_number = #{roomNumber,jdbcType=VARCHAR},
|
||||
type_id = #{typeId,jdbcType=INTEGER},
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
room_price = #{roomPrice,jdbcType=DOUBLE},
|
||||
room_discount = #{roomDiscount,jdbcType=DOUBLE},
|
||||
room_status = #{roomStatus,jdbcType=INTEGER},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where room_id = #{roomId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@@ -1,164 +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.RoomTypeMapper">
|
||||
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.RoomType">
|
||||
<id column="type_id" jdbcType="BIGINT" property="typeId" />
|
||||
<result column="room_type" jdbcType="VARCHAR" property="roomType" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="price" jdbcType="DOUBLE" property="price" />
|
||||
<result column="discount" jdbcType="DOUBLE" property="discount" />
|
||||
<result column="area" jdbcType="INTEGER" property="area" />
|
||||
<result column="bed_num" jdbcType="INTEGER" property="bedNum" />
|
||||
<result column="bed_size" jdbcType="VARCHAR" property="bedSize" />
|
||||
<result column="window" jdbcType="INTEGER" property="window" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
type_id, room_type, remark, price, discount, area, bed_num, bed_size, window, create_time,
|
||||
update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room_type
|
||||
where type_id = #{typeId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from room_type
|
||||
where type_id = #{typeId,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.RoomType">
|
||||
insert into room_type (type_id, room_type, remark,
|
||||
price, discount, area,
|
||||
bed_num, bed_size, window,
|
||||
create_time, update_time)
|
||||
values (#{typeId,jdbcType=BIGINT}, #{roomType,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
|
||||
#{price,jdbcType=DOUBLE}, #{discount,jdbcType=DOUBLE}, #{area,jdbcType=INTEGER},
|
||||
#{bedNum,jdbcType=INTEGER}, #{bedSize,jdbcType=VARCHAR}, #{window,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.RoomType">
|
||||
insert into room_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="price != null">
|
||||
price,
|
||||
</if>
|
||||
<if test="discount != null">
|
||||
discount,
|
||||
</if>
|
||||
<if test="area != null">
|
||||
area,
|
||||
</if>
|
||||
<if test="bedNum != null">
|
||||
bed_num,
|
||||
</if>
|
||||
<if test="bedSize != null">
|
||||
bed_size,
|
||||
</if>
|
||||
<if test="window != null">
|
||||
window,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null">
|
||||
#{typeId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
#{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="price != null">
|
||||
#{price,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="discount != null">
|
||||
#{discount,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="area != null">
|
||||
#{area,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="bedNum != null">
|
||||
#{bedNum,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="bedSize != null">
|
||||
#{bedSize,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="window != null">
|
||||
#{window,jdbcType=INTEGER},
|
||||
</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.RoomType">
|
||||
update room_type
|
||||
<set>
|
||||
<if test="roomType != null">
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="price != null">
|
||||
price = #{price,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="discount != null">
|
||||
discount = #{discount,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="area != null">
|
||||
area = #{area,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="bedNum != null">
|
||||
bed_num = #{bedNum,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="bedSize != null">
|
||||
bed_size = #{bedSize,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="window != null">
|
||||
window = #{window,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where type_id = #{typeId,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.RoomType">
|
||||
update room_type
|
||||
set room_type = #{roomType,jdbcType=VARCHAR},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
price = #{price,jdbcType=DOUBLE},
|
||||
discount = #{discount,jdbcType=DOUBLE},
|
||||
area = #{area,jdbcType=INTEGER},
|
||||
bed_num = #{bedNum,jdbcType=INTEGER},
|
||||
bed_size = #{bedSize,jdbcType=VARCHAR},
|
||||
window = #{window,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where type_id = #{typeId,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
@@ -1,160 +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.UserMapper">
|
||||
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.User">
|
||||
<id column="user_id" jdbcType="INTEGER" property="userId" />
|
||||
<result column="username" jdbcType="VARCHAR" property="username" />
|
||||
<result column="password" jdbcType="VARCHAR" property="password" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="gender" jdbcType="CHAR" property="gender" />
|
||||
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
||||
<result column="email" jdbcType="VARCHAR" property="email" />
|
||||
<result column="address" jdbcType="VARCHAR" property="address" />
|
||||
<result column="idcard" jdbcType="VARCHAR" property="idcard" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
user_id, username, password, name, gender, phone, email, address, idcard, create_time,
|
||||
update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user_info
|
||||
where user_id = #{userId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from user_info
|
||||
where user_id = #{userId,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.User">
|
||||
insert into user_info (user_id, username, password,
|
||||
name, gender, phone, email,
|
||||
address, idcard, create_time,
|
||||
update_time)
|
||||
values (#{userId,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
|
||||
#{name,jdbcType=VARCHAR}, #{gender,jdbcType=CHAR}, #{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR},
|
||||
#{address,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR},now(),
|
||||
now())
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.User">
|
||||
insert into user_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="username != null">
|
||||
username,
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
gender,
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone,
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email,
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address,
|
||||
</if>
|
||||
<if test="idcard != null">
|
||||
idcard,
|
||||
</if>
|
||||
create_time,
|
||||
update_time,
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="username != null">
|
||||
#{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
#{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
#{gender,jdbcType=CHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
#{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
#{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
#{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="idcard != null">
|
||||
#{idcard,jdbcType=VARCHAR},
|
||||
</if>
|
||||
now(),
|
||||
now(),
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="cn.mafangui.hotel.entity.User">
|
||||
update user_info
|
||||
<set>
|
||||
<if test="username != null">
|
||||
username = #{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
gender = #{gender,jdbcType=CHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="idcard != null">
|
||||
idcard = #{idcard,jdbcType=VARCHAR},
|
||||
</if>
|
||||
update_time = now(),
|
||||
</set>
|
||||
where user_id = #{userId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.User">
|
||||
update user_info
|
||||
set username = #{username,jdbcType=VARCHAR},
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
gender = #{gender,jdbcType=CHAR},
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
idcard = #{idcard,jdbcType=VARCHAR},
|
||||
update_time = now()
|
||||
where user_id = #{userId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="count">
|
||||
select count(*) from user_info
|
||||
</select>
|
||||
<select id="selectAll" resultMap="cn.mafangui.hotel.entity.User">
|
||||
select * from user_info
|
||||
</select>
|
||||
<select id="selectByUsernameAndPassword" resultMap="cn.mafangui.hotel.entity.User">
|
||||
select * from user_info
|
||||
where username = #{username,jdbcType=VARCHAR} and password = #{password,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
@@ -1,177 +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.WorkerMapper">
|
||||
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.Worker">
|
||||
<id column="worker_id" jdbcType="INTEGER" property="workerId" />
|
||||
<result column="role" jdbcType="VARCHAR" property="role" />
|
||||
<result column="username" jdbcType="VARCHAR" property="username" />
|
||||
<result column="password" jdbcType="VARCHAR" property="password" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="gender" jdbcType="CHAR" property="gender" />
|
||||
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
||||
<result column="department" jdbcType="INTEGER" property="department" />
|
||||
<result column="email" jdbcType="VARCHAR" property="email" />
|
||||
<result column="address" jdbcType="VARCHAR" property="address" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
worker_id, role, username, password, name, gender, phone, department, email, address,
|
||||
create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from worker_info
|
||||
where worker_id = #{workerId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from worker_info
|
||||
where worker_id = #{workerId,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.Worker">
|
||||
insert into worker_info (worker_id, role, username,
|
||||
password, name, gender,
|
||||
phone, department, email,
|
||||
address, create_time, update_time
|
||||
)
|
||||
values (#{workerId,jdbcType=INTEGER}, #{role,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR},
|
||||
#{password,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=CHAR},
|
||||
#{phone,jdbcType=VARCHAR}, #{department,jdbcType=INTEGER}, #{email,jdbcType=VARCHAR},
|
||||
#{address,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.Worker">
|
||||
insert into worker_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="workerId != null">
|
||||
worker_id,
|
||||
</if>
|
||||
<if test="role != null">
|
||||
role,
|
||||
</if>
|
||||
<if test="username != null">
|
||||
username,
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
gender,
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone,
|
||||
</if>
|
||||
<if test="department != null">
|
||||
department,
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email,
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="workerId != null">
|
||||
#{workerId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="role != null">
|
||||
#{role,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="username != null">
|
||||
#{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
#{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
#{gender,jdbcType=CHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
#{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="department != null">
|
||||
#{department,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
#{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
#{address,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.Worker">
|
||||
update worker_info
|
||||
<set>
|
||||
<if test="role != null">
|
||||
role = #{role,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="username != null">
|
||||
username = #{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
gender = #{gender,jdbcType=CHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="department != null">
|
||||
department = #{department,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address = #{address,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 worker_id = #{workerId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.Worker">
|
||||
update worker_info
|
||||
set role = #{role,jdbcType=VARCHAR},
|
||||
username = #{username,jdbcType=VARCHAR},
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
gender = #{gender,jdbcType=CHAR},
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
department = #{department,jdbcType=INTEGER},
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where worker_id = #{workerId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@@ -1,106 +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.AdminMapper">
|
||||
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.Admin">
|
||||
<id column="admin_id" jdbcType="INTEGER" property="adminId" />
|
||||
<result column="user_name" jdbcType="VARCHAR" property="userName" />
|
||||
<result column="password" jdbcType="VARCHAR" property="password" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
admin_id, user_name, password, create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from admin
|
||||
where admin_id = #{adminId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from admin
|
||||
where admin_id = #{adminId,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.Admin">
|
||||
insert into admin (admin_id, user_name, password,
|
||||
create_time, update_time)
|
||||
values (#{adminId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.Admin">
|
||||
insert into admin
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="adminId != null">
|
||||
admin_id,
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
user_name,
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password,
|
||||
</if>
|
||||
create_time,
|
||||
update_time,
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="adminId != null">
|
||||
#{adminId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
#{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
#{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
now(),
|
||||
now()
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="cn.mafangui.hotel.entity.Admin">
|
||||
update admin
|
||||
<set>
|
||||
<if test="userName != null">
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password = #{password,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 admin_id = #{adminId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.Admin">
|
||||
update admin
|
||||
set user_name = #{userName,jdbcType=VARCHAR},
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where admin_id = #{adminId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectByUserName" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select * from admin
|
||||
where user_name = #{userName,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="selectByUserNameAndPassword" parameterType="cn.mafangui.hotel.entity.Admin" resultMap="BaseResultMap">
|
||||
select * from admin
|
||||
where user_name = #{userName,jdbcType=VARCHAR} and password = #{password,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
select * from admin
|
||||
</select>
|
||||
<update id="updateByUserNameSelective" parameterType="cn.mafangui.hotel.entity.Admin">
|
||||
update admin
|
||||
<set>
|
||||
<if test="password != null">
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
update_time = now(),
|
||||
</set>
|
||||
where user_name = #{userName,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
@@ -5,17 +5,17 @@
|
||||
<id column="check_in_id" jdbcType="INTEGER" property="checkInId" />
|
||||
<result column="order_id" jdbcType="INTEGER" property="orderId" />
|
||||
<result column="room_number" jdbcType="VARCHAR" property="roomNumber" />
|
||||
<result column="room_type" jdbcType="INTEGER" property="roomType" />
|
||||
<result column="person_num" jdbcType="INTEGER" property="personNum" />
|
||||
<result column="person_name" jdbcType="VARCHAR" property="personName" />
|
||||
<result column="id_numbers" jdbcType="VARCHAR" property="idNumbers" />
|
||||
<result column="room_type" jdbcType="VARCHAR" property="roomType" />
|
||||
<result column="peo_count" jdbcType="INTEGER" property="peoCount" />
|
||||
<result column="persons" jdbcType="VARCHAR" property="persons" />
|
||||
<result column="ids" jdbcType="VARCHAR" property="ids" />
|
||||
<result column="check_in_time" jdbcType="TIMESTAMP" property="checkInTime" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
check_in_id, order_id, room_number, room_type, person_num, person_name, id_numbers,
|
||||
check_in_time, create_time, update_time
|
||||
check_in_id, order_id, room_number, room_type, peo_count, persons, ids, check_in_time,
|
||||
create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
@@ -29,12 +29,12 @@
|
||||
</delete>
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.CheckIn">
|
||||
insert into check_in (check_in_id, order_id, room_number,
|
||||
room_type, person_num, person_name,
|
||||
id_numbers, check_in_time, create_time,
|
||||
room_type, peo_count, persons,
|
||||
ids, check_in_time, create_time,
|
||||
update_time)
|
||||
values (#{checkInId,jdbcType=INTEGER}, #{orderId,jdbcType=INTEGER}, #{roomNumber,jdbcType=VARCHAR},
|
||||
#{roomType,jdbcType=INTEGER}, #{personNum,jdbcType=INTEGER}, #{personName,jdbcType=VARCHAR},
|
||||
#{idNumbers,jdbcType=VARCHAR}, #{checkInTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{roomType,jdbcType=VARCHAR}, #{peoCount,jdbcType=INTEGER}, #{persons,jdbcType=VARCHAR},
|
||||
#{ids,jdbcType=VARCHAR}, #{checkInTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.CheckIn">
|
||||
@@ -52,14 +52,14 @@
|
||||
<if test="roomType != null">
|
||||
room_type,
|
||||
</if>
|
||||
<if test="personNum != null">
|
||||
person_num,
|
||||
<if test="peoCount != null">
|
||||
peo_count,
|
||||
</if>
|
||||
<if test="personName != null">
|
||||
person_name,
|
||||
<if test="persons != null">
|
||||
persons,
|
||||
</if>
|
||||
<if test="idNumbers != null">
|
||||
id_numbers,
|
||||
<if test="ids != null">
|
||||
ids,
|
||||
</if>
|
||||
<if test="checkInTime != null">
|
||||
check_in_time,
|
||||
@@ -82,16 +82,16 @@
|
||||
#{roomNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
#{roomType,jdbcType=INTEGER},
|
||||
#{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="personNum != null">
|
||||
#{personNum,jdbcType=INTEGER},
|
||||
<if test="peoCount != null">
|
||||
#{peoCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="personName != null">
|
||||
#{personName,jdbcType=VARCHAR},
|
||||
<if test="persons != null">
|
||||
#{persons,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="idNumbers != null">
|
||||
#{idNumbers,jdbcType=VARCHAR},
|
||||
<if test="ids != null">
|
||||
#{ids,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="checkInTime != null">
|
||||
#{checkInTime,jdbcType=TIMESTAMP},
|
||||
@@ -114,16 +114,16 @@
|
||||
room_number = #{roomNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type = #{roomType,jdbcType=INTEGER},
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="personNum != null">
|
||||
person_num = #{personNum,jdbcType=INTEGER},
|
||||
<if test="peoCount != null">
|
||||
peo_count = #{peoCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="personName != null">
|
||||
person_name = #{personName,jdbcType=VARCHAR},
|
||||
<if test="persons != null">
|
||||
persons = #{persons,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="idNumbers != null">
|
||||
id_numbers = #{idNumbers,jdbcType=VARCHAR},
|
||||
<if test="ids != null">
|
||||
ids = #{ids,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="checkInTime != null">
|
||||
check_in_time = #{checkInTime,jdbcType=TIMESTAMP},
|
||||
@@ -141,10 +141,10 @@
|
||||
update check_in
|
||||
set order_id = #{orderId,jdbcType=INTEGER},
|
||||
room_number = #{roomNumber,jdbcType=VARCHAR},
|
||||
room_type = #{roomType,jdbcType=INTEGER},
|
||||
person_num = #{personNum,jdbcType=INTEGER},
|
||||
person_name = #{personName,jdbcType=VARCHAR},
|
||||
id_numbers = #{idNumbers,jdbcType=VARCHAR},
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
peo_count = #{peoCount,jdbcType=INTEGER},
|
||||
persons = #{persons,jdbcType=VARCHAR},
|
||||
ids = #{ids,jdbcType=VARCHAR},
|
||||
check_in_time = #{checkInTime,jdbcType=TIMESTAMP},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
|
@@ -32,7 +32,7 @@
|
||||
)
|
||||
values (#{hotelId,jdbcType=INTEGER}, #{hotelName,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
|
||||
#{telephone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
|
||||
#{website,jdbcType=VARCHAR}, now(),now()
|
||||
#{website,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.Hotel">
|
||||
@@ -59,8 +59,12 @@
|
||||
<if test="website != null">
|
||||
website,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="hotelId != null">
|
||||
@@ -84,8 +88,12 @@
|
||||
<if test="website != null">
|
||||
#{website,jdbcType=VARCHAR},
|
||||
</if>
|
||||
now(),
|
||||
now(),
|
||||
<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.Hotel">
|
||||
@@ -130,15 +138,4 @@
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where hotel_id = #{hotelId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from hotel_info
|
||||
</select>
|
||||
<select id="selectByName" parameterType="String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from hotel_info
|
||||
where hotel_name = #{hotelName,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
@@ -3,20 +3,20 @@
|
||||
<mapper namespace="cn.mafangui.hotel.mapper.OrderMapper">
|
||||
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.Order">
|
||||
<id column="order_id" jdbcType="INTEGER" property="orderId" />
|
||||
<result column="booking_type" jdbcType="VARCHAR" property="bookingType" />
|
||||
<result column="order_type" jdbcType="VARCHAR" property="orderType" />
|
||||
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
||||
<result column="room_number" jdbcType="VARCHAR" property="roomNumber" />
|
||||
<result column="room_type" jdbcType="INTEGER" property="roomType" />
|
||||
<result column="booking_date" jdbcType="DATE" property="bookingDate" />
|
||||
<result column="booking_days" jdbcType="INTEGER" property="bookingDays" />
|
||||
<result column="room_type" jdbcType="VARCHAR" property="roomType" />
|
||||
<result column="num_of_room" jdbcType="INTEGER" property="numOfRoom" />
|
||||
<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="DECIMAL" property="orderCost" />
|
||||
<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, booking_type, phone, room_number, room_type, booking_date, booking_days,
|
||||
order_status, order_cost, create_time, update_time
|
||||
order_id, order_type, phone, room_type, num_of_room, order_date, order_days, order_status,
|
||||
order_cost, create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
@@ -29,13 +29,13 @@
|
||||
where order_id = #{orderId,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.Order">
|
||||
insert into order_info (order_id, booking_type, phone,
|
||||
room_number, room_type, booking_date,
|
||||
booking_days, order_status, order_cost,
|
||||
insert into order_info (order_id, order_type, phone,
|
||||
room_type, num_of_room, order_date,
|
||||
order_days, order_status, order_cost,
|
||||
create_time, update_time)
|
||||
values (#{orderId,jdbcType=INTEGER}, #{bookingType,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
|
||||
#{roomNumber,jdbcType=VARCHAR}, #{roomType,jdbcType=INTEGER}, #{bookingDate,jdbcType=DATE},
|
||||
#{bookingDays,jdbcType=INTEGER}, #{orderStatus,jdbcType=INTEGER}, #{orderCost,jdbcType=DECIMAL},
|
||||
values (#{orderId,jdbcType=INTEGER}, #{orderType,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
|
||||
#{roomType,jdbcType=VARCHAR}, #{numOfRoom,jdbcType=INTEGER}, #{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">
|
||||
@@ -44,23 +44,23 @@
|
||||
<if test="orderId != null">
|
||||
order_id,
|
||||
</if>
|
||||
<if test="bookingType != null">
|
||||
booking_type,
|
||||
<if test="orderType != null">
|
||||
order_type,
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone,
|
||||
</if>
|
||||
<if test="roomNumber != null">
|
||||
room_number,
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type,
|
||||
</if>
|
||||
<if test="bookingDate != null">
|
||||
booking_date,
|
||||
<if test="numOfRoom != null">
|
||||
num_of_room,
|
||||
</if>
|
||||
<if test="bookingDays != null">
|
||||
booking_days,
|
||||
<if test="orderDate != null">
|
||||
order_date,
|
||||
</if>
|
||||
<if test="orderDays != null">
|
||||
order_days,
|
||||
</if>
|
||||
<if test="orderStatus != null">
|
||||
order_status,
|
||||
@@ -79,29 +79,29 @@
|
||||
<if test="orderId != null">
|
||||
#{orderId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="bookingType != null">
|
||||
#{bookingType,jdbcType=VARCHAR},
|
||||
<if test="orderType != null">
|
||||
#{orderType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
#{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomNumber != null">
|
||||
#{roomNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
#{roomType,jdbcType=INTEGER},
|
||||
#{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bookingDate != null">
|
||||
#{bookingDate,jdbcType=DATE},
|
||||
<if test="numOfRoom != null">
|
||||
#{numOfRoom,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="bookingDays != null">
|
||||
#{bookingDays,jdbcType=INTEGER},
|
||||
<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=DECIMAL},
|
||||
#{orderCost,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
@@ -114,29 +114,29 @@
|
||||
<update id="updateByPrimaryKeySelective" parameterType="cn.mafangui.hotel.entity.Order">
|
||||
update order_info
|
||||
<set>
|
||||
<if test="bookingType != null">
|
||||
booking_type = #{bookingType,jdbcType=VARCHAR},
|
||||
<if test="orderType != null">
|
||||
order_type = #{orderType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomNumber != null">
|
||||
room_number = #{roomNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type = #{roomType,jdbcType=INTEGER},
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bookingDate != null">
|
||||
booking_date = #{bookingDate,jdbcType=DATE},
|
||||
<if test="numOfRoom != null">
|
||||
num_of_room = #{numOfRoom,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="bookingDays != null">
|
||||
booking_days = #{bookingDays,jdbcType=INTEGER},
|
||||
<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=DECIMAL},
|
||||
order_cost = #{orderCost,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
@@ -149,14 +149,14 @@
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.Order">
|
||||
update order_info
|
||||
set booking_type = #{bookingType,jdbcType=VARCHAR},
|
||||
set order_type = #{orderType,jdbcType=VARCHAR},
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
room_number = #{roomNumber,jdbcType=VARCHAR},
|
||||
room_type = #{roomType,jdbcType=INTEGER},
|
||||
booking_date = #{bookingDate,jdbcType=DATE},
|
||||
booking_days = #{bookingDays,jdbcType=INTEGER},
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
num_of_room = #{numOfRoom,jdbcType=INTEGER},
|
||||
order_date = #{orderDate,jdbcType=DATE},
|
||||
order_days = #{orderDays,jdbcType=INTEGER},
|
||||
order_status = #{orderStatus,jdbcType=INTEGER},
|
||||
order_cost = #{orderCost,jdbcType=DECIMAL},
|
||||
order_cost = #{orderCost,jdbcType=DOUBLE},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where order_id = #{orderId,jdbcType=INTEGER}
|
||||
|
@@ -4,18 +4,18 @@
|
||||
<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="type_name" jdbcType="VARCHAR" property="typeName" />
|
||||
<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="type_id" jdbcType="INTEGER" property="typeId" />
|
||||
<result column="room_type" jdbcType="VARCHAR" property="roomType" />
|
||||
<result column="room_price" jdbcType="DOUBLE" property="roomPrice" />
|
||||
<result column="room_discount" jdbcType="DOUBLE" property="roomDiscount" />
|
||||
<result column="room_status" jdbcType="INTEGER" property="roomStatus" />
|
||||
<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">
|
||||
room_id, room_number, room_floor, room_type, type_name, room_price, room_discount, room_status,
|
||||
create_time, update_time
|
||||
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
|
||||
@@ -27,7 +27,16 @@
|
||||
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,
|
||||
update_time)
|
||||
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}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.Room">
|
||||
insert into room_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -37,8 +46,8 @@
|
||||
<if test="roomNumber != null">
|
||||
room_number,
|
||||
</if>
|
||||
<if test="roomFloor != null">
|
||||
room_floor,
|
||||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type,
|
||||
@@ -52,6 +61,9 @@
|
||||
<if test="roomStatus != null">
|
||||
room_status,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
@@ -66,20 +78,23 @@
|
||||
<if test="roomNumber != null">
|
||||
#{roomNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomFloor != null">
|
||||
#{roomFloor,jdbcType=INTEGER},
|
||||
<if test="typeId != null">
|
||||
#{typeId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
#{roomType,jdbcType=INTEGER},
|
||||
#{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomPrice != null">
|
||||
#{roomPrice,jdbcType=DECIMAL},
|
||||
#{roomPrice,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="roomDiscount != null">
|
||||
#{roomDiscount,jdbcType=REAL},
|
||||
#{roomDiscount,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="roomStatus != null">
|
||||
#{roomStatus,jdbcType=VARCHAR},
|
||||
#{roomStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
@@ -89,82 +104,50 @@
|
||||
</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="typeId != null">
|
||||
type_id = #{typeId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomPrice != null">
|
||||
room_price = #{roomPrice,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="roomDiscount != null">
|
||||
room_discount = #{roomDiscount,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="roomStatus != null">
|
||||
room_status = #{roomStatus,jdbcType=INTEGER},
|
||||
</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 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},
|
||||
type_id = #{typeId,jdbcType=INTEGER},
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
room_price = #{roomPrice,jdbcType=DOUBLE},
|
||||
room_discount = #{roomDiscount,jdbcType=DOUBLE},
|
||||
room_status = #{roomStatus,jdbcType=INTEGER},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where room_id = #{roomId,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.Room">
|
||||
insert into room_info ( room_number, room_floor,
|
||||
room_type, type_name, room_price, room_discount,
|
||||
room_status, create_time, update_time
|
||||
)
|
||||
values (#{roomNumber,jdbcType=VARCHAR}, #{roomFloor,jdbcType=INTEGER},
|
||||
#{roomType,jdbcType=INTEGER}, #{typeName,jdbcType=VARCHAR}, #{roomPrice,jdbcType=DECIMAL}, #{roomDiscount,jdbcType=REAL},
|
||||
#{roomStatus,jdbcType=VARCHAR}, now(), now()
|
||||
)
|
||||
</insert>
|
||||
<delete id="deleteByRoomNumber" parameterType="String">
|
||||
delete from room_info where room_number = #{roomNumber,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<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="typeName != null">
|
||||
type_name = #{typeName,jdbcType=VARCHAR},
|
||||
</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>
|
||||
update_time = now(),
|
||||
</set>
|
||||
where room_id = #{roomId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectByRoomNumber" parameterType="String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room_info
|
||||
where room_number = #{roomNumber,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="selectAllRoom" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room_info
|
||||
</select>
|
||||
<select id="selectByType" parameterType="String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room_info
|
||||
where type_name = #{typeName,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="selectByStatus" parameterType="String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room_info
|
||||
where room_status = #{status,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
@@ -2,126 +2,163 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.mafangui.hotel.mapper.RoomTypeMapper">
|
||||
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.RoomType">
|
||||
<id column="type_id" jdbcType="INTEGER" property="typeId" />
|
||||
<result column="room_type" jdbcType="INTEGER" property="roomType" />
|
||||
<result column="type_name" jdbcType="VARCHAR" property="typeName" />
|
||||
<result column="booking_price" jdbcType="DOUBLE" property="bookingPrice" />
|
||||
<result column="booking_discount" jdbcType="DOUBLE" property="bookingDiscount" />
|
||||
<id column="type_id" jdbcType="BIGINT" property="typeId" />
|
||||
<result column="room_type" jdbcType="VARCHAR" property="roomType" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="price" jdbcType="DOUBLE" property="price" />
|
||||
<result column="discount" jdbcType="DOUBLE" property="discount" />
|
||||
<result column="area" jdbcType="INTEGER" property="area" />
|
||||
<result column="bed_num" jdbcType="INTEGER" property="bedNum" />
|
||||
<result column="bed_size" jdbcType="VARCHAR" property="bedSize" />
|
||||
<result column="window" jdbcType="INTEGER" property="window" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="DATE" property="updateTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
type_id, room_type, type_name, booking_price, booking_discount, create_time, update_time
|
||||
type_id, room_type, remark, price, discount, area, bed_num, bed_size, window, create_time,
|
||||
update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room_type
|
||||
where type_id = #{typeId,jdbcType=INTEGER}
|
||||
where type_id = #{typeId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<select id="selectByRoomType" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from room_type
|
||||
where room_type = #{roomType,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
select * FROM room_type
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from room_type
|
||||
where type_id = #{typeId,jdbcType=INTEGER}
|
||||
where type_id = #{typeId,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.RoomType">
|
||||
insert into room_type (type_id, room_type, type_name,
|
||||
booking_price, booking_discount, create_time,
|
||||
update_time)
|
||||
values (#{typeId,jdbcType=INTEGER}, #{roomType,jdbcType=INTEGER}, #{typeName,jdbcType=VARCHAR},
|
||||
#{bookingPrice,jdbcType=DOUBLE}, #{bookingDiscount,jdbcType=DOUBLE}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateTime,jdbcType=TIMESTAMP})
|
||||
insert into room_type (type_id, room_type, remark,
|
||||
price, discount, area,
|
||||
bed_num, bed_size, window,
|
||||
create_time, update_time)
|
||||
values (#{typeId,jdbcType=BIGINT}, #{roomType,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
|
||||
#{price,jdbcType=DOUBLE}, #{discount,jdbcType=DOUBLE}, #{area,jdbcType=INTEGER},
|
||||
#{bedNum,jdbcType=INTEGER}, #{bedSize,jdbcType=VARCHAR}, #{window,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.RoomType">
|
||||
insert into room_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
room_type,
|
||||
</if>
|
||||
<if test="typeName != null">
|
||||
type_name,
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="bookingPrice != null">
|
||||
booking_price,
|
||||
<if test="price != null">
|
||||
price,
|
||||
</if>
|
||||
<if test="bookingDiscount != null">
|
||||
booking_discount,
|
||||
<if test="discount != null">
|
||||
discount,
|
||||
</if>
|
||||
<if test="area != null">
|
||||
area,
|
||||
</if>
|
||||
<if test="bedNum != null">
|
||||
bed_num,
|
||||
</if>
|
||||
<if test="bedSize != null">
|
||||
bed_size,
|
||||
</if>
|
||||
<if test="window != null">
|
||||
window,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null">
|
||||
#{typeId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="roomType != null">
|
||||
#{roomType,jdbcType=INTEGER},
|
||||
#{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeName != null">
|
||||
#{typeName,jdbcType=VARCHAR},
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bookingPrice != null">
|
||||
#{bookingPrice,jdbcType=DOUBLE},
|
||||
<if test="price != null">
|
||||
#{price,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="bookingDiscount != null">
|
||||
#{bookingDiscount,jdbcType=DOUBLE},
|
||||
<if test="discount != null">
|
||||
#{discount,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="area != null">
|
||||
#{area,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="bedNum != null">
|
||||
#{bedNum,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="bedSize != null">
|
||||
#{bedSize,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="window != null">
|
||||
#{window,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
now(),
|
||||
now()
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="cn.mafangui.hotel.entity.RoomType">
|
||||
update room_type
|
||||
<set>
|
||||
<if test="roomType != null">
|
||||
room_type = #{roomType,jdbcType=INTEGER},
|
||||
room_type = #{roomType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeName != null">
|
||||
type_name = #{typeName,jdbcType=VARCHAR},
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bookingPrice != null">
|
||||
booking_price = #{bookingPrice,jdbcType=DECIMAL},
|
||||
<if test="price != null">
|
||||
price = #{price,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="bookingDiscount != null">
|
||||
booking_discount = #{bookingDiscount,jdbcType=REAL},
|
||||
<if test="discount != null">
|
||||
discount = #{discount,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="area != null">
|
||||
area = #{area,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="bedNum != null">
|
||||
bed_num = #{bedNum,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="bedSize != null">
|
||||
bed_size = #{bedSize,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="window != null">
|
||||
window = #{window,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
update_time = now(),
|
||||
</set>
|
||||
where type_id = #{typeId,jdbcType=INTEGER}
|
||||
where type_id = #{typeId,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.RoomType">
|
||||
update room_type
|
||||
set room_type = #{roomType,jdbcType=INTEGER},
|
||||
type_name = #{typeName,jdbcType=VARCHAR},
|
||||
booking_price = #{bookingPrice,jdbcType=DECIMAL},
|
||||
booking_discount = #{bookingDiscount,jdbcType=REAL},
|
||||
set room_type = #{roomType,jdbcType=VARCHAR},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
price = #{price,jdbcType=DOUBLE},
|
||||
discount = #{discount,jdbcType=DOUBLE},
|
||||
area = #{area,jdbcType=INTEGER},
|
||||
bed_num = #{bedNum,jdbcType=INTEGER},
|
||||
bed_size = #{bedSize,jdbcType=VARCHAR},
|
||||
window = #{window,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where type_id = #{typeId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<delete id="deleteByRoomType" parameterType="java.lang.Integer">
|
||||
delete from room_type
|
||||
where room_type = #{roomType,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<update id="updateByRoomTypeSelective" parameterType="cn.mafangui.hotel.entity.RoomType">
|
||||
update room_type
|
||||
<set>
|
||||
<if test="typeName != null">
|
||||
type_name = #{typeName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bookingPrice != null">
|
||||
booking_price = #{bookingPrice,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="bookingDiscount != null">
|
||||
booking_discount = #{bookingDiscount,jdbcType=DOUBLE},
|
||||
</if>
|
||||
update_time = now(),
|
||||
</set>
|
||||
where room_type = #{roomType,jdbcType=INTEGER}
|
||||
where type_id = #{typeId,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
@@ -3,48 +3,49 @@
|
||||
<mapper namespace="cn.mafangui.hotel.mapper.UserMapper">
|
||||
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.User">
|
||||
<id column="user_id" jdbcType="INTEGER" property="userId" />
|
||||
<result column="user_name" jdbcType="VARCHAR" property="userName" />
|
||||
<result column="username" jdbcType="VARCHAR" property="username" />
|
||||
<result column="password" jdbcType="VARCHAR" property="password" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="gender" jdbcType="CHAR" property="gender" />
|
||||
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
||||
<result column="email" jdbcType="VARCHAR" property="email" />
|
||||
<result column="address" jdbcType="VARCHAR" property="address" />
|
||||
<result column="id_number" jdbcType="VARCHAR" property="idNumber" />
|
||||
<result column="idcard" jdbcType="VARCHAR" property="idcard" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
user_id, user_name, password, name, phone, email, address, id_number, create_time,
|
||||
user_id, username, password, name, gender, phone, email, address, idcard, create_time,
|
||||
update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user
|
||||
from user_info
|
||||
where user_id = #{userId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from user
|
||||
delete from user_info
|
||||
where user_id = #{userId,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.User">
|
||||
insert into user (user_name, password,
|
||||
name, phone, email,
|
||||
address, id_number, create_time,
|
||||
insert into user_info (user_id, username, password,
|
||||
name, gender, phone, email,
|
||||
address, idcard, create_time,
|
||||
update_time)
|
||||
values (#{userName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
|
||||
#{name,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR},
|
||||
#{address,jdbcType=VARCHAR}, #{idNumber,jdbcType=VARCHAR}, now(),
|
||||
now())
|
||||
values (#{userId,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
|
||||
#{name,jdbcType=VARCHAR}, #{gender,jdbcType=CHAR}, #{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR},
|
||||
#{address,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.User">
|
||||
insert into user
|
||||
insert into user_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
user_name,
|
||||
<if test="username != null">
|
||||
username,
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password,
|
||||
@@ -52,6 +53,9 @@
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
gender,
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone,
|
||||
</if>
|
||||
@@ -61,18 +65,22 @@
|
||||
<if test="address != null">
|
||||
address,
|
||||
</if>
|
||||
<if test="idNumber != null">
|
||||
id_number,
|
||||
<if test="idcard != null">
|
||||
idcard,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
#{userName,jdbcType=VARCHAR},
|
||||
<if test="username != null">
|
||||
#{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
#{password,jdbcType=VARCHAR},
|
||||
@@ -80,6 +88,9 @@
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
#{gender,jdbcType=CHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
#{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -89,18 +100,22 @@
|
||||
<if test="address != null">
|
||||
#{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="idNumber != null">
|
||||
#{idNumber,jdbcType=VARCHAR},
|
||||
<if test="idcard != null">
|
||||
#{idcard,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
now(),
|
||||
now(),
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="cn.mafangui.hotel.entity.User">
|
||||
update user
|
||||
update user_info
|
||||
<set>
|
||||
<if test="userName != null">
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
<if test="username != null">
|
||||
username = #{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
@@ -108,6 +123,9 @@
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
gender = #{gender,jdbcType=CHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -117,8 +135,8 @@
|
||||
<if test="address != null">
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="idNumber != null">
|
||||
id_number = #{idNumber,jdbcType=VARCHAR},
|
||||
<if test="idcard != null">
|
||||
idcard = #{idcard,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
@@ -130,56 +148,17 @@
|
||||
where user_id = #{userId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.User">
|
||||
update user
|
||||
set user_name = #{userName,jdbcType=VARCHAR},
|
||||
update user_info
|
||||
set username = #{username,jdbcType=VARCHAR},
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
gender = #{gender,jdbcType=CHAR},
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
id_number = #{idNumber,jdbcType=VARCHAR},
|
||||
idcard = #{idcard,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where user_id = #{userId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectByUserNameAndPassword" parameterType="cn.mafangui.hotel.entity.User" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user
|
||||
where user_name = #{userName,jdbcType=VARCHAR} and password = #{password,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="selectByUserName" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user
|
||||
where user_name = #{userName,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<update id="updateByUserNameSelective" parameterType="cn.mafangui.hotel.entity.User">
|
||||
update user
|
||||
<set>
|
||||
<if test="userName != null">
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="idNumber != null">
|
||||
id_number = #{idNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
update_time = now(),
|
||||
</set>
|
||||
where user_name = #{userName,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@@ -3,54 +3,82 @@
|
||||
<mapper namespace="cn.mafangui.hotel.mapper.WorkerMapper">
|
||||
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.Worker">
|
||||
<id column="worker_id" jdbcType="INTEGER" property="workerId" />
|
||||
<result column="user_name" jdbcType="VARCHAR" property="userName" />
|
||||
<result column="role" jdbcType="VARCHAR" property="role" />
|
||||
<result column="username" jdbcType="VARCHAR" property="username" />
|
||||
<result column="password" jdbcType="VARCHAR" property="password" />
|
||||
<result column="worker_name" jdbcType="VARCHAR" property="workerName" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="gender" jdbcType="CHAR" property="gender" />
|
||||
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
||||
<result column="department" jdbcType="INTEGER" property="department" />
|
||||
<result column="email" jdbcType="VARCHAR" property="email" />
|
||||
<result column="address" jdbcType="VARCHAR" property="address" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
worker_id, user_name, password, worker_name, phone, email, address, create_time,
|
||||
update_time
|
||||
worker_id, role, username, password, name, gender, phone, department, email, address,
|
||||
create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from worker
|
||||
from worker_info
|
||||
where worker_id = #{workerId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectByUsernameAndPassword" parameterType="String" resultMap="BaseResultMap">
|
||||
select * from worker_info
|
||||
where username = #{username,jdbcType=VARCHAR} and password = #{password,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="selectByRole" parameterType="String" resultMap="BaseResultMap">
|
||||
select * from worker_info
|
||||
where role = #{role,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
select * from worker_info
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from worker
|
||||
delete from worker_info
|
||||
where worker_id = #{workerId,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="cn.mafangui.hotel.entity.Worker">
|
||||
insert into worker (worker_id, user_name, password,
|
||||
worker_name, phone, email,
|
||||
insert into worker_info (worker_id, role, username,
|
||||
password, name, gender,
|
||||
phone, department, email,
|
||||
address, create_time, update_time
|
||||
)
|
||||
values (#{workerId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
|
||||
#{workerName,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR},
|
||||
#{address,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
|
||||
values (#{workerId,jdbcType=INTEGER}, #{role,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR},
|
||||
#{password,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=CHAR},
|
||||
#{phone,jdbcType=VARCHAR}, #{department,jdbcType=INTEGER}, #{email,jdbcType=VARCHAR},
|
||||
#{address,jdbcType=VARCHAR}, now(),now()
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.Worker">
|
||||
insert into worker
|
||||
insert into worker_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null">
|
||||
user_name,
|
||||
<if test="workerId != null">
|
||||
worker_id,
|
||||
</if>
|
||||
<if test="role != null">
|
||||
role,
|
||||
</if>
|
||||
<if test="username != null">
|
||||
username,
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password,
|
||||
</if>
|
||||
<if test="workerName != null">
|
||||
worker_name,
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
gender,
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone,
|
||||
</if>
|
||||
<if test="department != null">
|
||||
department,
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email,
|
||||
</if>
|
||||
@@ -61,104 +89,85 @@
|
||||
update_time,
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null">
|
||||
#{userName,jdbcType=VARCHAR},
|
||||
<if test="workerId != null">
|
||||
#{workerId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="role != null">
|
||||
#{role,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="username != null">
|
||||
#{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
#{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="workerName != null">
|
||||
#{workerName,jdbcType=VARCHAR},
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
#{gender,jdbcType=CHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
#{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="department != null">
|
||||
#{department,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
#{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
#{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
now(),
|
||||
now(),
|
||||
now(),
|
||||
now(),
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="cn.mafangui.hotel.entity.Worker">
|
||||
update worker
|
||||
update worker_info
|
||||
<set>
|
||||
<if test="userName != null">
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
<if test="role != null">
|
||||
role = #{role,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="username != null">
|
||||
username = #{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="workerName != null">
|
||||
worker_name = #{workerName,jdbcType=VARCHAR},
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
gender = #{gender,jdbcType=CHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="department != null">
|
||||
department = #{department,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address = #{address,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 worker_id = #{workerId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.Worker">
|
||||
update worker
|
||||
set user_name = #{userName,jdbcType=VARCHAR},
|
||||
update worker_info
|
||||
set role = #{role,jdbcType=VARCHAR},
|
||||
username = #{username,jdbcType=VARCHAR},
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
worker_name = #{workerName,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
gender = #{gender,jdbcType=CHAR},
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
department = #{department,jdbcType=INTEGER},
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where worker_id = #{workerId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<delete id="deleteByUserName" parameterType="String">
|
||||
delete from worker
|
||||
where user_name = #{userName,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<update id="updateByUserNameSelective">
|
||||
update worker
|
||||
set
|
||||
<if test="password != null">
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="workerName != null">
|
||||
worker_name = #{workerName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
update_time = now()
|
||||
where user_name = #{userName,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<select id="selectByUserName" parameterType="String" resultMap="BaseResultMap">
|
||||
select * from worker
|
||||
where user_name = #{userName,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
select * from worker
|
||||
</select>
|
||||
<select id="selectByUserNameAndPassword" resultMap="BaseResultMap">
|
||||
select * from worker
|
||||
where user_name = #{userName,jdbcType=VARCHAR} and password = #{password,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user