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.
370 lines
14 KiB
370 lines
14 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.StockLogMapper">
|
|
<resultMap id="BaseResultMap" type="cc.hiver.mall.entity.StockLog">
|
|
<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="product_id" jdbcType="VARCHAR" property="productId" />
|
|
<result column="product_specs" jdbcType="VARCHAR" property="productSpecs" />
|
|
<result column="stock" jdbcType="INTEGER" property="stock" />
|
|
<result column="change_stock" jdbcType="INTEGER" property="changeStock" />
|
|
<result column="change_type" jdbcType="VARCHAR" property="changeType" />
|
|
<result column="price" jdbcType="DECIMAL" property="price" />
|
|
<result column="purchase_price" jdbcType="DECIMAL" property="purchasePrice" />
|
|
<result column="wholesale_price" jdbcType="DECIMAL" property="wholesalePrice" />
|
|
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
|
|
</resultMap>
|
|
<sql id="Example_Where_Clause">
|
|
<where>
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
|
<if test="criteria.valid">
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
<foreach collection="criteria.criteria" item="criterion">
|
|
<choose>
|
|
<when test="criterion.noValue">
|
|
and ${criterion.condition}
|
|
</when>
|
|
<when test="criterion.singleValue">
|
|
and ${criterion.condition} #{criterion.value}
|
|
</when>
|
|
<when test="criterion.betweenValue">
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
</when>
|
|
<when test="criterion.listValue">
|
|
and ${criterion.condition}
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
#{listItem}
|
|
</foreach>
|
|
</when>
|
|
</choose>
|
|
</foreach>
|
|
</trim>
|
|
</if>
|
|
</foreach>
|
|
</where>
|
|
</sql>
|
|
<sql id="Update_By_Example_Where_Clause">
|
|
<where>
|
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
<if test="criteria.valid">
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
<foreach collection="criteria.criteria" item="criterion">
|
|
<choose>
|
|
<when test="criterion.noValue">
|
|
and ${criterion.condition}
|
|
</when>
|
|
<when test="criterion.singleValue">
|
|
and ${criterion.condition} #{criterion.value}
|
|
</when>
|
|
<when test="criterion.betweenValue">
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
</when>
|
|
<when test="criterion.listValue">
|
|
and ${criterion.condition}
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
#{listItem}
|
|
</foreach>
|
|
</when>
|
|
</choose>
|
|
</foreach>
|
|
</trim>
|
|
</if>
|
|
</foreach>
|
|
</where>
|
|
</sql>
|
|
<sql id="Base_Column_List">
|
|
id, create_by, create_time, del_flag, update_by, update_time, product_id, product_specs,
|
|
stock, change_stock, change_type, price, purchase_price, wholesale_price, shop_id
|
|
</sql>
|
|
<select id="selectByExample" parameterType="cc.hiver.mall.entity.StockLogExample" resultMap="BaseResultMap">
|
|
select
|
|
<if test="distinct">
|
|
distinct
|
|
</if>
|
|
<include refid="Base_Column_List" />
|
|
from t_stock_log
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
<if test="orderByClause != null">
|
|
order by ${orderByClause}
|
|
</if>
|
|
</select>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from t_stock_log
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
delete from t_stock_log
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
</delete>
|
|
<delete id="deleteByExample" parameterType="cc.hiver.mall.entity.StockLogExample">
|
|
delete from t_stock_log
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</delete>
|
|
<insert id="insert" parameterType="cc.hiver.mall.entity.StockLog">
|
|
insert into t_stock_log (id, create_by, create_time,
|
|
del_flag, update_by, update_time,
|
|
product_id, product_specs, stock,
|
|
change_stock, change_type, price,
|
|
purchase_price, wholesale_price, shop_id
|
|
)
|
|
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
|
#{productId,jdbcType=VARCHAR}, #{productSpecs,jdbcType=VARCHAR}, #{stock,jdbcType=INTEGER},
|
|
#{changeStock,jdbcType=INTEGER}, #{changeType,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL},
|
|
#{purchasePrice,jdbcType=DECIMAL}, #{wholesalePrice,jdbcType=DECIMAL}, #{shopId,jdbcType=VARCHAR}
|
|
)
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.StockLog">
|
|
insert into t_stock_log
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="createBy != null">
|
|
create_by,
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time,
|
|
</if>
|
|
<if test="delFlag != null">
|
|
del_flag,
|
|
</if>
|
|
<if test="updateBy != null">
|
|
update_by,
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time,
|
|
</if>
|
|
<if test="productId != null">
|
|
product_id,
|
|
</if>
|
|
<if test="productSpecs != null">
|
|
product_specs,
|
|
</if>
|
|
<if test="stock != null">
|
|
stock,
|
|
</if>
|
|
<if test="changeStock != null">
|
|
change_stock,
|
|
</if>
|
|
<if test="changeType != null">
|
|
change_type,
|
|
</if>
|
|
<if test="price != null">
|
|
price,
|
|
</if>
|
|
<if test="purchasePrice != null">
|
|
purchase_price,
|
|
</if>
|
|
<if test="wholesalePrice != null">
|
|
wholesale_price,
|
|
</if>
|
|
<if test="shopId != null">
|
|
shop_id,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
#{id,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createBy != null">
|
|
#{createBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createTime != null">
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="delFlag != null">
|
|
#{delFlag,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="updateBy != null">
|
|
#{updateBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="productId != null">
|
|
#{productId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="productSpecs != null">
|
|
#{productSpecs,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="stock != null">
|
|
#{stock,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="changeStock != null">
|
|
#{changeStock,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="changeType != null">
|
|
#{changeType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="price != null">
|
|
#{price,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="purchasePrice != null">
|
|
#{purchasePrice,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="wholesalePrice != null">
|
|
#{wholesalePrice,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="shopId != null">
|
|
#{shopId,jdbcType=VARCHAR},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<select id="countByExample" parameterType="cc.hiver.mall.entity.StockLogExample" resultType="java.lang.Long">
|
|
select count(*) from t_stock_log
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</select>
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
update t_stock_log
|
|
<set>
|
|
<if test="record.id != null">
|
|
id = #{record.id,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.createBy != null">
|
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.createTime != null">
|
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="record.delFlag != null">
|
|
del_flag = #{record.delFlag,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="record.updateBy != null">
|
|
update_by = #{record.updateBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.updateTime != null">
|
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="record.productId != null">
|
|
product_id = #{record.productId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.productSpecs != null">
|
|
product_specs = #{record.productSpecs,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.stock != null">
|
|
stock = #{record.stock,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="record.changeStock != null">
|
|
change_stock = #{record.changeStock,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="record.changeType != null">
|
|
change_type = #{record.changeType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.price != null">
|
|
price = #{record.price,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="record.purchasePrice != null">
|
|
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="record.wholesalePrice != null">
|
|
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="record.shopId != null">
|
|
shop_id = #{record.shopId,jdbcType=VARCHAR},
|
|
</if>
|
|
</set>
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByExample" parameterType="map">
|
|
update t_stock_log
|
|
set id = #{record.id,jdbcType=VARCHAR},
|
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
|
del_flag = #{record.delFlag,jdbcType=INTEGER},
|
|
update_by = #{record.updateBy,jdbcType=VARCHAR},
|
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
|
product_id = #{record.productId,jdbcType=VARCHAR},
|
|
product_specs = #{record.productSpecs,jdbcType=VARCHAR},
|
|
stock = #{record.stock,jdbcType=INTEGER},
|
|
change_stock = #{record.changeStock,jdbcType=INTEGER},
|
|
change_type = #{record.changeType,jdbcType=VARCHAR},
|
|
price = #{record.price,jdbcType=DECIMAL},
|
|
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL},
|
|
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL},
|
|
shop_id = #{record.shopId,jdbcType=VARCHAR}
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByPrimaryKeySelective" parameterType="cc.hiver.mall.entity.StockLog">
|
|
update t_stock_log
|
|
<set>
|
|
<if test="createBy != null">
|
|
create_by = #{createBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="delFlag != null">
|
|
del_flag = #{delFlag,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="updateBy != null">
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="productId != null">
|
|
product_id = #{productId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="productSpecs != null">
|
|
product_specs = #{productSpecs,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="stock != null">
|
|
stock = #{stock,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="changeStock != null">
|
|
change_stock = #{changeStock,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="changeType != null">
|
|
change_type = #{changeType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="price != null">
|
|
price = #{price,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="purchasePrice != null">
|
|
purchase_price = #{purchasePrice,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="wholesalePrice != null">
|
|
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="shopId != null">
|
|
shop_id = #{shopId,jdbcType=VARCHAR},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="cc.hiver.mall.entity.StockLog">
|
|
update t_stock_log
|
|
set create_by = #{createBy,jdbcType=VARCHAR},
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
del_flag = #{delFlag,jdbcType=INTEGER},
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
product_id = #{productId,jdbcType=VARCHAR},
|
|
product_specs = #{productSpecs,jdbcType=VARCHAR},
|
|
stock = #{stock,jdbcType=INTEGER},
|
|
change_stock = #{changeStock,jdbcType=INTEGER},
|
|
change_type = #{changeType,jdbcType=VARCHAR},
|
|
price = #{price,jdbcType=DECIMAL},
|
|
purchase_price = #{purchasePrice,jdbcType=DECIMAL},
|
|
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL},
|
|
shop_id = #{shopId,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
</update>
|
|
</mapper>
|