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

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

Loading…
Cancel
Save