feat(hw-portal): 添加 jsonStrin字段并更新相关映射

- 在 HwWeb 类中添加 webJsonString 字段,用于存储 json 字符串
- 更新 HwWebMapper.xml,添加 webJsonString 的映射和相关 SQL 语句
master
zch 4 months ago
parent dcf432f9cc
commit d9b72f83af

@ -22,6 +22,10 @@ public class HwWeb extends BaseEntity
@Excel(name = "json")
private String webJson;
/** json字符串 */
@Excel(name = "json字符串")
private String webJsonString;
public void setWebId(Long webId)
{
this.webId = webId;
@ -40,12 +44,22 @@ public class HwWeb extends BaseEntity
{
return webJson;
}
public void setWebJsonString(String webJsonString)
{
this.webJsonString = webJsonString;
}
public String getWebJsonString()
{
return webJsonString;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("webId", getWebId())
.append("webJson", getWebJson())
.append("webJsonString", getWebJsonString())
.toString();
}
}

@ -7,16 +7,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="HwWeb" id="HwWebResult">
<result property="webId" column="web_id" />
<result property="webJson" column="web_json" />
<result property="webJsonString" column="web_json_string" />
</resultMap>
<sql id="selectHwWebVo">
select web_id, web_json from hw_web
select web_id, web_json, web_json_string from hw_web
</sql>
<select id="selectHwWebList" parameterType="HwWeb" resultMap="HwWebResult">
<include refid="selectHwWebVo"/>
<where>
<if test="webJson != null and webJson != ''"> and web_json = #{webJson}</if>
<if test="webJsonString != null and webJsonString != ''"> and web_json_string = #{webJsonString}</if>
</where>
</select>
@ -29,9 +31,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into hw_web
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="webJson != null">web_json,</if>
<if test="webJsonString != null">web_json_string,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="webJson != null">#{webJson},</if>
<if test="webJsonString != null">#{webJsonString},</if>
</trim>
</insert>
@ -39,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update hw_web
<trim prefix="SET" suffixOverrides=",">
<if test="webJson != null">web_json = #{webJson},</if>
<if test="webJsonString != null">web_json_string = #{webJsonString},</if>
</trim>
where web_id = #{webId}
</update>

Loading…
Cancel
Save