楼栋添加小区名称

main
hansha 2 years ago
parent 342b178654
commit 59b001f6f3

@ -7,9 +7,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* szxc_ld_info * szxc_ld_info
* *
* @author hs * @author hs
* @date 2024-03-16 * @date 2024-03-28
*/ */
public class SzxcLdInfo extends BaseEntity public class SzxcLdInfo extends BaseEntity
{ {
@ -18,10 +18,14 @@ public class SzxcLdInfo extends BaseEntity
/** id */ /** id */
private Long id; private Long id;
/** 所属小区 */ /** 所属小区id */
@Excel(name = "所属小区") @Excel(name = "所属小区id")
private Long xqId; private Long xqId;
/** 小区名称 */
@Excel(name = "小区名称")
private String xqName;
/** 楼栋名称 */ /** 楼栋名称 */
@Excel(name = "楼栋名称") @Excel(name = "楼栋名称")
private String ldName; private String ldName;
@ -70,129 +74,138 @@ public class SzxcLdInfo extends BaseEntity
@Excel(name = "创建者ID") @Excel(name = "创建者ID")
private Long userId; private Long userId;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
} }
public Long getId() public Long getId()
{ {
return id; return id;
} }
public void setXqId(Long xqId) public void setXqId(Long xqId)
{ {
this.xqId = xqId; this.xqId = xqId;
} }
public Long getXqId() public Long getXqId()
{ {
return xqId; return xqId;
} }
public void setLdName(String ldName) public void setXqName(String xqName)
{
this.xqName = xqName;
}
public String getXqName()
{
return xqName;
}
public void setLdName(String ldName)
{ {
this.ldName = ldName; this.ldName = ldName;
} }
public String getLdName() public String getLdName()
{ {
return ldName; return ldName;
} }
public void setXqType(String xqType) public void setXqType(String xqType)
{ {
this.xqType = xqType; this.xqType = xqType;
} }
public String getXqType() public String getXqType()
{ {
return xqType; return xqType;
} }
public void setLdSort(String ldSort) public void setLdSort(String ldSort)
{ {
this.ldSort = ldSort; this.ldSort = ldSort;
} }
public String getLdSort() public String getLdSort()
{ {
return ldSort; return ldSort;
} }
public void setLdjg(String ldjg) public void setLdjg(String ldjg)
{ {
this.ldjg = ldjg; this.ldjg = ldjg;
} }
public String getLdjg() public String getLdjg()
{ {
return ldjg; return ldjg;
} }
public void setQnfs(String qnfs) public void setQnfs(String qnfs)
{ {
this.qnfs = qnfs; this.qnfs = qnfs;
} }
public String getQnfs() public String getQnfs()
{ {
return qnfs; return qnfs;
} }
public void setLcNum(Long lcNum) public void setLcNum(Long lcNum)
{ {
this.lcNum = lcNum; this.lcNum = lcNum;
} }
public Long getLcNum() public Long getLcNum()
{ {
return lcNum; return lcNum;
} }
public void setUnitNum(Long unitNum) public void setUnitNum(Long unitNum)
{ {
this.unitNum = unitNum; this.unitNum = unitNum;
} }
public Long getUnitNum() public Long getUnitNum()
{ {
return unitNum; return unitNum;
} }
public void setHuNum(Long huNum) public void setHuNum(Long huNum)
{ {
this.huNum = huNum; this.huNum = huNum;
} }
public Long getHuNum() public Long getHuNum()
{ {
return huNum; return huNum;
} }
public void setLdDescribe(String ldDescribe) public void setLdDescribe(String ldDescribe)
{ {
this.ldDescribe = ldDescribe; this.ldDescribe = ldDescribe;
} }
public String getLdDescribe() public String getLdDescribe()
{ {
return ldDescribe; return ldDescribe;
} }
public void setDeptId(Long deptId) public void setDeptId(Long deptId)
{ {
this.deptId = deptId; this.deptId = deptId;
} }
public Long getDeptId() public Long getDeptId()
{ {
return deptId; return deptId;
} }
public void setDeptName(String deptName) public void setDeptName(String deptName)
{ {
this.deptName = deptName; this.deptName = deptName;
} }
public String getDeptName() public String getDeptName()
{ {
return deptName; return deptName;
} }
public void setUserId(Long userId) public void setUserId(Long userId)
{ {
this.userId = userId; this.userId = userId;
} }
public Long getUserId() public Long getUserId()
{ {
return userId; return userId;
} }
@ -200,24 +213,25 @@ public class SzxcLdInfo extends BaseEntity
@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("id", getId()) .append("id", getId())
.append("xqId", getXqId()) .append("xqId", getXqId())
.append("ldName", getLdName()) .append("xqName", getXqName())
.append("xqType", getXqType()) .append("ldName", getLdName())
.append("ldSort", getLdSort()) .append("xqType", getXqType())
.append("ldjg", getLdjg()) .append("ldSort", getLdSort())
.append("qnfs", getQnfs()) .append("ldjg", getLdjg())
.append("lcNum", getLcNum()) .append("qnfs", getQnfs())
.append("unitNum", getUnitNum()) .append("lcNum", getLcNum())
.append("huNum", getHuNum()) .append("unitNum", getUnitNum())
.append("ldDescribe", getLdDescribe()) .append("huNum", getHuNum())
.append("createBy", getCreateBy()) .append("ldDescribe", getLdDescribe())
.append("createTime", getCreateTime()) .append("createBy", getCreateBy())
.append("updateBy", getUpdateBy()) .append("createTime", getCreateTime())
.append("updateTime", getUpdateTime()) .append("updateBy", getUpdateBy())
.append("deptId", getDeptId()) .append("updateTime", getUpdateTime())
.append("deptName", getDeptName()) .append("deptId", getDeptId())
.append("userId", getUserId()) .append("deptName", getDeptName())
.toString(); .append("userId", getUserId())
.toString();
} }
} }

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.szxc.mapper.SzxcLdInfoMapper"> <mapper namespace="com.ruoyi.szxc.mapper.SzxcLdInfoMapper">
<resultMap type="SzxcLdInfo" id="SzxcLdInfoResult"> <resultMap type="SzxcLdInfo" id="SzxcLdInfoResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="xqId" column="xq_id" /> <result property="xqId" column="xq_id" />
<result property="xqName" column="xq_name" />
<result property="ldName" column="ld_name" /> <result property="ldName" column="ld_name" />
<result property="xqType" column="xq_type" /> <result property="xqType" column="xq_type" />
<result property="ldSort" column="ld_sort" /> <result property="ldSort" column="ld_sort" />
@ -26,13 +27,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectSzxcLdInfoVo"> <sql id="selectSzxcLdInfoVo">
select id, xq_id, ld_name, xq_type, ld_sort, ldjg, qnfs, lc_num, unit_num, hu_num, ld_describe, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_ld_info select id, xq_id, xq_name, ld_name, xq_type, ld_sort, ldjg, qnfs, lc_num, unit_num, hu_num, ld_describe, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_ld_info
</sql> </sql>
<select id="selectSzxcLdInfoList" parameterType="SzxcLdInfo" resultMap="SzxcLdInfoResult"> <select id="selectSzxcLdInfoList" parameterType="SzxcLdInfo" resultMap="SzxcLdInfoResult">
<include refid="selectSzxcLdInfoVo"/> <include refid="selectSzxcLdInfoVo"/>
<where> <where>
<if test="xqId != null "> and xq_id = #{xqId}</if> <if test="xqId != null "> and xq_id = #{xqId}</if>
<if test="xqName != null and xqName != ''"> and xq_name like concat('%', #{xqName}, '%')</if>
<if test="ldName != null and ldName != ''"> and ld_name like concat('%', #{ldName}, '%')</if> <if test="ldName != null and ldName != ''"> and ld_name like concat('%', #{ldName}, '%')</if>
<if test="xqType != null and xqType != ''"> and xq_type = #{xqType}</if> <if test="xqType != null and xqType != ''"> and xq_type = #{xqType}</if>
<if test="ldSort != null and ldSort != ''"> and ld_sort = #{ldSort}</if> <if test="ldSort != null and ldSort != ''"> and ld_sort = #{ldSort}</if>
@ -47,16 +49,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null "> and user_id = #{userId}</if> <if test="userId != null "> and user_id = #{userId}</if>
</where> </where>
</select> </select>
<select id="selectSzxcLdInfoById" parameterType="Long" resultMap="SzxcLdInfoResult"> <select id="selectSzxcLdInfoById" parameterType="Long" resultMap="SzxcLdInfoResult">
<include refid="selectSzxcLdInfoVo"/> <include refid="selectSzxcLdInfoVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertSzxcLdInfo" parameterType="SzxcLdInfo" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSzxcLdInfo" parameterType="SzxcLdInfo" useGeneratedKeys="true" keyProperty="id">
insert into szxc_ld_info insert into szxc_ld_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="xqId != null">xq_id,</if> <if test="xqId != null">xq_id,</if>
<if test="xqName != null">xq_name,</if>
<if test="ldName != null">ld_name,</if> <if test="ldName != null">ld_name,</if>
<if test="xqType != null">xq_type,</if> <if test="xqType != null">xq_type,</if>
<if test="ldSort != null">ld_sort,</if> <if test="ldSort != null">ld_sort,</if>
@ -73,9 +76,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null">dept_id,</if> <if test="deptId != null">dept_id,</if>
<if test="deptName != null">dept_name,</if> <if test="deptName != null">dept_name,</if>
<if test="userId != null">user_id,</if> <if test="userId != null">user_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="xqId != null">#{xqId},</if> <if test="xqId != null">#{xqId},</if>
<if test="xqName != null">#{xqName},</if>
<if test="ldName != null">#{ldName},</if> <if test="ldName != null">#{ldName},</if>
<if test="xqType != null">#{xqType},</if> <if test="xqType != null">#{xqType},</if>
<if test="ldSort != null">#{ldSort},</if> <if test="ldSort != null">#{ldSort},</if>
@ -92,13 +96,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null">#{deptId},</if> <if test="deptId != null">#{deptId},</if>
<if test="deptName != null">#{deptName},</if> <if test="deptName != null">#{deptName},</if>
<if test="userId != null">#{userId},</if> <if test="userId != null">#{userId},</if>
</trim> </trim>
</insert> </insert>
<update id="updateSzxcLdInfo" parameterType="SzxcLdInfo"> <update id="updateSzxcLdInfo" parameterType="SzxcLdInfo">
update szxc_ld_info update szxc_ld_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="xqId != null">xq_id = #{xqId},</if> <if test="xqId != null">xq_id = #{xqId},</if>
<if test="xqName != null">xq_name = #{xqName},</if>
<if test="ldName != null">ld_name = #{ldName},</if> <if test="ldName != null">ld_name = #{ldName},</if>
<if test="xqType != null">xq_type = #{xqType},</if> <if test="xqType != null">xq_type = #{xqType},</if>
<if test="ldSort != null">ld_sort = #{ldSort},</if> <if test="ldSort != null">ld_sort = #{ldSort},</if>
@ -124,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteSzxcLdInfoByIds" parameterType="String"> <delete id="deleteSzxcLdInfoByIds" parameterType="String">
delete from szxc_ld_info where id in delete from szxc_ld_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -1,10 +1,18 @@
<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="xqId"> <el-form-item label="所属小区id" prop="xqId">
<el-input <el-input
v-model="queryParams.xqId" v-model="queryParams.xqId"
placeholder="请输入所属小区" placeholder="请输入所属小区id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="小区名称" prop="xqName">
<el-input
v-model="queryParams.xqName"
placeholder="请输入小区名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
@ -152,7 +160,8 @@
<el-table v-loading="loading" :data="ldinfoList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="ldinfoList" @selection-change="handleSelectionChange">
<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="id" /> <el-table-column label="id" align="center" prop="id" />
<el-table-column label="所属小区" align="center" prop="xqId" /> <el-table-column label="所属小区id" align="center" prop="xqId" />
<el-table-column label="小区名称" align="center" prop="xqName" />
<el-table-column label="楼栋名称" align="center" prop="ldName" /> <el-table-column label="楼栋名称" align="center" prop="ldName" />
<el-table-column label="类型(0小区楼栋1独立房2其它)" align="center" prop="xqType" /> <el-table-column label="类型(0小区楼栋1独立房2其它)" align="center" prop="xqType" />
<el-table-column label="类别字典" align="center" prop="ldSort" /> <el-table-column label="类别字典" align="center" prop="ldSort" />
@ -184,7 +193,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -196,8 +205,11 @@
<!-- 添加或修改楼栋信息对话框 --> <!-- 添加或修改楼栋信息对话框 -->
<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="xqId"> <el-form-item label="所属小区id" prop="xqId">
<el-input v-model="form.xqId" placeholder="请输入所属小区" /> <el-input v-model="form.xqId" placeholder="请输入所属小区id" />
</el-form-item>
<el-form-item label="小区名称" prop="xqName">
<el-input v-model="form.xqName" placeholder="请输入小区名称" />
</el-form-item> </el-form-item>
<el-form-item label="楼栋名称" prop="ldName"> <el-form-item label="楼栋名称" prop="ldName">
<el-input v-model="form.ldName" placeholder="请输入楼栋名称" /> <el-input v-model="form.ldName" placeholder="请输入楼栋名称" />
@ -242,171 +254,173 @@
</template> </template>
<script> <script>
import { listLdinfo, getLdinfo, delLdinfo, addLdinfo, updateLdinfo } from "@/api/szxc/ldinfo"; import { listLdinfo, getLdinfo, delLdinfo, addLdinfo, updateLdinfo } from "@/api/szxc/ldinfo";
export default { export default {
name: "Ldinfo", name: "Ldinfo",
data() { data() {
return { return {
// //
loading: true, loading: true,
// //
ids: [], ids: [],
// //
single: true, single: true,
// //
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
ldinfoList: [], ldinfoList: [],
// //
title: "", title: "",
// //
open: false, open: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
xqId: null, xqId: null,
ldName: null, xqName: null,
xqType: null, ldName: null,
ldSort: null, xqType: null,
ldjg: null, ldSort: null,
qnfs: null, ldjg: null,
lcNum: null, qnfs: null,
unitNum: null, lcNum: null,
huNum: null, unitNum: null,
ldDescribe: null, huNum: null,
deptId: null, ldDescribe: null,
deptName: null, deptId: null,
userId: null deptName: null,
}, userId: null
// },
form: {}, //
// form: {},
rules: { //
xqId: [ rules: {
{ required: true, message: "所属小区不能为空", trigger: "blur" } xqId: [
], { required: true, message: "所属小区id不能为空", trigger: "blur" }
deptId: [ ],
{ required: true, message: "部门id不能为空", trigger: "blur" } deptId: [
], { required: true, message: "部门id不能为空", trigger: "blur" }
} ],
}; }
},
created() {
this.getList();
},
methods: {
/** 查询楼栋信息列表 */
getList() {
this.loading = true;
listLdinfo(this.queryParams).then(response => {
this.ldinfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
xqId: null,
ldName: null,
xqType: null,
ldSort: null,
ldjg: null,
qnfs: null,
lcNum: null,
unitNum: null,
huNum: null,
ldDescribe: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
deptId: null,
deptName: null,
userId: null
}; };
this.resetForm("form");
}, },
/** 搜索按钮操作 */ created() {
handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ methods: {
resetQuery() { /** 查询楼栋信息列表 */
this.resetForm("queryForm"); getList() {
this.handleQuery(); this.loading = true;
}, listLdinfo(this.queryParams).then(response => {
// this.ldinfoList = response.rows;
handleSelectionChange(selection) { this.total = response.total;
this.ids = selection.map(item => item.id) this.loading = false;
this.single = selection.length!==1 });
this.multiple = !selection.length },
}, //
/** 新增按钮操作 */ cancel() {
handleAdd() { this.open = false;
this.reset(); this.reset();
this.open = true; },
this.title = "添加楼栋信息"; //
}, reset() {
/** 修改按钮操作 */ this.form = {
handleUpdate(row) { id: null,
this.reset(); xqId: null,
const id = row.id || this.ids xqName: null,
getLdinfo(id).then(response => { ldName: null,
this.form = response.data; xqType: null,
ldSort: null,
ldjg: null,
qnfs: null,
lcNum: null,
unitNum: null,
huNum: null,
ldDescribe: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
deptId: null,
deptName: null,
userId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true; this.open = true;
this.title = "修改楼栋信息"; this.title = "添加楼栋信息";
}); },
}, /** 修改按钮操作 */
/** 提交按钮 */ handleUpdate(row) {
submitForm() { this.reset();
this.$refs["form"].validate(valid => { const id = row.id || this.ids
if (valid) { getLdinfo(id).then(response => {
if (this.form.id != null) { this.form = response.data;
updateLdinfo(this.form).then(response => { this.open = true;
this.$modal.msgSuccess("修改成功"); this.title = "修改楼栋信息";
this.open = false; });
this.getList(); },
}); /** 提交按钮 */
} else { submitForm() {
addLdinfo(this.form).then(response => { this.$refs["form"].validate(valid => {
this.$modal.msgSuccess("新增成功"); if (valid) {
this.open = false; if (this.form.id != null) {
this.getList(); updateLdinfo(this.form).then(response => {
}); this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addLdinfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
} }
} });
}); },
}, /** 删除按钮操作 */
/** 删除按钮操作 */ handleDelete(row) {
handleDelete(row) { const ids = row.id || this.ids;
const ids = row.id || this.ids; this.$modal.confirm('是否确认删除楼栋信息编号为"' + ids + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除楼栋信息编号为"' + ids + '"的数据项?').then(function() { return delLdinfo(ids);
return delLdinfo(ids); }).then(() => {
}).then(() => { this.getList();
this.getList(); this.$modal.msgSuccess("删除成功");
this.$modal.msgSuccess("删除成功"); }).catch(() => {});
}).catch(() => {}); },
}, /** 导出按钮操作 */
/** 导出按钮操作 */ handleExport() {
handleExport() { this.download('szxc/ldinfo/export', {
this.download('szxc/ldinfo/export', { ...this.queryParams
...this.queryParams }, `ldinfo_${new Date().getTime()}.xlsx`)
}, `ldinfo_${new Date().getTime()}.xlsx`) }
} }
} };
};
</script> </script>

Loading…
Cancel
Save