feat: Add image field to CouponTemplate domain, database, and mapper.

This commit is contained in:
guo
2026-03-11 10:59:30 +08:00
parent 4cff5fef69
commit d6bf06acf3
3 changed files with 10 additions and 3 deletions

View File

@@ -88,6 +88,9 @@ public class CouponTemplate {
/** 券使用说明 */
private String description;
/** 优惠券图片URL */
private String image;
/** 最后修改人账号 */
private String updateBy;

View File

@@ -26,6 +26,7 @@
<result column="total_limit" property="totalLimit"/>
<result column="status" property="status"/>
<result column="description" property="description"/>
<result column="image" property="image"/>
<result column="update_by" property="updateBy"/>
<result column="create_by" property="createBy"/>
<result column="create_time" property="createTime"/>
@@ -40,7 +41,7 @@
stock_total, stock_remain, validity_type,
valid_start_time, valid_end_time, valid_days,
daily_limit, monthly_limit, total_limit,
status, description, update_by, create_by, create_time, update_time, del_flag
status, description, image, update_by, create_by, create_time, update_time, del_flag
</sql>
<select id="selectById" resultMap="BaseResultMap">
@@ -76,7 +77,7 @@
stock_total, stock_remain, validity_type,
valid_start_time, valid_end_time, valid_days,
daily_limit, monthly_limit, total_limit,
status, description, update_by, create_by, create_time, update_time, del_flag
status, description, image, update_by, create_by, create_time, update_time, del_flag
) VALUES (
#{name}, #{type}, #{creatorType}, #{creatorMerchantId}, #{scopeType},
#{pointsCost}, #{discountRate}, #{minChargeAmount}, #{maxDiscountAmount},
@@ -84,7 +85,7 @@
#{stockTotal}, #{stockRemain}, #{validityType},
#{validStartTime}, #{validEndTime}, #{validDays},
#{dailyLimit}, #{monthlyLimit}, #{totalLimit},
#{status}, #{description}, #{updateBy}, #{createBy}, NOW(), NOW(), '0'
#{status}, #{description}, #{image}, #{updateBy}, #{createBy}, NOW(), NOW(), '0'
)
</insert>
@@ -98,6 +99,7 @@
<if test="monthlyLimit != null">monthly_limit = #{monthlyLimit},</if>
<if test="totalLimit != null">total_limit = #{totalLimit},</if>
<if test="description != null">description = #{description},</if>
<if test="image != null">image = #{image},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
update_time = NOW()
</set>

2
sql/add_coupon_image.sql Normal file
View File

@@ -0,0 +1,2 @@
-- 优惠券模板表新增图片字段
ALTER TABLE coupon_template ADD COLUMN image VARCHAR(500) DEFAULT NULL COMMENT '优惠券图片URL' AFTER description;