添加房屋名称

main
hansha 2 years ago
parent 835f8924fb
commit a376bb2626

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

@ -1,21 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.szxc.mapper.SzxcCsFwMapper">
<resultMap type="SzxcCsFw" id="SzxcCsFwResult">
<result property="csId" column="cs_id" />
<result property="fwId" column="fw_id" />
<result property="fwName" column="fw_name" />
</resultMap>
<sql id="selectSzxcCsFwVo">
select cs_id, fw_id from szxc_cs_fw
select cs_id, fw_id, fw_name from szxc_cs_fw
</sql>
<select id="selectSzxcCsFwList" parameterType="SzxcCsFw" resultMap="SzxcCsFwResult">
<include refid="selectSzxcCsFwVo"/>
<where>
<if test="fwName != null and fwName != ''"> and fw_name like concat('%', #{fwName}, '%')</if>
</where>
</select>
@ -29,10 +31,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="csId != null">cs_id,</if>
<if test="fwId != null">fw_id,</if>
<if test="fwName != null and fwName != ''">fw_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="csId != null">#{csId},</if>
<if test="fwId != null">#{fwId},</if>
<if test="fwName != null and fwName != ''">#{fwName},</if>
</trim>
</insert>
@ -40,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update szxc_cs_fw
<trim prefix="SET" suffixOverrides=",">
<if test="fwId != null">fw_id = #{fwId},</if>
<if test="fwName != null and fwName != ''">fw_name = #{fwName},</if>
</trim>
where cs_id = #{csId}
</update>

@ -1,6 +1,14 @@
<template>
<div class="app-container">
<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-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>
@ -57,6 +65,7 @@
<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="fwId" />
<el-table-column label="房屋名称" align="center" prop="fwName" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -88,6 +97,9 @@
<!-- 添加或修改场所房屋关联对话框 -->
<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-item label="房屋名称" prop="fwName">
<el-input v-model="form.fwName" placeholder="请输入房屋名称" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -98,9 +110,9 @@
</template>
<script>
import { listCs_fw, getCs_fw, delCs_fw, addCs_fw, updateCs_fw } from "@/api/szxc/cs_fw";
import { listCs_fw, getCs_fw, delCs_fw, addCs_fw, updateCs_fw } from "@/api/szxc/cs_fw";
export default {
export default {
name: "Cs_fw",
data() {
return {
@ -126,11 +138,15 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
fwName: null
},
//
form: {},
//
rules: {
fwName: [
{ required: true, message: "房屋名称不能为空", trigger: "blur" }
]
}
};
},
@ -156,7 +172,8 @@ export default {
reset() {
this.form = {
csId: null,
fwId: null
fwId: null,
fwName: null
};
this.resetForm("form");
},
@ -229,5 +246,5 @@ export default {
}, `cs_fw_${new Date().getTime()}.xlsx`)
}
}
};
};
</script>

Loading…
Cancel
Save