添加标签name

main
hansha 2 years ago
parent 9f455a44e1
commit d6bb542f57

@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* szxc_jm_tag * szxc_jm_tag
* *
* @author hs * @author hs
* @date 2024-03-16 * @date 2024-03-21
*/ */
public class SzxcJmTag extends BaseEntity public class SzxcJmTag extends BaseEntity
{ {
@ -21,6 +21,10 @@ public class SzxcJmTag extends BaseEntity
/** 标签id */ /** 标签id */
private Long tagId; private Long tagId;
/** 标签名称 */
@Excel(name = "标签名称")
private String tagName;
public void setJmId(Long jmId) public void setJmId(Long jmId)
{ {
this.jmId = jmId; this.jmId = jmId;
@ -39,12 +43,22 @@ public class SzxcJmTag extends BaseEntity
{ {
return tagId; return tagId;
} }
public void setTagName(String tagName)
{
this.tagName = tagName;
}
public String getTagName()
{
return tagName;
}
@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("jmId", getJmId()) .append("jmId", getJmId())
.append("tagId", getTagId()) .append("tagId", getTagId())
.append("tagName", getTagName())
.toString(); .toString();
} }
} }

@ -7,15 +7,17 @@
<resultMap type="SzxcJmTag" id="SzxcJmTagResult"> <resultMap type="SzxcJmTag" id="SzxcJmTagResult">
<result property="jmId" column="jm_id" /> <result property="jmId" column="jm_id" />
<result property="tagId" column="tag_id" /> <result property="tagId" column="tag_id" />
<result property="tagName" column="tag_name" />
</resultMap> </resultMap>
<sql id="selectSzxcJmTagVo"> <sql id="selectSzxcJmTagVo">
select jm_id, tag_id from szxc_jm_tag select jm_id, tag_id, tag_name from szxc_jm_tag
</sql> </sql>
<select id="selectSzxcJmTagList" parameterType="SzxcJmTag" resultMap="SzxcJmTagResult"> <select id="selectSzxcJmTagList" parameterType="SzxcJmTag" resultMap="SzxcJmTagResult">
<include refid="selectSzxcJmTagVo"/> <include refid="selectSzxcJmTagVo"/>
<where> <where>
<if test="tagName != null and tagName != ''"> and tag_name like concat('%', #{tagName}, '%')</if>
</where> </where>
</select> </select>
@ -29,10 +31,12 @@
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jmId != null">jm_id,</if> <if test="jmId != null">jm_id,</if>
<if test="tagId != null">tag_id,</if> <if test="tagId != null">tag_id,</if>
<if test="tagName != null">tag_name,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jmId != null">#{jmId},</if> <if test="jmId != null">#{jmId},</if>
<if test="tagId != null">#{tagId},</if> <if test="tagId != null">#{tagId},</if>
<if test="tagName != null">#{tagName},</if>
</trim> </trim>
</insert> </insert>
@ -40,6 +44,7 @@
update szxc_jm_tag update szxc_jm_tag
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="tagId != null">tag_id = #{tagId},</if> <if test="tagId != null">tag_id = #{tagId},</if>
<if test="tagName != null">tag_name = #{tagName},</if>
</trim> </trim>
where jm_id = #{jmId} where jm_id = #{jmId}
</update> </update>

@ -1,6 +1,14 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="标签名称" prop="tagName">
<el-input
v-model="queryParams.tagName"
placeholder="请输入标签名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -57,6 +65,7 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="居民id" align="center" prop="jmId" /> <el-table-column label="居民id" align="center" prop="jmId" />
<el-table-column label="标签id" align="center" prop="tagId" /> <el-table-column label="标签id" align="center" prop="tagId" />
<el-table-column label="标签名称" align="center" prop="tagName" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -88,6 +97,9 @@
<!-- 添加或修改居民标签关联对话框 --> <!-- 添加或修改居民标签关联对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="标签名称" prop="tagName">
<el-input v-model="form.tagName" placeholder="请输入标签名称" />
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -126,6 +138,7 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
tagName: null
}, },
// //
form: {}, form: {},
@ -156,7 +169,8 @@ export default {
reset() { reset() {
this.form = { this.form = {
jmId: null, jmId: null,
tagId: null tagId: null,
tagName: null
}; };
this.resetForm("form"); this.resetForm("form");
}, },

Loading…
Cancel
Save