Commit cb66ca0b authored by lixuan's avatar lixuan

feat: 房源

parent d1a86d8e
......@@ -32,7 +32,8 @@ public class HouseResourceController {
@PutMapping
public AjaxResult updateHouseResource(@RequestBody HouseResourceSaveUpdateDto dto) {
return houseResourceService.updateHouseResource(dto);
houseResourceService.updateHouseResource(dto);
return AjaxResult.success();
}
@DeleteMapping
......
package com.ruoyi.system.domain.house;
import lombok.Data;
import java.io.Serializable;
@Data
public class BusinessEntityInfo implements Serializable {
private String id;
private String houseResourceId;
private String name;
private String nature;
private String socialCreditCode;
private String principal;
private String principalTel;
private String business;
private Integer workerNumber;
}
package com.ruoyi.system.domain.house;
import lombok.Data;
@Data
public class BusinessEntitySell {
private String id;
private String businessEntityInfoId;
private Integer year;
private String yearSell;
private String yearTax;
private String compare;
}
......@@ -65,4 +65,10 @@ public class HouseResource implements Serializable {
private String planeGraphUrl;
private int hireStatus;
private String address;
private String log;
private String lat;
}
......@@ -5,8 +5,8 @@ public class HouseEnums {
public enum HouseResourceAttributeEnum {
// 房源属性
ZL(0, "租赁"),
XS(1, "销售"),
ZY(2, "自");
QT(1, "其他"),
ZY(2, "自");
private final int code;
private final String desc;
......@@ -36,8 +36,9 @@ public class HouseEnums {
public enum HouseResourceTypeEnum {
// 房源类型
FY(0, "房源"),
QTQY(1, "其他区域");
ZY(0, "在营"),
KZ(1, "空置"),
GK(2, "挂靠");
private final int code;
private final String desc;
......
package com.ruoyi.system.domain.house.vo;
import com.ruoyi.system.domain.house.BusinessEntitySell;
import lombok.Data;
import java.util.List;
@Data
public class BusinessEntityDto {
private String id;
private String houseResourceId;
private String name;
private String nature;
private String socialCreditCode;
private String principal;
private String principalTel;
private String business;
private Integer workerNumber;
private List<BusinessEntitySell> businessEntitySells;
}
......@@ -83,4 +83,10 @@ public class HouseResourceDetail {
private int hireStatus;
private String hireStatusText;
private String address;
private String log;
private String lat;
}
......@@ -83,4 +83,12 @@ public class HouseResourcePage {
private int hireStatus;
private String hireStatusText;
private String address;
private String log;
private String lat;
private List<String> businessEntityInfoNames;
}
package com.ruoyi.system.domain.house.vo;
import com.ruoyi.system.domain.grid.GridCompany;
import com.ruoyi.system.domain.grid.GridShop;
import com.ruoyi.system.domain.house.HouseResource;
import lombok.Data;
......@@ -12,7 +10,5 @@ public class HouseResourceSaveUpdateDto {
private HouseResource houseResource;
private List<GridCompany> companyList;
private List<GridShop> shopList;
private List<BusinessEntityDto> businessEntityDtoList;
}
package com.ruoyi.system.mapper.house;
import com.ruoyi.system.domain.house.BusinessEntityInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface BusinessEntityInfoMapper {
// 插入业务实体信息
void insertBusinessEntityInfo(BusinessEntityInfo businessEntityInfo);
// 根据ID查询业务实体信息
BusinessEntityInfo selectBusinessEntityInfoById(@Param("id") String id);
// 更新业务实体信息
void updateBusinessEntityInfo(BusinessEntityInfo businessEntityInfo);
// 删除业务实体信息
void deleteBusinessEntityInfoById(@Param("id") String id);
// 查询所有业务实体信息
List<BusinessEntityInfo> selectAllBusinessEntityInfos();
void deleteByHouseResourceId(@Param("houseResourceId") String houseResourceId);
List<BusinessEntityInfo> selectAllBusinessEntityInfosByHouseResourceId(@Param("houseResourceId") String houseResourceId);
}
package com.ruoyi.system.mapper.house;
import com.ruoyi.system.domain.house.BusinessEntitySell;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface BusinessEntitySellMapper {
// 插入业务实体销售信息
void insertBusinessEntitySell(BusinessEntitySell businessEntitySell);
// 根据ID查询业务实体销售信息
BusinessEntitySell selectBusinessEntitySellById(@Param("id") String id);
// 更新业务实体销售信息
void updateBusinessEntitySell(BusinessEntitySell businessEntitySell);
// 删除业务实体销售信息
void deleteBusinessEntitySellById(@Param("id") String id);
// 查询所有业务实体销售信息
List<BusinessEntitySell> selectAllBusinessEntitySells();
void deleteBusinessEntitySellByEntityId(@Param("businessEntityId") String businessEntityId);
}
package com.ruoyi.system.service.house;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.house.HouseResource;
import com.ruoyi.system.domain.house.vo.HouseResourceDetail;
import com.ruoyi.system.domain.house.vo.HouseResourcePage;
......@@ -16,7 +15,7 @@ public interface HouseResourceService {
HouseResourceDetail queryHouseResourceById(String id);
AjaxResult updateHouseResource(HouseResourceSaveUpdateDto dto);
void updateHouseResource(HouseResourceSaveUpdateDto dto);
void deleteHouseResourceById(String id);
......
<?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">
<mapper namespace="com.ruoyi.system.mapper.house.BusinessEntityInfoMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.system.domain.house.BusinessEntityInfo">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="house_resource_id" property="houseResourceId" jdbcType="VARCHAR"/>
<result column="name" property="name" jdbcType="VARCHAR"/>
<result column="nature" property="nature" jdbcType="VARCHAR"/>
<result column="social_credit_code" property="socialCreditCode" jdbcType="VARCHAR"/>
<result column="principal" property="principal" jdbcType="VARCHAR"/>
<result column="principal_tel" property="principalTel" jdbcType="VARCHAR"/>
<result column="business" property="business" jdbcType="VARCHAR"/>
<result column="worker_number" property="workerNumber" jdbcType="INTEGER"/>
</resultMap>
<insert id="insertBusinessEntityInfo" parameterType="com.ruoyi.system.domain.house.BusinessEntityInfo">
INSERT INTO business_entity_info (
id, house_resource_id, name, nature, social_credit_code,
principal, principal_tel, business, worker_number
) VALUES (
#{id}, #{houseResourceId}, #{name}, #{nature}, #{socialCreditCode},
#{principal}, #{principalTel}, #{business}, #{workerNumber}
)
</insert>
<select id="selectBusinessEntityInfoById" resultMap="BaseResultMap">
SELECT * FROM business_entity_info WHERE id = #{id}
</select>
<update id="updateBusinessEntityInfo" parameterType="com.ruoyi.system.domain.house.BusinessEntityInfo">
UPDATE business_entity_info
<set>
<if test="houseResourceId != null">house_resource_id=#{houseResourceId},</if>
<if test="name != null">name=#{name},</if>
<if test="nature != null">nature=#{nature},</if>
<if test="socialCreditCode != null">social_credit_code=#{socialCreditCode},</if>
<if test="principal != null">principal=#{principal},</if>
<if test="principalTel != null">principal_tel=#{principalTel},</if>
<if test="business != null">business=#{business},</if>
<if test="workerNumber != null">worker_number=#{workerNumber},</if>
</set>
WHERE id=#{id}
</update>
<delete id="deleteBusinessEntityInfoById">
DELETE FROM business_entity_info WHERE id = #{id}
</delete>
<select id="selectAllBusinessEntityInfos" resultMap="BaseResultMap">
SELECT * FROM business_entity_info
</select>
<delete id="deleteByHouseResourceId">
DELETE FROM business_entity_info WHERE house_resource_id = #{houseResourceId}
</delete>
<select id="selectAllBusinessEntityInfosByHouseResourceId"
resultType="com.ruoyi.system.domain.house.BusinessEntityInfo">
SELECT * FROM business_entity_info WHERE house_resource_id = #{houseResourceId}
</select>
</mapper>
\ No newline at end of file
<?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">
<mapper namespace="com.ruoyi.system.mapper.house.BusinessEntitySellMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.system.domain.house.BusinessEntitySell">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="business_entity_info_id" property="businessEntityInfoId" jdbcType="VARCHAR"/>
<result column="year" property="year" jdbcType="INTEGER"/>
<result column="year_sell" property="yearSell" jdbcType="VARCHAR"/>
<result column="year_tax" property="yearTax" jdbcType="VARCHAR"/>
<result column="compare" property="compare" jdbcType="VARCHAR"/>
</resultMap>
<!-- 插入操作 -->
<insert id="insertBusinessEntitySell" parameterType="com.ruoyi.system.domain.house.BusinessEntitySell">
INSERT INTO business_entity_sell (
id, business_entity_info_id, year, year_sell, year_tax, compare
) VALUES (
#{id}, #{businessEntityInfoId}, #{year}, #{yearSell}, #{yearTax}, #{compare}
)
</insert>
<!-- 根据ID查询操作 -->
<select id="selectBusinessEntitySellById" resultMap="BaseResultMap">
SELECT * FROM business_entity_sell WHERE id = #{id}
</select>
<!-- 更新操作 -->
<update id="updateBusinessEntitySell" parameterType="com.ruoyi.system.domain.house.BusinessEntitySell">
UPDATE business_entity_sell
<set>
<if test="BusinessEntityInfoId != null">business_entity_info_id=#{businessEntityInfoId},</if>
<if test="year != null">year=#{year},</if>
<if test="yearSell != null">year_sell=#{yearSell},</if>
<if test="yearTax != null">year_tax=#{yearTax},</if>
<if test="compare != null">compare=#{compare},</if>
</set>
WHERE id=#{id}
</update>
<!-- 删除操作 -->
<delete id="deleteBusinessEntitySellById">
DELETE FROM business_entity_sell WHERE id = #{id}
</delete>
<!-- 查询所有记录操作 -->
<select id="selectAllBusinessEntitySells" resultMap="BaseResultMap">
SELECT * FROM business_entity_sell
</select>
<delete id="deleteBusinessEntitySellByEntityId">
DELETE FROM business_entity_sell WHERE business_entity_info_id = #{businessEntityId}
</delete>
</mapper>
\ No newline at end of file
......@@ -31,6 +31,9 @@
<result property="rentalUnit" column="rental_unit" jdbcType="INTEGER"/>
<result property="planeGraphUrl" column="plane_graph_url" jdbcType="VARCHAR"/>
<result property="hireStatus" column="hire_status" jdbcType="INTEGER"/>
<result property="address" column="address" jdbcType="VARCHAR"/>
<result property="log" column="log" jdbcType="VARCHAR"/>
<result property="lat" column="lat" jdbcType="VARCHAR"/>
</resultMap>
<insert id="insertHouseResource" parameterType="com.ruoyi.system.domain.house.HouseResource">
......@@ -38,12 +41,12 @@
(id, relation_id, two, three, four, type, project_id, house_resource_url, house_number, house_area,
house_resource_attribute, house_resource_type, house_resource_use, house_resource_equity, house_resource_equity_tel, ownership,
decoration_condition, orientation, landing_head_flag, common_area_number, office_number,
meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status)
meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status, address, log, lat)
VALUES
(#{id}, #{relationId}, #{two}, #{three}, #{four}, #{type}, #{projectId}, #{houseResourceUrl}, #{houseNumber}, #{houseArea},
#{houseResourceAttribute}, #{houseResourceType}, #{houseResourceUse}, #{houseResourceEquity}, #{houseResourceEquityTel}, #{ownership},
#{decorationCondition}, #{orientation}, #{landingHeadFlag}, #{commonAreaNumber}, #{officeNumber},
#{meetingNumber}, #{stationNumber}, #{setUp}, #{labelId}, #{unitPrice}, #{rentalUnit}, #{planeGraphUrl}, #{hireStatus})
#{meetingNumber}, #{stationNumber}, #{setUp}, #{labelId}, #{unitPrice}, #{rentalUnit}, #{planeGraphUrl}, #{hireStatus}, #{address}, #{log}, #{lat})
</insert>
<select id="selectHouseResourceById" resultType="com.ruoyi.system.domain.house.HouseResource" parameterType="string">
......@@ -79,7 +82,10 @@
unit_price = #{unitPrice},
rental_unit = #{rentalUnit},
plane_graph_url = #{planeGraphUrl},
hire_status = #{hireStatus}
hire_status = #{hireStatus},
address = #{address},
log = #{log},
lat = #{lat}
WHERE id = #{id}
</update>
......@@ -92,7 +98,7 @@
(id, relation_id, two, three, four, type, project_id, house_resource_url, house_number, house_area,
house_resource_attribute, house_resource_type, house_resource_use, house_resource_equity, house_resource_equity_tel, ownership,
decoration_condition, orientation, landing_head_flag, common_area_number, office_number,
meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status)
meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status, address, log, lat)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.relationId}, #{two}, #{three}, #{four}, #{item.type}, #{item.projectId}, #{item.houseResourceUrl},
......@@ -100,7 +106,7 @@
#{item.houseResourceUse}, #{item.houseResourceEquity}, #{item.houseResourceEquityTel}, #{ownership}, #{item.decorationCondition},
#{item.orientation}, #{item.landingHeadFlag}, #{item.commonAreaNumber}, #{item.officeNumber},
#{item.meetingNumber}, #{item.stationNumber}, #{item.setUp}, #{item.labelId}, #{item.unitPrice}, #{item.rentalUnit},
#{item.planeGraphUrl}, #{item.hireStatus})
#{item.planeGraphUrl}, #{item.hireStatus}, #{item.address}, #{item.log}, #{item.lat})
</foreach>
</insert>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment