1.数据库重构

2.修改User注册登录接口
This commit is contained in:
freeebird
2018-11-12 10:44:54 +08:00
parent 643ef18f0a
commit 3ef7a1b88d
30 changed files with 1765 additions and 311 deletions

View File

@@ -7,8 +7,8 @@ spring:
driver-class-name: com.mysql.jdbc.Driver
username: root
password: root
url: jdbc:mysql://localhost:3306/hotel?useUnicode=true&characterEncoding=UTF-8
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*:mybatis/mapper/*.xml
mapper-locations: classpath*:mapper/*.xml

View File

@@ -22,7 +22,7 @@
<!-- JDBC连接 -->
<jdbcConnection
driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/hotel?useUnicode=true&amp;characterEncoding=UTF-8"
connectionURL="jdbc:mysql://127.0.0.1:3306/hotel?useUnicode=true&amp;characterEncoding=UTF-8"
userId="root"
password="root">
</jdbcConnection>
@@ -44,7 +44,7 @@
</javaModelGenerator>
<!-- 生成mapper xml文件 -->
<sqlMapGenerator targetPackage="mybatis/mapper" targetProject="src/main/resources">
<sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
@@ -60,9 +60,9 @@
是否生成 example类 -->
<table schema="hotel" tableName="user_info"
domainObjectName="User" enableCountByExample="true"
enableDeleteByExample="true" enableSelectByExample="true"
enableUpdateByExample="true">
domainObjectName="User" enableCountByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
enableUpdateByExample="false">
</table>
<table schema="hotel" tableName="worker_info"
domainObjectName="Worker" enableCountByExample="false"

View File

@@ -0,0 +1,153 @@
<?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>

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.mafangui.hotel.mapper.DepartmentMapper">
<resultMap id="BaseResultMap" type="cn.mafangui.hotel.entity.Department">
<id column="department_id" jdbcType="INTEGER" property="departmentId" />
<result column="department_name" jdbcType="VARCHAR" property="departmentName" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
department_id, department_name, remark, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from department_info
where department_id = #{departmentId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from department_info
where department_id = #{departmentId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="cn.mafangui.hotel.entity.Department">
insert into department_info (department_id, department_name, remark,
create_time, update_time)
values (#{departmentId,jdbcType=INTEGER}, #{departmentName,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.Department">
insert into department_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="departmentId != null">
department_id,
</if>
<if test="departmentName != null">
department_name,
</if>
<if test="remark != null">
remark,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="departmentId != null">
#{departmentId,jdbcType=INTEGER},
</if>
<if test="departmentName != null">
#{departmentName,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="cn.mafangui.hotel.entity.Department">
update department_info
<set>
<if test="departmentName != null">
department_name = #{departmentName,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where department_id = #{departmentId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="cn.mafangui.hotel.entity.Department">
update department_info
set department_name = #{departmentName,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where department_id = #{departmentId,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -0,0 +1,141 @@
<?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>

View File

@@ -0,0 +1,164 @@
<?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>

View File

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

View File

@@ -0,0 +1,153 @@
<?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>

View File

@@ -0,0 +1,164 @@
<?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>

View File

@@ -0,0 +1,160 @@
<?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>

View File

@@ -0,0 +1,177 @@
<?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>