|
|
|
@ -19,6 +19,9 @@ |
|
|
|
<result column="purchase_price" jdbcType="DECIMAL" property="purchasePrice" /> |
|
|
|
<result column="wholesale_price" jdbcType="DECIMAL" property="wholesalePrice" /> |
|
|
|
<result column="product_count" jdbcType="INTEGER" property="productCount" /> |
|
|
|
<result column="discount" jdbcType="DECIMAL" property="discount" /> |
|
|
|
<result column="discount_amount" jdbcType="DECIMAL" property="discountAmount" /> |
|
|
|
<result column="real_price" jdbcType="DECIMAL" property="realPrice" /> |
|
|
|
</resultMap> |
|
|
|
<sql id="Example_Where_Clause"> |
|
|
|
<where> |
|
|
|
@ -81,7 +84,7 @@ |
|
|
|
<sql id="Base_Column_List"> |
|
|
|
id, create_by, create_time, del_flag, update_by, update_time, sale_id, product_id, |
|
|
|
product_name, unit, shop_id, category_id, attribute_list, price, purchase_price, |
|
|
|
wholesale_price, product_count |
|
|
|
wholesale_price, product_count, discount, discount_amount, real_price |
|
|
|
</sql> |
|
|
|
<select id="selectByExample" parameterType="cc.hiver.mall.entity.SaleDetailExample" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
@ -119,13 +122,15 @@ |
|
|
|
sale_id, product_id, product_name, |
|
|
|
unit, shop_id, category_id, |
|
|
|
attribute_list, price, purchase_price, |
|
|
|
wholesale_price, product_count) |
|
|
|
wholesale_price, product_count, discount, |
|
|
|
discount_amount, real_price) |
|
|
|
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
|
|
|
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, |
|
|
|
#{saleId,jdbcType=VARCHAR}, #{productId,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR}, |
|
|
|
#{unit,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR}, |
|
|
|
#{attributeList,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, #{purchasePrice,jdbcType=DECIMAL}, |
|
|
|
#{wholesalePrice,jdbcType=DECIMAL}, #{productCount,jdbcType=INTEGER}) |
|
|
|
#{wholesalePrice,jdbcType=DECIMAL}, #{productCount,jdbcType=INTEGER}, #{discount,jdbcType=DECIMAL}, |
|
|
|
#{discountAmount,jdbcType=DECIMAL}, #{realPrice,jdbcType=DECIMAL}) |
|
|
|
</insert> |
|
|
|
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.SaleDetail"> |
|
|
|
insert into t_sale_detail |
|
|
|
@ -181,6 +186,15 @@ |
|
|
|
<if test="productCount != null"> |
|
|
|
product_count, |
|
|
|
</if> |
|
|
|
<if test="discount != null"> |
|
|
|
discount, |
|
|
|
</if> |
|
|
|
<if test="discountAmount != null"> |
|
|
|
discount_amount, |
|
|
|
</if> |
|
|
|
<if test="realPrice != null"> |
|
|
|
real_price, |
|
|
|
</if> |
|
|
|
</trim> |
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
|
<if test="id != null"> |
|
|
|
@ -234,6 +248,15 @@ |
|
|
|
<if test="productCount != null"> |
|
|
|
#{productCount,jdbcType=INTEGER}, |
|
|
|
</if> |
|
|
|
<if test="discount != null"> |
|
|
|
#{discount,jdbcType=DECIMAL}, |
|
|
|
</if> |
|
|
|
<if test="discountAmount != null"> |
|
|
|
#{discountAmount,jdbcType=DECIMAL}, |
|
|
|
</if> |
|
|
|
<if test="realPrice != null"> |
|
|
|
#{realPrice,jdbcType=DECIMAL}, |
|
|
|
</if> |
|
|
|
</trim> |
|
|
|
</insert> |
|
|
|
<select id="countByExample" parameterType="cc.hiver.mall.entity.SaleDetailExample" resultType="java.lang.Long"> |
|
|
|
@ -296,6 +319,15 @@ |
|
|
|
<if test="record.productCount != null"> |
|
|
|
product_count = #{record.productCount,jdbcType=INTEGER}, |
|
|
|
</if> |
|
|
|
<if test="record.discount != null"> |
|
|
|
discount = #{record.discount,jdbcType=DECIMAL}, |
|
|
|
</if> |
|
|
|
<if test="record.discountAmount != null"> |
|
|
|
discount_amount = #{record.discountAmount,jdbcType=DECIMAL}, |
|
|
|
</if> |
|
|
|
<if test="record.realPrice != null"> |
|
|
|
real_price = #{record.realPrice,jdbcType=DECIMAL}, |
|
|
|
</if> |
|
|
|
</set> |
|
|
|
<if test="_parameter != null"> |
|
|
|
<include refid="Update_By_Example_Where_Clause" /> |
|
|
|
@ -319,7 +351,10 @@ |
|
|
|
price = #{record.price,jdbcType=DECIMAL}, |
|
|
|
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL}, |
|
|
|
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL}, |
|
|
|
product_count = #{record.productCount,jdbcType=INTEGER} |
|
|
|
product_count = #{record.productCount,jdbcType=INTEGER}, |
|
|
|
discount = #{record.discount,jdbcType=DECIMAL}, |
|
|
|
discount_amount = #{record.discountAmount,jdbcType=DECIMAL}, |
|
|
|
real_price = #{record.realPrice,jdbcType=DECIMAL} |
|
|
|
<if test="_parameter != null"> |
|
|
|
<include refid="Update_By_Example_Where_Clause" /> |
|
|
|
</if> |
|
|
|
@ -375,6 +410,15 @@ |
|
|
|
<if test="productCount != null"> |
|
|
|
product_count = #{productCount,jdbcType=INTEGER}, |
|
|
|
</if> |
|
|
|
<if test="discount != null"> |
|
|
|
discount = #{discount,jdbcType=DECIMAL}, |
|
|
|
</if> |
|
|
|
<if test="discountAmount != null"> |
|
|
|
discount_amount = #{discountAmount,jdbcType=DECIMAL}, |
|
|
|
</if> |
|
|
|
<if test="realPrice != null"> |
|
|
|
real_price = #{realPrice,jdbcType=DECIMAL}, |
|
|
|
</if> |
|
|
|
</set> |
|
|
|
where id = #{id,jdbcType=VARCHAR} |
|
|
|
</update> |
|
|
|
@ -395,7 +439,10 @@ |
|
|
|
price = #{price,jdbcType=DECIMAL}, |
|
|
|
purchase_price = #{purchasePrice,jdbcType=DECIMAL}, |
|
|
|
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL}, |
|
|
|
product_count = #{productCount,jdbcType=INTEGER} |
|
|
|
product_count = #{productCount,jdbcType=INTEGER}, |
|
|
|
discount = #{discount,jdbcType=DECIMAL}, |
|
|
|
discount_amount = #{discountAmount,jdbcType=DECIMAL}, |
|
|
|
real_price = #{realPrice,jdbcType=DECIMAL} |
|
|
|
where id = #{id,jdbcType=VARCHAR} |
|
|
|
</update> |
|
|
|
</mapper> |