<?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.lzl.dao.ShopDao">
<select id="select" resultType="Shop">
select * from shop
</select>
<!-- 删除 -->
<delete id="del">
delete from shop where sid in (${sids})
</delete>
<!-- 添加 -->
<select id="toAdd" resultType="Shop">
select * from shop
</select>
<!-- 添加 -->
<insert id="add">
INSERT INTO `zhoukao3`.`shop` (`sid`, `sname`, `sfenlei`, `sjifen`, `sduihuan`, `syiduihuan`) VALUES (null, #{sname}, #{sfenlei}, #{sjifen}, #{sduihuan}, #{syiduihuan});
</insert>
<select id="selectOne" resultType="Shop">
select * from shop where sid = #{sid}
</select>
<update id="update">
UPDATE `shop` SET `sname`=#{sname}, `sfenlei`=#{sfenlei}, `sjifen`=#{sjifen}, `sduihuan`=#{sduihuan}, `syiduihuan`=#{syiduihuan} WHERE (`sid`=#{sid});
</update>
</mapper>