You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
2.5 KiB

<?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="cc.hiver.mall.dao.mapper.ProductGroupBuyPriceMapper">
<resultMap id="BaseResultMap" type="cc.hiver.mall.entity.ProductGroupBuyPrice">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="group_count" jdbcType="INTEGER" property="groupCount"/>
<result column="product_id" jdbcType="VARCHAR" property="productId"/>
<result column="group_price" jdbcType="DECIMAL" property="groupPrice"/>
</resultMap>
<sql id="Base_Column_List">
id, create_by, create_time, del_flag, update_by, update_time, group_count, product_id, group_price
</sql>
<insert id="insert" parameterType="cc.hiver.mall.entity.ProductGroupBuyPrice">
insert into t_product_group_buy_price (id, create_by, create_time,
del_flag, update_by, update_time,
group_count, product_id, group_price)
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{groupCount,jdbcType=INTEGER}, #{productId,jdbcType=VARCHAR}, #{groupPrice,jdbcType=DECIMAL})
</insert>
<select id="selectByProductId" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_product_group_buy_price
where product_id = #{productId,jdbcType=VARCHAR}
</select>
<delete id="deleteByProductId" parameterType="java.lang.String">
delete
from t_product_group_buy_price
where product_id = #{productId,jdbcType=VARCHAR}
</delete>
<select id="getByProductIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_product_group_buy_price
where product_id in
<foreach close=")" collection="productIds" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</select>
</mapper>