添加房屋名称

main
hansha 2 years ago
parent 835f8924fb
commit a376bb2626

@ -1,8 +1,9 @@
package com.ruoyi.szxc.domain; package com.ruoyi.szxc.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* szxc_cs_fw * szxc_cs_fw
@ -20,6 +21,10 @@ public class SzxcCsFw extends BaseEntity
/** 房屋id */ /** 房屋id */
private Long fwId; private Long fwId;
/** 房屋名称 */
@Excel(name = "房屋名称")
private String fwName;
public void setCsId(Long csId) public void setCsId(Long csId)
{ {
this.csId = csId; this.csId = csId;
@ -38,12 +43,22 @@ public class SzxcCsFw extends BaseEntity
{ {
return fwId; return fwId;
} }
public void setFwName(String fwName)
{
this.fwName = fwName;
}
public String getFwName()
{
return fwName;
}
@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("csId", getCsId()) .append("csId", getCsId())
.append("fwId", getFwId()) .append("fwId", getFwId())
.append("fwName", getFwName())
.toString(); .toString();
} }
} }

@ -7,15 +7,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="SzxcCsFw" id="SzxcCsFwResult"> <resultMap type="SzxcCsFw" id="SzxcCsFwResult">
<result property="csId" column="cs_id" /> <result property="csId" column="cs_id" />
<result property="fwId" column="fw_id" /> <result property="fwId" column="fw_id" />
<result property="fwName" column="fw_name" />
</resultMap> </resultMap>
<sql id="selectSzxcCsFwVo"> <sql id="selectSzxcCsFwVo">
select cs_id, fw_id from szxc_cs_fw select cs_id, fw_id, fw_name from szxc_cs_fw
</sql> </sql>
<select id="selectSzxcCsFwList" parameterType="SzxcCsFw" resultMap="SzxcCsFwResult"> <select id="selectSzxcCsFwList" parameterType="SzxcCsFw" resultMap="SzxcCsFwResult">
<include refid="selectSzxcCsFwVo"/> <include refid="selectSzxcCsFwVo"/>
<where> <where>
<if test="fwName != null and fwName != ''"> and fw_name like concat('%', #{fwName}, '%')</if>
</where> </where>
</select> </select>
@ -29,10 +31,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="csId != null">cs_id,</if> <if test="csId != null">cs_id,</if>
<if test="fwId != null">fw_id,</if> <if test="fwId != null">fw_id,</if>
<if test="fwName != null and fwName != ''">fw_name,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="csId != null">#{csId},</if> <if test="csId != null">#{csId},</if>
<if test="fwId != null">#{fwId},</if> <if test="fwId != null">#{fwId},</if>
<if test="fwName != null and fwName != ''">#{fwName},</if>
</trim> </trim>
</insert> </insert>
@ -40,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update szxc_cs_fw update szxc_cs_fw
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="fwId != null">fw_id = #{fwId},</if> <if test="fwId != null">fw_id = #{fwId},</if>
<if test="fwName != null and fwName != ''">fw_name = #{fwName},</if>
</trim> </trim>
where cs_id = #{csId} where cs_id = #{csId}
</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="fwName">
<el-input
v-model="queryParams.fwName"
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="csId" /> <el-table-column label="场所id" align="center" prop="csId" />
<el-table-column label="房屋id" align="center" prop="fwId" /> <el-table-column label="房屋id" align="center" prop="fwId" />
<el-table-column label="房屋名称" align="center" prop="fwName" />
<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="fwName">
<el-input v-model="form.fwName" 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,11 +138,15 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
fwName: null
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
fwName: [
{ required: true, message: "房屋名称不能为空", trigger: "blur" }
]
} }
}; };
}, },
@ -156,7 +172,8 @@ export default {
reset() { reset() {
this.form = { this.form = {
csId: null, csId: null,
fwId: null fwId: null,
fwName: null
}; };
this.resetForm("form"); this.resetForm("form");
}, },

Loading…
Cancel
Save