Kaynağa Gözat

房屋托管

suochencheng 7 yıl önce
ebeveyn
işleme
4ee47e67e5

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/HousingTrustMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.HousingTrust;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.HousingTrustMapper")
+public interface HousingTrustMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(HousingTrust record);
+
+    HousingTrust selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(HousingTrust record);
+
+    List<HousingTrust> queryAllHousingTrust(HousingTrust record);
+
+    List<HousingTrust> queryHousingTrustByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    HousingTrust queryHousingTrust(HousingTrust record);
+
+    List<HousingTrust> query(HousingTrust record);
+}
+

+ 394 - 0
src/main/java/com/izouma/awesomeadmin/dao/HousingTrustMapper.xml

@@ -0,0 +1,394 @@
+<?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.izouma.awesomeadmin.dao.HousingTrustMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.HousingTrust" >
+                <id column="id" property="id" jdbcType="INTEGER" />
+                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
+                                <result column="user_id" property="userId" jdbcType="VARCHAR" />
+                                <result column="user_name" property="userName" jdbcType="VARCHAR" />
+                                <result column="real_name" property="realName" jdbcType="VARCHAR" />
+                                <result column="telephone" property="telephone" jdbcType="VARCHAR" />
+                                <result column="address" property="address" jdbcType="VARCHAR" />
+                                <result column="address_detail" property="addressDetail" jdbcType="VARCHAR" />
+                                <result column="remark" property="remark" jdbcType="VARCHAR" />
+                                <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
+                                <result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
+            </resultMap>
+    <sql id="Base_Column_List" >
+        <trim  suffixOverrides="," >
+            id,
+
+            del_flag,
+
+            user_id,
+
+            user_name,
+
+            real_name,
+
+            telephone,
+
+            address,
+
+            address_detail,
+
+            remark,
+
+            create_time,
+
+            status_flag,
+
+            </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from housing_trust
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from housing_trust
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.HousingTrust" useGeneratedKeys="true" keyProperty="id">
+        insert into housing_trust
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+                <if test="id!= null" >
+                id,
+            </if>
+                <if test="delFlag!= null" >
+                del_flag,
+            </if>
+                <if test="userId!= null" >
+                user_id,
+            </if>
+                <if test="userName!= null" >
+                user_name,
+            </if>
+                <if test="realName!= null" >
+                real_name,
+            </if>
+                <if test="telephone!= null" >
+                telephone,
+            </if>
+                <if test="address!= null" >
+                address,
+            </if>
+                <if test="addressDetail!= null" >
+                address_detail,
+            </if>
+                <if test="remark!= null" >
+                remark,
+            </if>
+                <if test="createTime!= null" >
+                create_time,
+            </if>
+                <if test="statusFlag!= null" >
+                status_flag,
+            </if>
+            </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+                    <if test="id != null" >
+                #{id,jdbcType=INTEGER},
+            </if>
+                    <if test="delFlag != null" >
+                #{delFlag,jdbcType=CHAR},
+            </if>
+                    <if test="userId != null" >
+                #{userId,jdbcType=VARCHAR},
+            </if>
+                    <if test="userName != null" >
+                #{userName,jdbcType=VARCHAR},
+            </if>
+                    <if test="realName != null" >
+                #{realName,jdbcType=VARCHAR},
+            </if>
+                    <if test="telephone != null" >
+                #{telephone,jdbcType=VARCHAR},
+            </if>
+                    <if test="address != null" >
+                #{address,jdbcType=VARCHAR},
+            </if>
+                    <if test="addressDetail != null" >
+                #{addressDetail,jdbcType=VARCHAR},
+            </if>
+                    <if test="remark != null" >
+                #{remark,jdbcType=VARCHAR},
+            </if>
+                    <if test="createTime != null" >
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+                    <if test="statusFlag != null" >
+                #{statusFlag,jdbcType=INTEGER},
+            </if>
+                </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.HousingTrust" >
+        update housing_trust
+        <set >
+                    <if test="id != null" >
+               id= #{id,jdbcType=INTEGER},
+            </if>
+                     <if test="delFlag != null" >
+               del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+                     <if test="userId != null" >
+               user_id= #{userId,jdbcType=VARCHAR},
+            </if>
+                     <if test="userName != null" >
+               user_name= #{userName,jdbcType=VARCHAR},
+            </if>
+                     <if test="realName != null" >
+               real_name= #{realName,jdbcType=VARCHAR},
+            </if>
+                     <if test="telephone != null" >
+               telephone= #{telephone,jdbcType=VARCHAR},
+            </if>
+                     <if test="address != null" >
+               address= #{address,jdbcType=VARCHAR},
+            </if>
+                     <if test="addressDetail != null" >
+               address_detail= #{addressDetail,jdbcType=VARCHAR},
+            </if>
+                     <if test="remark != null" >
+               remark= #{remark,jdbcType=VARCHAR},
+            </if>
+                     <if test="createTime != null" >
+               create_time= #{createTime,jdbcType=TIMESTAMP},
+            </if>
+                     <if test="statusFlag != null" >
+               status_flag= #{statusFlag,jdbcType=INTEGER},
+            </if>
+                 </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryHousingTrustByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.HousingTrust">
+        select <include refid="Base_Column_List"/> from housing_trust
+        <where>
+            and del_flag = 'N'
+                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and  id = #{record.id}
+            </if>
+                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and  del_flag = #{record.delFlag}
+            </if>
+                     <if test="record.userId != null and !&quot;&quot;.equals(record.userId)">
+                and  user_id = #{record.userId}
+            </if>
+                     <if test="record.userName != null and !&quot;&quot;.equals(record.userName)">
+                and  user_name = #{record.userName}
+            </if>
+                     <if test="record.realName != null and !&quot;&quot;.equals(record.realName)">
+                and  real_name = #{record.realName}
+            </if>
+                     <if test="record.telephone != null and !&quot;&quot;.equals(record.telephone)">
+                and  telephone = #{record.telephone}
+            </if>
+                     <if test="record.address != null and !&quot;&quot;.equals(record.address)">
+                and  address = #{record.address}
+            </if>
+                     <if test="record.addressDetail != null and !&quot;&quot;.equals(record.addressDetail)">
+                and  address_detail = #{record.addressDetail}
+            </if>
+                     <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+                and  remark = #{record.remark}
+            </if>
+                     <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
+                and  create_time = #{record.createTime}
+            </if>
+                     <if test="record.statusFlag != null and !&quot;&quot;.equals(record.statusFlag)">
+                and  status_flag = #{record.statusFlag}
+            </if>
+                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                OR  user_id LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  user_name LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  real_name LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  telephone LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  address LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  address_detail LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  remark LIKE concat('%',#{record.searchKey},'%')
+                                                                                                                                                                     OR  status_flag LIKE concat('%',#{record.searchKey},'%')
+                                                             </trim>
+         </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllHousingTrust" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.HousingTrust">
+        select <include refid="Base_Column_List"/> from housing_trust
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and  id = #{id}
+            </if>
+                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and  del_flag = #{delFlag}
+            </if>
+                    <if test="userId != null and !&quot;&quot;.equals(userId)">
+                and  user_id = #{userId}
+            </if>
+                    <if test="userName != null and !&quot;&quot;.equals(userName)">
+                and  user_name = #{userName}
+            </if>
+                    <if test="realName != null and !&quot;&quot;.equals(realName)">
+                and  real_name = #{realName}
+            </if>
+                    <if test="telephone != null and !&quot;&quot;.equals(telephone)">
+                and  telephone = #{telephone}
+            </if>
+                    <if test="address != null and !&quot;&quot;.equals(address)">
+                and  address = #{address}
+            </if>
+                    <if test="addressDetail != null and !&quot;&quot;.equals(addressDetail)">
+                and  address_detail = #{addressDetail}
+            </if>
+                    <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and  remark = #{remark}
+            </if>
+                    <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and  create_time = #{createTime}
+            </if>
+                    <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
+                and  status_flag = #{statusFlag}
+            </if>
+                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                OR  user_id LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  user_name LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  real_name LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  telephone LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  address LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  address_detail LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  remark LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                                                                                                                        OR  status_flag LIKE concat('%',#{searchKey},'%')
+                                                                                        </trim>
+            </if>
+<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+        <choose>
+            <when test="item.indexOf('like') != -1">
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        concat('%',#{itemDetail},'%')
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </when>
+            <otherwise>
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        #{itemDetail}
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </otherwise>
+        </choose>
+
+
+    </foreach>
+
+
+</if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryHousingTrust" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.HousingTrust">
+        select <include refid="Base_Column_List"/> from housing_trust
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+                     <if test="userId != null and !&quot;&quot;.equals(userId)">
+                and user_id = #{userId}
+            </if>
+                     <if test="userName != null and !&quot;&quot;.equals(userName)">
+                and user_name = #{userName}
+            </if>
+                     <if test="realName != null and !&quot;&quot;.equals(realName)">
+                and real_name = #{realName}
+            </if>
+                     <if test="telephone != null and !&quot;&quot;.equals(telephone)">
+                and telephone = #{telephone}
+            </if>
+                     <if test="address != null and !&quot;&quot;.equals(address)">
+                and address = #{address}
+            </if>
+                     <if test="addressDetail != null and !&quot;&quot;.equals(addressDetail)">
+                and address_detail = #{addressDetail}
+            </if>
+                     <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+                     <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
+            </if>
+                     <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
+                and status_flag = #{statusFlag}
+            </if>
+         
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE housing_trust SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.HousingTrust">
+        select <include refid="Base_Column_List"/> from housing_trust
+        <where>
+            and del_flag = 'N'
+                                                                                                                                                                                                                                                                                                                                        </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 125 - 0
src/main/java/com/izouma/awesomeadmin/model/HousingTrust.java

@@ -0,0 +1,125 @@
+package com.izouma.awesomeadmin.model;
+
+import java.util.*;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class HousingTrust{
+    private Integer id;
+    private String delFlag;
+    private String userId;
+    private String userName;
+    private String realName;
+    private String telephone;
+    private String address;
+    private String addressDetail;
+    private String remark;
+    private Date createTime;
+    private Integer statusFlag;
+
+private String searchKey;
+
+/**
+* and,test_name,like,value;or,remark,=,123
+*/
+private String advancedQuery;
+
+    public Integer getId(){
+        return this.id;
+    }
+
+    public void setId(Integer id){
+        this.id = id;
+    }
+    public String getDelFlag(){
+        return this.delFlag;
+    }
+
+    public void setDelFlag(String delFlag){
+        this.delFlag = delFlag;
+    }
+    public String getUserId(){
+        return this.userId;
+    }
+
+    public void setUserId(String userId){
+        this.userId = userId;
+    }
+    public String getUserName(){
+        return this.userName;
+    }
+
+    public void setUserName(String userName){
+        this.userName = userName;
+    }
+    public String getRealName(){
+        return this.realName;
+    }
+
+    public void setRealName(String realName){
+        this.realName = realName;
+    }
+    public String getTelephone(){
+        return this.telephone;
+    }
+
+    public void setTelephone(String telephone){
+        this.telephone = telephone;
+    }
+    public String getAddress(){
+        return this.address;
+    }
+
+    public void setAddress(String address){
+        this.address = address;
+    }
+    public String getAddressDetail(){
+        return this.addressDetail;
+    }
+
+    public void setAddressDetail(String addressDetail){
+        this.addressDetail = addressDetail;
+    }
+    public String getRemark(){
+        return this.remark;
+    }
+
+    public void setRemark(String remark){
+        this.remark = remark;
+    }
+    public Date getCreateTime(){
+        return this.createTime;
+    }
+
+    public void setCreateTime(Date createTime){
+        this.createTime = createTime;
+    }
+    public Integer getStatusFlag(){
+        return this.statusFlag;
+    }
+
+    public void setStatusFlag(Integer statusFlag){
+        this.statusFlag = statusFlag;
+    }
+
+public String getSearchKey() {
+    return searchKey;
+}
+
+public void setSearchKey(String searchKey) {
+    this.searchKey = searchKey;
+}
+
+public String getAdvancedQuery() {
+    return advancedQuery;
+}
+
+public void setAdvancedQuery(String advancedQuery) {
+    this.advancedQuery = advancedQuery;
+}
+
+}
+

+ 27 - 0
src/main/java/com/izouma/awesomeadmin/service/HousingTrustService.java

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.HousingTrust;
+
+
+/**
+*  service接口类
+*/
+public interface HousingTrustService{
+
+    List<HousingTrust> getHousingTrustList(HousingTrust record);
+
+    List<HousingTrust> getHousingTrustByPage(Page page, HousingTrust record);
+
+    HousingTrust getHousingTrustById(String id);
+
+    HousingTrust getHousingTrust(HousingTrust record);
+
+    boolean createHousingTrust(HousingTrust record);
+
+    boolean deleteHousingTrust(String id);
+
+    boolean updateHousingTrust(HousingTrust record);
+}
+

+ 137 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/HousingTrustServiceImpl.java

@@ -0,0 +1,137 @@
+package com.izouma.awesomeadmin.service.impl;
+
+import java.util.*;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.HousingTrust;
+import com.izouma.awesomeadmin.service.HousingTrustService;
+import com.izouma.awesomeadmin.dao.HousingTrustMapper;
+
+/**
+*  service接口实现类
+*/
+@Service
+public class HousingTrustServiceImpl implements HousingTrustService{
+
+    private static Logger logger = Logger.getLogger(HousingTrustServiceImpl.class);
+
+    @Autowired
+    private HousingTrustMapper housingTrustMapper;
+
+    @Override
+    public List<HousingTrust> getHousingTrustList(HousingTrust record) {
+
+        logger.info("getHousingTrustList");
+        try {
+
+        return housingTrustMapper.queryAllHousingTrust(record);
+        } catch (Exception e) {
+        logger.error("getHousingTrustList", e);
+        }
+
+        return null;
+    }
+    @Override
+    public List<HousingTrust> getHousingTrustByPage(Page page, HousingTrust record) {
+
+        logger.info("getHousingTrustByPage");
+        try {
+
+        Map<String, Object> parameter = new HashMap<String, Object>();
+        parameter.put("record", record);
+        parameter.put(AppConstant.PAGE, page);
+
+        return housingTrustMapper.queryHousingTrustByPage(parameter);
+        } catch (Exception e) {
+        logger.error("getHousingTrustByPage", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public HousingTrust getHousingTrustById(String id) {
+
+        logger.info("getHousingTrustyId");
+        try {
+
+            return housingTrustMapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+        logger.error("getHousingTrustById", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public HousingTrust getHousingTrust(HousingTrust record) {
+
+        logger.info("getHousingTrust");
+        try {
+
+            return housingTrustMapper.queryHousingTrust(record);
+        } catch (Exception e) {
+        logger.error("getHousingTrust", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public boolean createHousingTrust(HousingTrust record) {
+
+        logger.info("createHousingTrust");
+        try {
+
+            int updates = housingTrustMapper.insertSelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+            logger.error("createHousingTrust", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean deleteHousingTrust(String id) {
+
+        logger.info("deleteHousingTrust");
+        try {
+
+             int updates = housingTrustMapper.delete(id);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("deleteHousingTrust", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean updateHousingTrust(HousingTrust record) {
+
+        logger.info("updateHousingTrust");
+        try {
+
+            int updates = housingTrustMapper.updateByPrimaryKeySelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("updateHousingTrust", e);
+        }
+
+        return false;
+    }
+}
+

+ 162 - 0
src/main/java/com/izouma/awesomeadmin/web/HousingTrustController.java

@@ -0,0 +1,162 @@
+package com.izouma.awesomeadmin.web;
+
+import java.util.*;
+
+import com.izouma.awesomeadmin.util.ExportExcelUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresAuthentication;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.HousingTrust;
+import com.izouma.awesomeadmin.service.HousingTrustService;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+*  controller类
+*/
+@Controller
+@RequestMapping("/housingTrust")
+public class HousingTrustController extends BaseController{
+
+    @Autowired
+    private HousingTrustService housingTrustService;
+
+    /**
+    * <p>获取全部记录。</p>
+    */
+    @RequiresAuthentication
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ResponseBody
+    public Result all(HousingTrust record) {
+        List<HousingTrust> pp = housingTrustService.getHousingTrustList(record);
+        return new Result(true, pp);
+    }
+
+    /**
+    * <p>根据Id。</p>
+    */
+    @RequestMapping(value = "/getHousingTrust", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getHousingTrust(@RequestParam(required = false, value = "id") String id) {
+        HousingTrust data = housingTrustService.getHousingTrustById(id);
+        return new Result(true, data);
+    }
+
+    /**
+    * <p>根据条件获取。</p>
+    */
+    @RequestMapping(value = "/getOne", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getOne(HousingTrust record) {
+        HousingTrust data = housingTrustService.getHousingTrust(record);
+        return new Result(true, data);
+    }
+
+
+    /**
+    * <p>分页查询。</p>
+    */
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    @ResponseBody
+    public Result page(Page page, HousingTrust record) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<HousingTrust> pp =housingTrustService.getHousingTrustByPage(page, record);
+
+        result.put(AppConstant.PAGE, page);
+        result.put("pp", pp);
+        return new Result(true, result);
+    }
+
+
+    /**
+    * <p>保存。</p>
+    */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public Result save(HousingTrust record) {
+        boolean num = housingTrustService.createHousingTrust(record);
+        if (num) {
+        return new Result(true, record.getId());
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>更新信息。</p>
+    */
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public Result updateHousingTrust(HousingTrust record) {
+        boolean num = housingTrustService.updateHousingTrust(record);
+        if (num) {
+        return new Result(true, "保存成功");
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>删除。</p>
+    */
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    @ResponseBody
+    public Result deleteHousingTrust(@RequestParam(required = true, value = "id") String id) {
+
+        boolean num = housingTrustService.deleteHousingTrust(id);
+        if (num) {
+        return new Result(true, "删除成功");
+        }
+        return new Result(false, "删除异常");
+    }
+
+    /**
+    * 导出Excel
+    * @param request
+    * @param response
+    * @param record
+    * @throws Exception
+    */
+    @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
+    @ResponseBody
+    public void exportExcel(HttpServletRequest request, HttpServletResponse response, HousingTrust record) throws Exception {
+
+    List<HousingTrust> housingTrusts = housingTrustService.getHousingTrustList(record);
+
+
+        String sheetName = "housing_trust";
+        String titleName = "房屋托管 数据表";
+        String fileName = "房屋托管 表";
+        int columnNumber = 11;
+        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20 };
+        String[] columnName = {  " id" ,   "删除标识" ,   "用户ID" ,   "用户名" ,   "姓名" ,   "联系电话" ,   "地址区域" ,   "详细地址" ,   "备注" ,   "时间" ,   "状态"  };
+        String[][] dataList = new String[housingTrusts.size()][11];
+
+        for (int i = 0; i < housingTrusts.size(); i++) {
+
+                        dataList[i][0] = String.valueOf(housingTrusts.get(i).getId());
+                        dataList[i][1] = String.valueOf(housingTrusts.get(i).getDelFlag());
+                        dataList[i][2] = String.valueOf(housingTrusts.get(i).getUserId());
+                        dataList[i][3] = String.valueOf(housingTrusts.get(i).getUserName());
+                        dataList[i][4] = String.valueOf(housingTrusts.get(i).getRealName());
+                        dataList[i][5] = String.valueOf(housingTrusts.get(i).getTelephone());
+                        dataList[i][6] = String.valueOf(housingTrusts.get(i).getAddress());
+                        dataList[i][7] = String.valueOf(housingTrusts.get(i).getAddressDetail());
+                        dataList[i][8] = String.valueOf(housingTrusts.get(i).getRemark());
+                        dataList[i][9] = String.valueOf(housingTrusts.get(i).getCreateTime());
+                        dataList[i][10] = String.valueOf(housingTrusts.get(i).getStatusFlag());
+                    }
+
+
+        ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
+        columnNumber, columnWidth, columnName, dataList, response);
+
+
+        }
+    }
+

+ 107 - 0
src/main/vue/src/pages/HousingTrust.vue

@@ -0,0 +1,107 @@
+<template>
+    <div>
+        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small" style="max-width: 500px;">
+            <el-form-item prop="userId" label="用户ID">
+                <el-input v-model="formData.userId"></el-input>
+            </el-form-item>
+            <el-form-item prop="userName" label="用户名">
+                <el-input v-model="formData.userName"></el-input>
+            </el-form-item>
+            <el-form-item prop="realName" label="姓名">
+                <el-input v-model="formData.realName"></el-input>
+            </el-form-item>
+            <el-form-item prop="telephone" label="联系电话">
+                <el-input v-model="formData.telephone"></el-input>
+            </el-form-item>
+            <el-form-item prop="address" label="地址区域">
+                <el-input v-model="formData.address"></el-input>
+            </el-form-item>
+            <el-form-item prop="addressDetail" label="详细地址">
+                <el-input v-model="formData.addressDetail"></el-input>
+            </el-form-item>
+            <el-form-item prop="remark" label="备注">
+                <el-input v-model="formData.remark"></el-input>
+            </el-form-item>
+            <!-- <el-form-item prop="statusFlag" label="状态">
+                <el-input v-model="formData.statusFlag"></el-input>
+            </el-form-item> -->
+            <el-form-item>
+                <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
+                <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
+                <el-button @click="$router.go(-1)">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+import formValidator from '../formValidator'
+
+export default {
+    created() {
+        if (this.$route.query.id) {
+            this.$http.get({
+                url: '/housingTrust/getOne',
+                data: {
+                    id: this.$route.query.id
+                }
+            }).then(res => {
+                if (res.success) {
+                    this.formData = res.data;
+                }
+            })
+        }
+    },
+    data() {
+        return {
+            saving: false,
+            formData: {},
+            rules: {
+            },
+        }
+    },
+    methods: {
+        onSave() {
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    this.submit();
+                } else {
+                    return false;
+                }
+            });
+        },
+        submit() {
+            var data = JSON.parse(JSON.stringify(this.formData));
+            this.$http.post({
+                url: this.formData.id ? '/housingTrust/update' : '/housingTrust/save',
+                data: data
+            }).then(res => {
+                if (res.success) {
+                    this.$message.success('成功');
+                    this.$router.go(-1);
+                } else {
+                    this.$message.warning('失败')
+                }
+            });
+        },
+        onDelete() {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                return this.$http.post({
+                    url: '/housingTrust/del',
+                    data: { id: this.formData.id }
+                })
+            }).then(() => {
+                this.$message.success('删除成功');
+                this.$router.go(-1);
+            }).catch(action => {
+                if (action === 'cancel') {
+                    this.$message.info('删除取消');
+                } else {
+                    this.$message.error('删除失败');
+                }
+            })
+        },
+    }
+}
+</script>
+<style lang="less" scoped>
+</style>

+ 345 - 0
src/main/vue/src/pages/HousingTrusts.vue

@@ -0,0 +1,345 @@
+<template>
+    <div>
+        <div class="filters-container">
+
+            <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
+            <!--<el-select placeholder="性别" size="small" v-model="filter2" clearable class="filter-item">
+                <el-option
+                        label="女"
+                        value="item1">
+                </el-option>
+                <el-option
+                        label="男"
+                        value="item2">
+                </el-option>
+            </el-select>-->
+            <el-button @click="getData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
+            </el-button>
+            <!-- <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
+            </el-button> -->
+            <el-button @click="$router.push('/housingTrust')" type="primary" size="small" icon="el-icon-edit" class="filter-item">添加
+            </el-button>
+            <!-- <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
+            </el-button> -->
+            <el-dropdown trigger="click" size="medium" class="table-column-filter">
+                <span>
+                    筛选数据
+                    <i class="el-icon-arrow-down el-icon--right"></i>
+                </span>
+                <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
+                    <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
+                    </el-checkbox>
+                </el-dropdown-menu>
+            </el-dropdown>
+        </div>
+        <el-table :data="tableData" :height="tableHeight" row-key="id" ref="table">
+            <el-table-column v-if="multipleMode" align="center" type="selection" width="50">
+            </el-table-column>
+            <el-table-column type="index" min-width="50" align="center">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('userId')" prop="userId" label="用户ID" min-width="100">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('userName')" prop="userName" label="用户名" min-width="100">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('realName')" prop="realName" label="姓名" min-width="100">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('telephone')" prop="telephone" label="联系电话" min-width="100">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('address')" prop="address" label="地址区域" min-width="100">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('addressDetail')" prop="addressDetail" label="详细地址" min-width="100">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('remark')" prop="remark" label="备注" min-width="100">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('createTime')" prop="createTime" :formatter="DateTimeFormatter" label="时间" min-width="130">
+            </el-table-column>
+            <!-- <el-table-column v-if="isColumnShow('statusFlag')" prop="statusFlag" label="状态" min-width="100">
+            </el-table-column> -->
+            <el-table-column label="操作" align="center" fixed="right">
+                <template slot-scope="scope">
+                    <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <!-- <div class="multiple-mode-wrapper">
+                <el-button size="small" v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button size="small" @click="operation1">批量操作1</el-button>
+                    <el-button size="small" @click="operation2">批量操作2</el-button>
+                    <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div> -->
+            <el-pagination background @size-change="pageSizeChange" @current-change="currentPageChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalNumber">
+            </el-pagination>
+        </div>
+        <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
+            <el-button @click="addField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="advancedQueryFields">
+
+                <el-table-column prop="link" label="链接符" align="center">
+                    <template slot-scope="{row}">
+                        <el-select placeholder="链接" size="small" v-model="row.link" class="filter-item">
+                            <el-option label="AND" value="AND">
+                            </el-option>
+                            <el-option label="OR" value="OR">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="字段" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.name">
+
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.searchMethod">
+                            <el-option v-for="item in searchMethods" :label="item" :value="item" :key="item"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="value" label="参数" align="center">
+                    <template slot-scope="{row}">
+                        <el-input v-model="row.value"></el-input>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="advancedQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+    </div>
+</template>
+<script>
+import { mapState } from 'vuex'
+import { format } from 'date-fns'
+import zh from 'date-fns/locale/zh_cn'
+
+export default {
+    created() {
+        this.getData();
+    },
+    data() {
+        return {
+            totalNumber: 0,
+            totalPage: 10,
+            currentPage: 1,
+            pageSize: 20,
+            tableData: [],
+            filter1: '',
+            filter2: '',
+            tableColumns: [
+                {
+                    label: '用户ID',
+                    value: 'userId',
+                    show: true
+                },
+                {
+                    label: '用户名',
+                    value: 'userName',
+                    show: true
+                },
+                {
+                    label: '姓名',
+                    value: 'realName',
+                    show: true
+                },
+                {
+                    label: '联系电话',
+                    value: 'telephone',
+                    show: true
+                },
+                {
+                    label: '地址区域',
+                    value: 'address',
+                    show: true
+                },
+                {
+                    label: '详细地址',
+                    value: 'addressDetail',
+                    show: true
+                },
+                {
+                    label: '备注',
+                    value: 'remark',
+                    show: true
+                },
+                {
+                    label: '时间',
+                    value: 'createTime',
+                    show: true
+                },
+                // {
+                //     label: '状态',
+                //     value: 'statusFlag',
+                //     show: true
+                // },
+            ],
+            multipleMode: false,
+            showAdvancedQueryDialog: false,
+            advancedQueryFields: [],
+            searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+            advancedQueryColumns: [
+                {
+                    label: '用户ID',
+                    value: 'user_id'
+                },
+                {
+                    label: '用户名',
+                    value: 'user_name'
+                },
+                {
+                    label: '姓名',
+                    value: 'real_name'
+                },
+                {
+                    label: '联系电话',
+                    value: 'telephone'
+                },
+                {
+                    label: '地址区域',
+                    value: 'address'
+                },
+                {
+                    label: '详细地址',
+                    value: 'address_detail'
+                },
+                {
+                    label: '备注',
+                    value: 'remark'
+                },
+                // {
+                //     label: '时间',
+                //     value: 'create_time'
+                // },
+                // {
+                //     label: '状态',
+                //     value: 'status_flag'
+                // },
+            ],
+            advancedQuerySearchKey: '',
+        }
+    },
+    computed: {
+        ...mapState(['tableHeight']),
+        selection() {
+            return this.$refs.table.selection.map(i => i.id);
+        }
+    },
+    methods: {
+        pageSizeChange(size) {
+            this.currentPage = 1;
+            this.pageSize = size;
+            this.getData();
+        },
+        currentPageChange(page) {
+            this.currentPage = page;
+            this.getData();
+        },
+        getData() {
+            this.$http.get({
+                url: '/housingTrust/page',
+                data: {
+                    currentPage: this.currentPage,
+                    pageNumber: this.pageSize,
+                    searchKey: this.filter1,
+                    advancedQuery: this.advancedQuerySearchKey,
+                }
+            }).then(res => {
+                if (res.success) {
+                    this.totalNumber = res.data.page.totalNumber;
+                    this.tableData = res.data.pp;
+                }
+            })
+        },
+        isColumnShow(column) {
+            var row = this.tableColumns.find(i => i.value === column);
+            return row ? row.show : false;
+        },
+        toggleMultipleMode(multipleMode) {
+            this.multipleMode = multipleMode;
+            if (!multipleMode) {
+                this.$refs.table.clearSelection();
+            }
+        },
+        editRow(row) {
+            this.$router.push({
+                path: '/housingTrust',
+                query: {
+                    id: row.id
+                }
+            })
+        },
+        operation1() {
+            this.$notify({
+                title: '提示',
+                message: this.selection
+            });
+        },
+        operation2() {
+            this.$message('操作2');
+        },
+        addField() {
+            this.advancedQueryFields.push({
+                link: 'AND',
+                name: '',
+                searchMethod: '=',
+                value: '',
+            });
+        },
+        removeField(i) {
+            if (this.advancedQueryFields.length > 0) {
+                this.advancedQueryFields.splice(i, 1);
+            }
+        },
+        advancedQuery() {
+
+            this.advancedQuerySearchKey = '';
+
+            if (this.advancedQueryFields.length > 0) {
+
+                var templist = [];
+
+                this.advancedQueryFields.forEach(item => {
+                    if (item.link && item.name && item.searchMethod && item.value) {
+                        var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                        templist.push(tempItem);
+                    }
+                })
+
+                if (templist.length > 0) {
+
+                    this.advancedQuerySearchKey = templist.join('_;');
+                }
+            }
+
+            this.getData();
+            this.showAdvancedQueryDialog = false;
+        },
+        exportExcel() {
+            window.location.href = this.$baseUrl + "/housingTrust/exportExcel?searchKey=" + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey
+        },
+        DateTimeFormatter(row, column, cellValue) {
+            if (cellValue) {
+                return format(cellValue, 'YYYY/MM/DD HH:mm', { locale: zh })
+            }
+
+        },
+
+    }
+}
+</script>
+<style lang="less" scoped>
+</style>

+ 11 - 0
src/main/vue/src/router/index.js

@@ -353,6 +353,17 @@ const router = new Router({
                     name: 'companyInfo',
                     component: () => import('../pages/CompanyInfo')
                 },
+                //房屋托管
+                {
+                    path: '/housingTrusts',
+                    name: 'housingTrusts',
+                    component: () => import('../pages/HousingTrusts')
+                },
+                {
+                    path: '/housingTrust',
+                    name: 'housingTrust',
+                    component: () => import('../pages/HousingTrust')
+                },
 
             ]
         },