1、update
返回 com.zc.beauty.model.Fancy 对象
<pre name="code" class="html"><update id="alterPassword">
update user_login set password=#{2} where username=#{0} and password=#{1}
</update>
成功返回: update 执行成功的数目
失败返回:0
2、select
<select id="hasUser" resultType="int">
select count(1) from user_login where username=#{0}
</select>
返回: resultType 类型 ,可以是int,long,自定义的对象等,上面返回的是int
<select id="showFancyById" resultType="com.zc.beauty.model.Fancy">
select id, s_type, s_name, s_desc, s_brand, s_price, s_image, s_from, s_edittime
from fancy where id=#{0}
</select>
返回 com.zc.beauty.model.Fancy 对象
3、insert