95 lines
2.3 KiB
XML
Raw Permalink Normal View History

2026-03-10 14:30:24 +08:00
<?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="UnivGoodsCate">
<insert id="insertUnivGoodsCate" parameterType="UnivGoodsCate">
INSERT INTO univgoodscate(
cateid, catename, description, status)
VALUES (#{cateId}, #{cateName}, #{description}, #{status});
</insert>
<update id="updateUnivGoodsCate" parameterType="UnivGoodsCate">
UPDATE univgoodscate
SET cateid=#{cateId}, catename=#{cateName}, description=#{description}, status=#{status}
WHERE cateid=#{cateId};
</update>
<select id="getUnivGoodsCateByKey" parameterType="java.lang.Integer" resultType="UnivGoodsCate">
SELECT cateid, catename, description, status
FROM univgoodscate where cateid=#{cateId} ;
</select>
<select id="getSeqUnivGoodsCate" resultType="Integer" useCache="false" flushCache="true">
SELECT nextval('seq_univgoodscateId') ;
</select>
<select id="getUnivGoodsCatesBySchoolId" parameterType="java.lang.Long" resultType="UnivGoodsCate">
SELECT distinct cateid, catename, description, status
FROM v_univcategoodspack where schoolId=#{schoolId} and language!='zh'
order by cateid
</select>
<select id="getUnivGoodsCates" parameterType="java.util.Map" resultType="UnivGoodsCate">
SELECT cateid, catename, description, status
FROM univgoodscate where status = 1
order by cateid
<if test="pageSize!=null">
LIMIT #{pageSize}
</if>
<if test="offset!=null">
OFFSET #{offset}
</if>
</select>
<select id="getUnivGoodsCatesCount" resultType="Integer">
SELECT count(*)
FROM univgoodscate where status = 1
</select>
<select id="getGoodsByCateId" parameterType="Integer" resultType="java.util.HashMap">
select g.goodsid , g.goodsname , case when u.cateid is null then 0 else u.cateid end as cateid ,
case when u.ishot is null then 0 else u.ishot end as ishot
from Goods g left join UnivCateOwnGoods u on u.goodsid = g.goodsid and u.cateid = #{cateId}
where g.goodsid &gt; 0
order by g.goodsid
</select>
</mapper>