Ver código fonte

住建:创建源码包
生成附件代码

Memory_LG 11 meses atrás
pai
commit
41cef00c96

+ 106 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/controller/CenterdataTHousingconstructionAttachController.java

@@ -0,0 +1,106 @@
+package com.sooka.sponest.data.housingconstruction.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionAttach;
+import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionAttachService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 住建-附件Controller
+ *
+ * @author lg
+ * @date 2024-07-29
+ */
+@RestController
+@RequestMapping("/attach")
+public class CenterdataTHousingconstructionAttachController extends BaseController
+{
+    @Autowired
+    private ICenterdataTHousingconstructionAttachService centerdataTHousingconstructionAttachService;
+
+/**
+ * 查询住建-附件列表
+ */
+@RequiresPermissions("housingconstruction:attach:list")
+@GetMapping("/list")
+    public TableDataInfo list(CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach)
+    {
+        startPage();
+        List<CenterdataTHousingconstructionAttach> list = centerdataTHousingconstructionAttachService.selectCenterdataTHousingconstructionAttachList(centerdataTHousingconstructionAttach);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出住建-附件列表
+     */
+    @RequiresPermissions("housingconstruction:attach:export")
+    @Log(title = "住建-附件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach)
+    {
+        List<CenterdataTHousingconstructionAttach> list = centerdataTHousingconstructionAttachService.selectCenterdataTHousingconstructionAttachList(centerdataTHousingconstructionAttach);
+        ExcelUtil<CenterdataTHousingconstructionAttach> util = new ExcelUtil<CenterdataTHousingconstructionAttach>(CenterdataTHousingconstructionAttach.class);
+        util.exportExcel(response, list, "住建-附件数据");
+    }
+
+    /**
+     * 获取住建-附件详细信息
+     */
+    @RequiresPermissions("housingconstruction:attach:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(centerdataTHousingconstructionAttachService.selectCenterdataTHousingconstructionAttachById(id));
+    }
+
+    /**
+     * 新增住建-附件
+     */
+    @RequiresPermissions("housingconstruction:attach:add")
+    @Log(title = "住建-附件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach)
+    {
+        return toAjax(centerdataTHousingconstructionAttachService.insertCenterdataTHousingconstructionAttach(centerdataTHousingconstructionAttach));
+    }
+
+    /**
+     * 修改住建-附件
+     */
+    @RequiresPermissions("housingconstruction:attach:edit")
+    @Log(title = "住建-附件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach)
+    {
+        return toAjax(centerdataTHousingconstructionAttachService.updateCenterdataTHousingconstructionAttach(centerdataTHousingconstructionAttach));
+    }
+
+    /**
+     * 删除住建-附件
+     */
+    @RequiresPermissions("housingconstruction:attach:remove")
+    @Log(title = "住建-附件", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(centerdataTHousingconstructionAttachService.deleteCenterdataTHousingconstructionAttachByIds(ids));
+    }
+}

+ 177 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/domain/CenterdataTHousingconstructionAttach.java

@@ -0,0 +1,177 @@
+package com.sooka.sponest.data.housingconstruction.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 住建-附件对象 centerdata_t_housingconstruction_attach
+ *
+ * @author lg
+ * @date 2024-07-29
+ */
+public class CenterdataTHousingconstructionAttach extends BaseEntity
+        {
+private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 业务id */
+            @Excel(name = "业务id")
+    private String busId;
+
+    /** 附件属性 */
+            @Excel(name = "附件属性")
+    private String dictType;
+
+    /** 附件属性明细 */
+            @Excel(name = "附件属性明细")
+    private String dictValue;
+
+    /** 附件路径 */
+            @Excel(name = "附件路径")
+    private String attachPath;
+
+    /** 附件名称 */
+            @Excel(name = "附件名称")
+    private String fileName;
+
+    /** 排序 */
+            @Excel(name = "排序")
+    private Long attachSorts;
+
+    /** 创建人 */
+    private String createName;
+
+    /** 更新人 */
+    private String updateName;
+
+    /** 部门id */
+    private Long deptId;
+
+    /** 部门名称 */
+    private String deptName;
+
+    public void setId(Long id)
+            {
+            this.id = id;
+            }
+
+    public Long getId()
+            {
+            return id;
+            }
+    public void setBusId(String busId)
+            {
+            this.busId = busId;
+            }
+
+    public String getBusId()
+            {
+            return busId;
+            }
+    public void setDictType(String dictType)
+            {
+            this.dictType = dictType;
+            }
+
+    public String getDictType()
+            {
+            return dictType;
+            }
+    public void setDictValue(String dictValue)
+            {
+            this.dictValue = dictValue;
+            }
+
+    public String getDictValue()
+            {
+            return dictValue;
+            }
+    public void setAttachPath(String attachPath)
+            {
+            this.attachPath = attachPath;
+            }
+
+    public String getAttachPath()
+            {
+            return attachPath;
+            }
+    public void setFileName(String fileName)
+            {
+            this.fileName = fileName;
+            }
+
+    public String getFileName()
+            {
+            return fileName;
+            }
+    public void setAttachSorts(Long attachSorts)
+            {
+            this.attachSorts = attachSorts;
+            }
+
+    public Long getAttachSorts()
+            {
+            return attachSorts;
+            }
+    public void setCreateName(String createName)
+            {
+            this.createName = createName;
+            }
+
+    public String getCreateName()
+            {
+            return createName;
+            }
+    public void setUpdateName(String updateName)
+            {
+            this.updateName = updateName;
+            }
+
+    public String getUpdateName()
+            {
+            return updateName;
+            }
+    public void setDeptId(Long deptId)
+            {
+            this.deptId = deptId;
+            }
+
+    public Long getDeptId()
+            {
+            return deptId;
+            }
+    public void setDeptName(String deptName)
+            {
+            this.deptName = deptName;
+            }
+
+    public String getDeptName()
+            {
+            return deptName;
+            }
+
+@Override
+public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("busId", getBusId())
+            .append("dictType", getDictType())
+            .append("dictValue", getDictValue())
+            .append("attachPath", getAttachPath())
+            .append("fileName", getFileName())
+            .append("attachSorts", getAttachSorts())
+            .append("createTime", getCreateTime())
+            .append("createBy", getCreateBy())
+            .append("createName", getCreateName())
+            .append("updateTime", getUpdateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateName", getUpdateName())
+            .append("deptId", getDeptId())
+            .append("deptName", getDeptName())
+        .toString();
+        }
+        }

+ 62 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/mapper/CenterdataTHousingconstructionAttachMapper.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.data.housingconstruction.mapper;
+
+import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionAttach;
+
+import java.util.List;
+
+/**
+ * 住建-附件Mapper接口
+ *
+ * @author lg
+ * @date 2024-07-29
+ */
+public interface CenterdataTHousingconstructionAttachMapper
+{
+    /**
+     * 查询住建-附件
+     *
+     * @param id 住建-附件主键
+     * @return 住建-附件
+     */
+    public CenterdataTHousingconstructionAttach selectCenterdataTHousingconstructionAttachById(Long id);
+
+    /**
+     * 查询住建-附件列表
+     *
+     * @param centerdataTHousingconstructionAttach 住建-附件
+     * @return 住建-附件集合
+     */
+    public List<CenterdataTHousingconstructionAttach> selectCenterdataTHousingconstructionAttachList(CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach);
+
+    /**
+     * 新增住建-附件
+     *
+     * @param centerdataTHousingconstructionAttach 住建-附件
+     * @return 结果
+     */
+    public int insertCenterdataTHousingconstructionAttach(CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach);
+
+    /**
+     * 修改住建-附件
+     *
+     * @param centerdataTHousingconstructionAttach 住建-附件
+     * @return 结果
+     */
+    public int updateCenterdataTHousingconstructionAttach(CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach);
+
+    /**
+     * 删除住建-附件
+     *
+     * @param id 住建-附件主键
+     * @return 结果
+     */
+    public int deleteCenterdataTHousingconstructionAttachById(Long id);
+
+    /**
+     * 批量删除住建-附件
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCenterdataTHousingconstructionAttachByIds(Long[] ids);
+}

+ 62 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/service/ICenterdataTHousingconstructionAttachService.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.data.housingconstruction.service;
+
+import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionAttach;
+
+import java.util.List;
+
+/**
+ * 住建-附件Service接口
+ *
+ * @author lg
+ * @date 2024-07-29
+ */
+public interface ICenterdataTHousingconstructionAttachService
+{
+    /**
+     * 查询住建-附件
+     *
+     * @param id 住建-附件主键
+     * @return 住建-附件
+     */
+    public CenterdataTHousingconstructionAttach selectCenterdataTHousingconstructionAttachById(Long id);
+
+    /**
+     * 查询住建-附件列表
+     *
+     * @param centerdataTHousingconstructionAttach 住建-附件
+     * @return 住建-附件集合
+     */
+    public List<CenterdataTHousingconstructionAttach> selectCenterdataTHousingconstructionAttachList(CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach);
+
+    /**
+     * 新增住建-附件
+     *
+     * @param centerdataTHousingconstructionAttach 住建-附件
+     * @return 结果
+     */
+    public int insertCenterdataTHousingconstructionAttach(CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach);
+
+    /**
+     * 修改住建-附件
+     *
+     * @param centerdataTHousingconstructionAttach 住建-附件
+     * @return 结果
+     */
+    public int updateCenterdataTHousingconstructionAttach(CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach);
+
+    /**
+     * 批量删除住建-附件
+     *
+     * @param ids 需要删除的住建-附件主键集合
+     * @return 结果
+     */
+    public int deleteCenterdataTHousingconstructionAttachByIds(Long[] ids);
+
+    /**
+     * 删除住建-附件信息
+     *
+     * @param id 住建-附件主键
+     * @return 结果
+     */
+    public int deleteCenterdataTHousingconstructionAttachById(Long id);
+}

+ 96 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/service/impl/CenterdataTHousingconstructionAttachServiceImpl.java

@@ -0,0 +1,96 @@
+package com.sooka.sponest.data.housingconstruction.service.impl;
+
+import java.util.List;
+        import com.ruoyi.common.core.utils.DateUtils;
+import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionAttach;
+import com.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionAttachMapper;
+import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionAttachService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 住建-附件Service业务层处理
+ *
+ * @author lg
+ * @date 2024-07-29
+ */
+@Service
+public class CenterdataTHousingconstructionAttachServiceImpl implements ICenterdataTHousingconstructionAttachService
+{
+    @Autowired
+    private CenterdataTHousingconstructionAttachMapper centerdataTHousingconstructionAttachMapper;
+
+    /**
+     * 查询住建-附件
+     *
+     * @param id 住建-附件主键
+     * @return 住建-附件
+     */
+    @Override
+    public CenterdataTHousingconstructionAttach selectCenterdataTHousingconstructionAttachById(Long id)
+    {
+        return centerdataTHousingconstructionAttachMapper.selectCenterdataTHousingconstructionAttachById(id);
+    }
+
+    /**
+     * 查询住建-附件列表
+     *
+     * @param centerdataTHousingconstructionAttach 住建-附件
+     * @return 住建-附件
+     */
+    @Override
+    public List<CenterdataTHousingconstructionAttach> selectCenterdataTHousingconstructionAttachList(CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach)
+    {
+        return centerdataTHousingconstructionAttachMapper.selectCenterdataTHousingconstructionAttachList(centerdataTHousingconstructionAttach);
+    }
+
+    /**
+     * 新增住建-附件
+     *
+     * @param centerdataTHousingconstructionAttach 住建-附件
+     * @return 结果
+     */
+    @Override
+    public int insertCenterdataTHousingconstructionAttach(CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach)
+    {
+                centerdataTHousingconstructionAttach.setCreateTime(DateUtils.getNowDate());
+            return centerdataTHousingconstructionAttachMapper.insertCenterdataTHousingconstructionAttach(centerdataTHousingconstructionAttach);
+    }
+
+    /**
+     * 修改住建-附件
+     *
+     * @param centerdataTHousingconstructionAttach 住建-附件
+     * @return 结果
+     */
+    @Override
+    public int updateCenterdataTHousingconstructionAttach(CenterdataTHousingconstructionAttach centerdataTHousingconstructionAttach)
+    {
+                centerdataTHousingconstructionAttach.setUpdateTime(DateUtils.getNowDate());
+        return centerdataTHousingconstructionAttachMapper.updateCenterdataTHousingconstructionAttach(centerdataTHousingconstructionAttach);
+    }
+
+    /**
+     * 批量删除住建-附件
+     *
+     * @param ids 需要删除的住建-附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCenterdataTHousingconstructionAttachByIds(Long[] ids)
+    {
+        return centerdataTHousingconstructionAttachMapper.deleteCenterdataTHousingconstructionAttachByIds(ids);
+    }
+
+    /**
+     * 删除住建-附件信息
+     *
+     * @param id 住建-附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCenterdataTHousingconstructionAttachById(Long id)
+    {
+        return centerdataTHousingconstructionAttachMapper.deleteCenterdataTHousingconstructionAttachById(id);
+    }
+}

+ 115 - 0
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionAttachMapper.xml

@@ -0,0 +1,115 @@
+<?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.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionAttachMapper">
+    
+    <resultMap type="CenterdataTHousingconstructionAttach" id="CenterdataTHousingconstructionAttachResult">
+        <result property="id"    column="id"    />
+        <result property="busId"    column="bus_id"    />
+        <result property="dictType"    column="dict_type"    />
+        <result property="dictValue"    column="dict_value"    />
+        <result property="attachPath"    column="attach_path"    />
+        <result property="fileName"    column="file_name"    />
+        <result property="attachSorts"    column="attach_sorts"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createName"    column="create_name"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateName"    column="update_name"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="deptName"    column="dept_name"    />
+    </resultMap>
+
+    <sql id="selectCenterdataTHousingconstructionAttachVo">
+        select id, bus_id, dict_type, dict_value, attach_path, file_name, attach_sorts, create_time, create_by, create_name, update_time, update_by, update_name, dept_id, dept_name from centerdata_t_housingconstruction_attach
+    </sql>
+
+    <select id="selectCenterdataTHousingconstructionAttachList" parameterType="CenterdataTHousingconstructionAttach" resultMap="CenterdataTHousingconstructionAttachResult">
+        <include refid="selectCenterdataTHousingconstructionAttachVo"/>
+        <where>  
+            <if test="busId != null  and busId != ''"> and bus_id = #{busId}</if>
+            <if test="dictType != null  and dictType != ''"> and dict_type = #{dictType}</if>
+            <if test="dictValue != null  and dictValue != ''"> and dict_value = #{dictValue}</if>
+            <if test="attachPath != null  and attachPath != ''"> and attach_path = #{attachPath}</if>
+            <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
+            <if test="attachSorts != null "> and attach_sorts = #{attachSorts}</if>
+        </where>
+    </select>
+    
+    <select id="selectCenterdataTHousingconstructionAttachById" parameterType="Long" resultMap="CenterdataTHousingconstructionAttachResult">
+        <include refid="selectCenterdataTHousingconstructionAttachVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertCenterdataTHousingconstructionAttach" parameterType="CenterdataTHousingconstructionAttach">
+        insert into centerdata_t_housingconstruction_attach
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="busId != null">bus_id,</if>
+            <if test="dictType != null">dict_type,</if>
+            <if test="dictValue != null">dict_value,</if>
+            <if test="attachPath != null">attach_path,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="attachSorts != null">attach_sorts,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createName != null">create_name,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateName != null">update_name,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="deptName != null">dept_name,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="busId != null">#{busId},</if>
+            <if test="dictType != null">#{dictType},</if>
+            <if test="dictValue != null">#{dictValue},</if>
+            <if test="attachPath != null">#{attachPath},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="attachSorts != null">#{attachSorts},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createName != null">#{createName},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateName != null">#{updateName},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="deptName != null">#{deptName},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCenterdataTHousingconstructionAttach" parameterType="CenterdataTHousingconstructionAttach">
+        update centerdata_t_housingconstruction_attach
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="busId != null">bus_id = #{busId},</if>
+            <if test="dictType != null">dict_type = #{dictType},</if>
+            <if test="dictValue != null">dict_value = #{dictValue},</if>
+            <if test="attachPath != null">attach_path = #{attachPath},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="attachSorts != null">attach_sorts = #{attachSorts},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createName != null">create_name = #{createName},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateName != null">update_name = #{updateName},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCenterdataTHousingconstructionAttachById" parameterType="Long">
+        delete from centerdata_t_housingconstruction_attach where id = #{id}
+    </delete>
+
+    <delete id="deleteCenterdataTHousingconstructionAttachByIds" parameterType="String">
+        delete from centerdata_t_housingconstruction_attach where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>