添加酒店信息的基本操作

This commit is contained in:
freeebird
2018-10-24 18:48:21 +08:00
parent 79971cc62c
commit c7cac3cbe1
9 changed files with 213 additions and 155 deletions

View File

@@ -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}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
#{website,jdbcType=VARCHAR}, now(),now()
)
</insert>
<insert id="insertSelective" parameterType="cn.mafangui.hotel.entity.Hotel">
@@ -59,12 +59,8 @@
<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">
@@ -88,12 +84,8 @@
<if test="website != null">
#{website,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.Hotel">
@@ -138,4 +130,15 @@
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>