feat: 优化文案模板分组与复制预览
This commit is contained in:
@@ -21,6 +21,10 @@ public class TtCopyTemplate extends BaseEntity {
|
||||
@Excel(name = "按钮名称")
|
||||
private String templateName;
|
||||
|
||||
/** 模板分组 */
|
||||
@Excel(name = "模板分组")
|
||||
private String templateGroup;
|
||||
|
||||
/** 文案模板内容,支持 {变量} 占位符 */
|
||||
@Excel(name = "模板内容")
|
||||
private String templateBody;
|
||||
@@ -49,6 +53,14 @@ public class TtCopyTemplate extends BaseEntity {
|
||||
return templateName;
|
||||
}
|
||||
|
||||
public void setTemplateGroup(String templateGroup) {
|
||||
this.templateGroup = templateGroup;
|
||||
}
|
||||
|
||||
public String getTemplateGroup() {
|
||||
return templateGroup;
|
||||
}
|
||||
|
||||
public void setTemplateBody(String templateBody) {
|
||||
this.templateBody = templateBody;
|
||||
}
|
||||
@@ -78,6 +90,7 @@ public class TtCopyTemplate extends BaseEntity {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("templateId", getTemplateId())
|
||||
.append("templateName", getTemplateName())
|
||||
.append("templateGroup", getTemplateGroup())
|
||||
.append("templateBody", getTemplateBody())
|
||||
.append("sortNum", getSortNum())
|
||||
.append("status", getStatus())
|
||||
@@ -85,4 +98,4 @@ public class TtCopyTemplate extends BaseEntity {
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<resultMap type="TtCopyTemplate" id="TtCopyTemplateResult">
|
||||
<result property="templateId" column="template_id" />
|
||||
<result property="templateName" column="template_name" />
|
||||
<result property="templateGroup" column="template_group" />
|
||||
<result property="templateBody" column="template_body" />
|
||||
<result property="sortNum" column="sort_num" />
|
||||
<result property="status" column="status" />
|
||||
@@ -15,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTtCopyTemplateVo">
|
||||
select template_id, template_name, template_body, sort_num, status, create_time, update_time
|
||||
select template_id, template_name, template_group, template_body, sort_num, status, create_time, update_time
|
||||
from tt_copy_template
|
||||
</sql>
|
||||
|
||||
@@ -23,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectTtCopyTemplateVo"/>
|
||||
<where>
|
||||
<if test="templateName != null and templateName != ''"> and template_name like concat('%', #{templateName}, '%')</if>
|
||||
<if test="templateGroup != null and templateGroup != ''"> and template_group like concat('%', #{templateGroup}, '%')</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
order by sort_num asc, create_time asc
|
||||
@@ -43,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
insert into tt_copy_template
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="templateName != null and templateName != ''">template_name,</if>
|
||||
<if test="templateGroup != null and templateGroup != ''">template_group,</if>
|
||||
<if test="templateBody != null">template_body,</if>
|
||||
<if test="sortNum != null">sort_num,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
@@ -51,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="templateName != null and templateName != ''">#{templateName},</if>
|
||||
<if test="templateGroup != null and templateGroup != ''">#{templateGroup},</if>
|
||||
<if test="templateBody != null">#{templateBody},</if>
|
||||
<if test="sortNum != null">#{sortNum},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
@@ -63,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update tt_copy_template
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="templateName != null and templateName != ''">template_name = #{templateName},</if>
|
||||
<if test="templateGroup != null and templateGroup != ''">template_group = #{templateGroup},</if>
|
||||
<if test="templateBody != null">template_body = #{templateBody},</if>
|
||||
<if test="sortNum != null">sort_num = #{sortNum},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
@@ -82,4 +87,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user