<?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.ruoyi.order.mapper.goods.GoodsTotalMapper">
|
|
<resultMap type="GoodsTotal" id="GoodsTotalResult">
|
<result property="goodsId" column="goods_id" />
|
<result property="buyCount" column="buy_count" />
|
<result property="buyNumCount" column="buy_num_count" />
|
<result property="buyUserCount" column="buy_user_count" />
|
</resultMap>
|
|
<sql id="selectGoodsTotalVo">
|
select goods_id, buy_count, buy_num_count, buy_user_count from t_goods_total
|
</sql>
|
|
<select id="selectGoodsTotalList" parameterType="GoodsTotal" resultMap="GoodsTotalResult">
|
<include refid="selectGoodsTotalVo"/>
|
<where>
|
<if test="buyCount != null "> and buy_count = #{buyCount}</if>
|
<if test="buyNumCount != null "> and buy_num_count = #{buyNumCount}</if>
|
<if test="buyUserCount != null "> and buy_user_count = #{buyUserCount}</if>
|
</where>
|
</select>
|
|
<select id="selectGoodsTotalByGoodsId" parameterType="String" resultMap="GoodsTotalResult">
|
<include refid="selectGoodsTotalVo"/>
|
where goods_id = #{goodsId}
|
</select>
|
|
<insert id="insertGoodsTotal" parameterType="GoodsTotal">
|
insert into t_goods_total
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="goodsId != null">goods_id,</if>
|
<if test="buyCount != null">buy_count,</if>
|
<if test="buyNumCount != null">buy_num_count,</if>
|
<if test="buyUserCount != null">buy_user_count,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="goodsId != null">#{goodsId},</if>
|
<if test="buyCount != null">#{buyCount},</if>
|
<if test="buyNumCount != null">#{buyNumCount},</if>
|
<if test="buyUserCount != null">#{buyUserCount},</if>
|
</trim>
|
</insert>
|
|
<update id="updateGoodsTotal" parameterType="GoodsTotal">
|
update t_goods_total
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="buyCount != null">buy_count = #{buyCount},</if>
|
<if test="buyNumCount != null">buy_num_count = #{buyNumCount},</if>
|
<if test="buyUserCount != null">buy_user_count = #{buyUserCount},</if>
|
</trim>
|
where goods_id = #{goodsId}
|
</update>
|
|
<delete id="deleteGoodsTotalByGoodsId" parameterType="String">
|
delete from t_goods_total where goods_id = #{goodsId}
|
</delete>
|
|
<delete id="deleteGoodsTotalByGoodsIds" parameterType="String">
|
delete from t_goods_total where goods_id in
|
<foreach item="goodsId" collection="array" open="(" separator="," close=")">
|
#{goodsId}
|
</foreach>
|
</delete>
|
|
</mapper>
|