完成酒店信息接口编写

This commit is contained in:
freeebird
2018-11-15 21:10:47 +08:00
parent c8124bbc70
commit f7ea1c33eb
7 changed files with 197 additions and 22 deletions

View File

@@ -21,6 +21,17 @@
from hotel_info
where hotel_id = #{hotelId,jdbcType=INTEGER}
</select>
<select id="selectByName" parameterType="String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hotel_info
where hotel_name = #{hotelName,jdbcType=VARCHAR}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hotel_info
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from hotel_info
where hotel_id = #{hotelId,jdbcType=INTEGER}
@@ -59,12 +70,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 +95,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">
@@ -117,12 +120,7 @@
<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>
update_time = now(),
</set>
where hotel_id = #{hotelId,jdbcType=INTEGER}
</update>