Finish/models/system/target/classes/mapper/HotelMapper.xml

67 lines
2.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bwie.system.mapper.HotelMapper">
<resultMap id="ResponseHotel" type="com.bwie.common.domain.response.ResponseHotel">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="price" column="price"/>
<result property="pic" column="pic"/>
<result property="number" column="number"/>
<result property="status" column="status"/>
</resultMap>
<sql id="selectHotel">
select id,
name,
price,
pic,
number,
status
from t_hotel
</sql>
<insert id="insertOrder">
insert into t_order(
<if test="null!=orderCard and ''!=orderCard">order_card,</if>
<if test="null!=name and ''!=name">name,</if>
<if test="null!=price and ''!=price">price,</if>
<if test="null!=userId and ''!=userId">user_id</if>
)
values (
<if test="null!=orderCard and ''!=orderCard">#{orderCard},</if>
<if test="null!=name and ''!=name">#{name},</if>
<if test="null!=price and ''!=price">#{price},</if>
<if test="null!=userId and ''!=userId">#{userId}</if>
)
</insert>
<insert id="insertStay">
insert into t_saty(
<if test="null!=username and ''!=username">username,</if>
<if test="null!=phone and ''!=phone">phone,</if>
<if test="null!=card and ''!=card">card,</if>
<if test="null!=name and ''!=name">name,</if>
<if test="null!=price and ''!=price">price,</if>
<if test="null!=dayNumber and ''!=dayNumber">day_number,</if>
<if test="null!=totalPrice and ''!=totalPrice">total_price</if>
)
values (
<if test="null!=username and ''!=username">#{username},</if>
<if test="null!=phone and ''!=phone">#{phone},</if>
<if test="null!=card and ''!=card">#{card},</if>
<if test="null!=name and ''!=name">#{name},</if>
<if test="null!=price and ''!=price">#{price},</if>
<if test="null!=dayNumber and ''!=dayNumber">#{day_number},</if>
<if test="null!=totalPrice and ''!=totalPrice">#{totalPrice}</if>
)
</insert>
<select id="ShowHotelAll" resultMap="ResponseHotel">
<include refid="selectHotel"></include>
</select>
</mapper>