75 lines
1.7 KiB
XML
75 lines
1.7 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="UnivCateOwnGoods">
|
|
|
|
<insert id="insertUnivCateOwnGoods" parameterType="UnivCateOwnGoods">
|
|
INSERT INTO univcateowngoods(
|
|
cateid, goodsid, ishot)
|
|
VALUES (#{cateId}, #{goodsId}, #{isHot});
|
|
|
|
</insert>
|
|
|
|
<insert id="insertUnivCateOwnGoodss" parameterType="java.util.List">
|
|
INSERT INTO univcateowngoods(
|
|
cateid, goodsid, ishot)
|
|
VALUES
|
|
<foreach collection="list" index="index" item="item" separator=",">
|
|
|
|
(#{item.cateId}, #{item.goodsId}, #{item.isHot})
|
|
|
|
</foreach>
|
|
|
|
</insert>
|
|
|
|
|
|
<delete id="deleteByCateId" parameterType="java.lang.Integer">
|
|
|
|
|
|
delete from univcateowngoods
|
|
WHERE cateid=#{cateId} ;
|
|
|
|
|
|
</delete>
|
|
|
|
|
|
<update id="updateUnivCateOwnGoods" parameterType="UnivCateOwnGoods">
|
|
|
|
|
|
UPDATE univcateowngoods
|
|
SET cateid=#{cateId}, goodsid=#{goodsId}, ishot=#{isHot}
|
|
WHERE cateid=#{cateId} and goodsid=#{goodsId};
|
|
|
|
|
|
</update>
|
|
|
|
<select id="getUnivCateOwnGoodsByKey" parameterType="java.util.HashMap" resultType="UnivCateOwnGoods">
|
|
|
|
|
|
|
|
SELECT cateid, goodsid, ishot
|
|
FROM univcateowngoods where cateid=#{cateId} and goodsid=#{goodsId}
|
|
|
|
|
|
</select>
|
|
|
|
|
|
<select id="getSeqUnivCateOwnGoods" resultType="Integer" useCache="false" flushCache="true">
|
|
|
|
SELECT nextval('seq_univcateowngoodsId') ;
|
|
|
|
</select>
|
|
|
|
<select id="getUnivCateOwnGoodsByCateId" parameterType="java.lang.Integer" resultType="UnivCateOwnGoods">
|
|
|
|
|
|
SELECT cateid, goodsid, ishot
|
|
FROM univcateowngoods
|
|
WHERE cateid=#{cateId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper> |