Browse Source

TASK 45751 地块属性和地块经营

master
yangfuda 2 days ago
parent
commit
10b4c5cac2
12 changed files with 1930 additions and 0 deletions
  1. +199
    -0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/business/TResourceLandController.java
  2. +201
    -0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/business/TResourceOperationController.java
  3. +121
    -0
      ruoyi-business/src/main/java/com/ruoyi/business/domain/TResourceLand.java
  4. +95
    -0
      ruoyi-business/src/main/java/com/ruoyi/business/domain/TResourceOperation.java
  5. +85
    -0
      ruoyi-business/src/main/java/com/ruoyi/business/mapper/TResourceLandMapper.java
  6. +77
    -0
      ruoyi-business/src/main/java/com/ruoyi/business/mapper/TResourceOperationMapper.java
  7. +87
    -0
      ruoyi-business/src/main/java/com/ruoyi/business/service/ITResourceLandService.java
  8. +87
    -0
      ruoyi-business/src/main/java/com/ruoyi/business/service/ITResourceOperationService.java
  9. +235
    -0
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/TResourceLandServiceImpl.java
  10. +214
    -0
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/TResourceOperationServiceImpl.java
  11. +293
    -0
      ruoyi-business/src/main/resources/mapper/business/TResourceLandMapper.xml
  12. +236
    -0
      ruoyi-business/src/main/resources/mapper/business/TResourceOperationMapper.xml

+ 199
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/business/TResourceLandController.java View File

@@ -0,0 +1,199 @@
package com.ruoyi.web.controller.business;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.business.domain.TResourceLand;
import com.ruoyi.business.service.ITResourceLandService;
import com.ruoyi.common.core.domain.pdf.PageSet;
import com.ruoyi.common.core.domain.pdf.PdfProperty;
import com.ruoyi.common.core.domain.pdf.ShoulderItem;
import com.ruoyi.common.utils.pdf.PdfUtils;
import com.ruoyi.common.utils.translation.TranslateUtils;
import org.apache.commons.compress.utils.Lists;
import org.springframework.security.access.prepost.PreAuthorize;
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.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.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;

/**
* 地块属性Controller
*
* @author yfd
* @date 2025-09-05
*/
@RestController
@RequestMapping("/business/resourceLand")
public class TResourceLandController extends BaseController
{
@Autowired
private ITResourceLandService tResourceLandService;

/**
* 查询地块属性列表
*/
@PreAuthorize("@ss.hasPermi('business:resourceLand:list')")
@GetMapping("/list")
public TableDataInfo list(TResourceLand tResourceLand)
{
startPage();
List<TResourceLand> list = tResourceLandService.selectTResourceLandList(tResourceLand);
return getDataTable(list);
}


/**
* 导出地块属性列表
*/
@PreAuthorize("@ss.hasPermi('business:resourceLand:export')")
@Log(title = "地块属性", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TResourceLand tResourceLand)
{
List<TResourceLand> list = tResourceLandService.selectTResourceLandList(tResourceLand);
ExcelUtil<TResourceLand> util = new ExcelUtil<TResourceLand>(TResourceLand.class);
util.exportExcel(response, list, "地块属性数据");
}

/**
* 地块属性导入模板
*/
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<TResourceLand> util = new ExcelUtil<TResourceLand>(TResourceLand.class);
util.importTemplateExcel(response, "地块属性数据");
}

/**
* 地块属性导入
*/
@Log(title = "地块属性", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('business:resourceLand:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
ExcelUtil<TResourceLand> util = new ExcelUtil<TResourceLand>(TResourceLand.class);
List<TResourceLand> list = util.importExcel(file.getInputStream(), 0);
String message = tResourceLandService.importTResourceLand(list, updateSupport, getUsername());
return AjaxResult.success(message);
}

/**
* 获取地块属性详细信息
*/
@PreAuthorize("@ss.hasPermi('business:resourceLand:query')")
@GetMapping(value = "/{DKBM}")
public AjaxResult getInfo(@PathVariable("DKBM") String DKBM)
{
return success(tResourceLandService.selectTResourceLandByDKBM(DKBM));
}

/**
* 获取地块属性详细信息,翻译字典
*/
@GetMapping(value = "/detail/{DKBM}")
public AjaxResult detail(@PathVariable("DKBM") String DKBM)
{
TResourceLand detail = tResourceLandService.selectTResourceLandByDKBM(DKBM);
TranslateUtils.translate(detail, false);
return success(detail);
}

/**
* 新增地块属性
*/
@PreAuthorize("@ss.hasPermi('business:resourceLand:add')")
@Log(title = "地块属性", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody TResourceLand tResourceLand)
{
return toAjax(tResourceLandService.insertTResourceLand(tResourceLand));
}

/**
* 修改地块属性
*/
@PreAuthorize("@ss.hasPermi('business:resourceLand:edit')")
@Log(title = "地块属性", businessType = BusinessType.UPDATE)
@PostMapping("/update")
public AjaxResult edit(@RequestBody TResourceLand tResourceLand)
{
return toAjax(tResourceLandService.updateTResourceLand(tResourceLand));
}

/**
* 删除地块属性
*/
@PreAuthorize("@ss.hasPermi('business:resourceLand:remove')")
@Log(title = "地块属性", businessType = BusinessType.DELETE)
@GetMapping("/delete/{DKBMs}")
public AjaxResult remove(@PathVariable String[] DKBMs)
{
return toAjax(tResourceLandService.deleteTResourceLandByDKBMs(DKBMs));
}

/**
* 打印地块属性
*/
@PreAuthorize("@ss.hasPermi('business:resourceLand:print')")
@Log(title = "地块属性", businessType = BusinessType.PRINT)
@GetMapping("/print")
public void printPdf(TResourceLand tResourceLand, HttpServletResponse response) throws Exception{

List<TResourceLand> list = tResourceLandService.selectTResourceLandList(tResourceLand);
TranslateUtils.translateList(list, false);

PdfProperty pdf = new PdfProperty();
pdf.setTitle("地块属性");
//pdf.setRowHeight(20f);

ShoulderItem shoulder = new ShoulderItem();
shoulder.setLeftItem("编制单位:");
shoulder.setCenterItem("日期:" );
shoulder.setRightItem("单位:");
pdf.setShoulder(shoulder);

float[] columnWidth = new float[]{20, 40, 10, 10, 10, 10};
pdf.setColumnWidth(columnWidth);
String[] header = new String[]{"A列", "B列", "C列", "D列", "E列", "F列"};
pdf.setHeader(header);
int[] aligns = new int[]{0, 0, 1, 1, 2, 2};
pdf.setAligns(aligns);

List<String[]> contentList = Lists.newArrayList();
list.forEach(a ->{
String[] str = new String[6];
str[0] = "";
str[1] = "";
str[2] = "";
str[3] = "";
str[4] = "";
str[5] = "";
contentList.add(str);
});
pdf.setContentList(contentList);

PageSet ps = new PageSet();
ps.setPaperWidth(595.0f);
ps.setPaperHeight(842.0f);
ps.setPrintDirection("1");
ps.setTableTotalWidth(520);
ps.setMarginLeft(50);
ps.setMarginRight(50);
ps.setMarginTop(50);
ps.setMarginBottom(50);
pdf.setPageSet(ps);

PdfUtils.initPdf(response, pdf);
}
}

+ 201
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/business/TResourceOperationController.java View File

@@ -0,0 +1,201 @@
package com.ruoyi.web.controller.business;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.common.core.domain.pdf.PageSet;
import com.ruoyi.common.core.domain.pdf.PdfProperty;
import com.ruoyi.common.core.domain.pdf.ShoulderItem;
import com.ruoyi.common.utils.pdf.PdfUtils;
import com.ruoyi.common.utils.translation.TranslateUtils;
import org.apache.commons.compress.utils.Lists;
import org.springframework.security.access.prepost.PreAuthorize;
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.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.business.domain.TResourceOperation;
import com.ruoyi.business.service.ITResourceOperationService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;

/**
* 地块经营Controller
*
* @author yfd
* @date 2025-09-05
*/
@RestController
@RequestMapping("/business/resourceOperation")
public class TResourceOperationController extends BaseController
{
@Autowired
private ITResourceOperationService tResourceOperationService;

/**
* 查询地块经营列表
*/
@PreAuthorize("@ss.hasPermi('business:resourceOperation:list')")
@GetMapping("/list")
public TableDataInfo list(TResourceOperation tResourceOperation)
{
startPage();
List<TResourceOperation> list = tResourceOperationService.selectTResourceOperationList(tResourceOperation);
return getDataTable(list);
}


/**
* 导出地块经营列表
*/
@PreAuthorize("@ss.hasPermi('business:resourceOperation:export')")
@Log(title = "地块经营", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TResourceOperation tResourceOperation)
{
List<TResourceOperation> list = tResourceOperationService.selectTResourceOperationList(tResourceOperation);
ExcelUtil<TResourceOperation> util = new ExcelUtil<TResourceOperation>(TResourceOperation.class);
util.exportExcel(response, list, "地块经营数据");
}

/**
* 地块经营导入模板
*/
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<TResourceOperation> util = new ExcelUtil<TResourceOperation>(TResourceOperation.class);
util.importTemplateExcel(response, "地块经营数据");
}

/**
* 地块经营导入
*/
@Log(title = "地块经营", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('business:resourceOperation:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
ExcelUtil<TResourceOperation> util = new ExcelUtil<TResourceOperation>(TResourceOperation.class);
List<TResourceOperation> list = util.importExcel(file.getInputStream(), 0);
String message = tResourceOperationService.importTResourceOperation(list, updateSupport, getUsername());
return AjaxResult.success(message);
}

/**
* 获取地块经营详细信息
*/
@PreAuthorize("@ss.hasPermi('business:resourceOperation:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tResourceOperationService.selectTResourceOperationById(id));
}

/**
* 获取地块经营详细信息,翻译字典
*/
@GetMapping(value = "/detail/{id}")
public AjaxResult detail(@PathVariable("id") Long id)
{
TResourceOperation detail = tResourceOperationService.selectTResourceOperationById(id);
TranslateUtils.translate(detail, false);
return success(detail);
}

/**
* 新增地块经营
*/
@PreAuthorize("@ss.hasPermi('business:resourceOperation:add')")
@Log(title = "地块经营", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody TResourceOperation tResourceOperation)
{
return toAjax(tResourceOperationService.insertTResourceOperation(tResourceOperation));
}

/**
* 修改地块经营
*/
@PreAuthorize("@ss.hasPermi('business:resourceOperation:edit')")
@Log(title = "地块经营", businessType = BusinessType.UPDATE)
@PostMapping("/update")
public AjaxResult edit(@RequestBody TResourceOperation tResourceOperation)
{
return toAjax(tResourceOperationService.updateTResourceOperation(tResourceOperation));
}

/**
* 删除地块经营
*/
@PreAuthorize("@ss.hasPermi('business:resourceOperation:remove')")
@Log(title = "地块经营", businessType = BusinessType.DELETE)
@GetMapping("/delete/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tResourceOperationService.deleteTResourceOperationByIds(ids));
}

/**
* 打印地块经营
*/
@PreAuthorize("@ss.hasPermi('business:resourceOperation:print')")
@Log(title = "地块经营", businessType = BusinessType.PRINT)
@GetMapping("/print")
public void printPdf(TResourceOperation tResourceOperation, HttpServletResponse response) throws Exception{

List<TResourceOperation> list = tResourceOperationService.selectTResourceOperationList(tResourceOperation);
TranslateUtils.translateList(list, false);

PdfProperty pdf = new PdfProperty();
pdf.setTitle("地块经营");
//pdf.setRowHeight(20f);

ShoulderItem shoulder = new ShoulderItem();
shoulder.setLeftItem("编制单位:");
shoulder.setCenterItem("日期:" );
shoulder.setRightItem("单位:");
pdf.setShoulder(shoulder);

float[] columnWidth = new float[]{20, 40, 10, 10, 10, 10};
pdf.setColumnWidth(columnWidth);
String[] header = new String[]{"A列", "B列", "C列", "D列", "E列", "F列"};
pdf.setHeader(header);
int[] aligns = new int[]{0, 0, 1, 1, 2, 2};
pdf.setAligns(aligns);

List<String[]> contentList = Lists.newArrayList();
list.forEach(a ->{
String[] str = new String[6];
str[0] = "";
str[1] = "";
str[2] = "";
str[3] = "";
str[4] = "";
str[5] = "";
contentList.add(str);
});
pdf.setContentList(contentList);

PageSet ps = new PageSet();
ps.setPaperWidth(595.0f);
ps.setPaperHeight(842.0f);
ps.setPrintDirection("1");
ps.setTableTotalWidth(520);
ps.setMarginLeft(50);
ps.setMarginRight(50);
ps.setMarginTop(50);
ps.setMarginBottom(50);
pdf.setPageSet(ps);

PdfUtils.initPdf(response, pdf);
}
}

+ 121
- 0
ruoyi-business/src/main/java/com/ruoyi/business/domain/TResourceLand.java View File

@@ -0,0 +1,121 @@
package com.ruoyi.business.domain;

import java.math.BigDecimal;

import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
* 地块属性对象 t_resource_land
*
* @author yfd
* @date 2025-09-05
*/
@Data
public class TResourceLand extends BaseEntity
{
private static final long serialVersionUID = 1L;

/** fid */
@Excel(name = "fid ")
private Long fid;

/** 标识码 */
@Excel(name = "标识码")
private Integer BSM;

/** 要素代码 */
@Excel(name = "要素代码")
private String YSDM;

/** 地块代码 :14位行政区划代码(村级12位+‘00’,组级14位) + 5位顺序码 */
@Excel(name = "地块代码")
private String DKBM;

/** 地块名称 */
@Excel(name = "地块名称")
private String DKMC;

/** 所有权性质 字典 ownership_type */
@Excel(name = "所有权性质",dictType = "ownership_type")
private String SYQXZ;

/** 地块类别 字典 land_type */
@Excel(name = "地块类别",dictType = "land_type")
private String DKLB;

/** 土地利用类型 字典 land_use */
@Excel(name = "土地利用类型",dictType = "land_use")
private String TDLYLX;

/** 地力等级 字典 land_grade_type */
@Excel(name = "地力等级",dictType = "land_grade_type")
private String DLDJ;

/** 土地用途 字典 land_use_type */
@Excel(name = "土地用途",dictType = "land_use_type")
private String TDYT;

/** 是否基本农田 字典 sys_yes_no */
@Excel(name = "是否基本农田",dictType = "sys_yes_no")
private String SFJBNT;

/** 地块东至 */
@Excel(name = "地块东至")
private String DKDZ;

/** 地块西至 */
@Excel(name = "地块西至")
private String DKXZ;

/** 地块南至 */
@Excel(name = "地块南至")
private String DKNZ;

/** 地块北至 */
@Excel(name = "地块北至")
private String DKBZ;

/** 备注信息 */
@Excel(name = "备注信息")
private String DKBZXX;

/** 指界人姓名 */
@Excel(name = "指界人姓名")
private String ZJRXM;

/** 空间坐标 */
@Excel(name = "空间坐标")
private String KJZB;

/** 实测面积( ㎡) */
@Excel(name = "实测面积( ㎡)")
private BigDecimal SCMJ;

/** 实测面积(亩) */
@Excel(name = "实测面积", readConverterExp = "亩=")
private BigDecimal SCMJM;

/** 地块轮廓坐标 */
@Excel(name = "地块轮廓坐标")
private String theGeom;

/** 调查状态 字典 survey_status */
@Excel(name = "调查状态",dictType = "survey_status")
private String surveyStatus;

/** 部门级联代码 */
@Excel(name = "部门级联代码")
private String importCode;

/** 区域位置名称 */
@Excel(name = "区域位置名称")
private String deptName;

/** 行政区划代码 */
private String orgCode;

}

+ 95
- 0
ruoyi-business/src/main/java/com/ruoyi/business/domain/TResourceOperation.java View File

@@ -0,0 +1,95 @@
package com.ruoyi.business.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
* 地块经营对象 t_resource_operation
*
* @author yfd
* @date 2025-09-05
*/
@Data
public class TResourceOperation extends BaseEntity
{
private static final long serialVersionUID = 1L;

/** id */
private Long id;

/** 地块代码 */
@Excel(name = "地块代码")
private String dkbm;

/** 地块名称 */
@Excel(name = "地块名称")
private String dkmc;

/** 地块东至 */
@Excel(name = "地块东至")
private String dkdz;

/** 地块西至 */
@Excel(name = "地块西至")
private String dkxz;

/** 地块南至 */
@Excel(name = "地块南至")
private String dknz;

/** 地块北至 */
@Excel(name = "地块北至")
private String dkbz;

/** 经营面积(亩) */
@Excel(name = "经营面积(亩)")
private BigDecimal jymj;

/** 经营方式 */
@Excel(name = "经营方式")
private String jyfs;

/** 经营对象名称 */
@Excel(name = "经营对象名称")
private String jydxmc;

/** 经营开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "经营开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date jykssj;

/** 经营结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "经营结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date jyjssj;

/** 承包金额(元) */
@Excel(name = "承包金额(元)")
private BigDecimal cbje;

/** 备注 */
@Excel(name = "备注")
private String bz;

/** 实物图 */
@Excel(name = "实物图")
private String dkImg;

/** 调查状态 字典 survey_status */
@Excel(name = "调查状态 字典 survey_status")
private String surveyStatus;

/** 部门级联代码 */
@Excel(name = "部门级联代码")
private String importCode;

/** 区域位置名称 */
@Excel(name = "区域位置名称")
private String deptName;
}

+ 85
- 0
ruoyi-business/src/main/java/com/ruoyi/business/mapper/TResourceLandMapper.java View File

@@ -0,0 +1,85 @@
package com.ruoyi.business.mapper;

import java.util.List;
import com.ruoyi.business.domain.TResourceLand;

/**
* 地块属性Mapper接口
*
* @author yfd
* @date 2025-09-05
*/
public interface TResourceLandMapper
{
/**
* 查询地块属性
*
* @param DKBM 地块属性主键
* @return 地块属性
*/
public TResourceLand selectTResourceLandByDKBM(String DKBM);

/**
* 查询地块属性列表
*
* @param tResourceLand 地块属性
* @return 地块属性集合
*/
public List<TResourceLand> selectTResourceLandList(TResourceLand tResourceLand);

/**
* 新增地块属性
*
* @param tResourceLand 地块属性
* @return 结果
*/
public int insertTResourceLand(TResourceLand tResourceLand);

/**
* 批量新增地块属性
*
* @param list 地块属性
* @return 结果
*/
public int insertTResourceLandBatch(List<TResourceLand> list);

/**
* 修改地块属性
*
* @param tResourceLand 地块属性
* @return 结果
*/
public int updateTResourceLand(TResourceLand tResourceLand);

/**
* 批量修改 地块属性
*
* @param list 地块属性
* @return 结果
*/
public int updateTResourceLandBatch(List<TResourceLand> list);

/**
* 删除地块属性
*
* @param DKBM 地块属性主键
* @return 结果
*/
public int deleteTResourceLandByDKBM(String DKBM);

/**
* 批量删除地块属性
*
* @param DKBMs 需要删除的数据主键集合
* @return 结果
*/
public int deleteTResourceLandByDKBMs(String[] DKBMs);

/**
* 删除地块属性
*
* @param DKBM 地块属性主键
* @return 结果
*/
public String selectTResourceLandMaxDKBM(String orgCode);
}

+ 77
- 0
ruoyi-business/src/main/java/com/ruoyi/business/mapper/TResourceOperationMapper.java View File

@@ -0,0 +1,77 @@
package com.ruoyi.business.mapper;

import java.util.List;
import com.ruoyi.business.domain.TResourceOperation;

/**
* 地块经营Mapper接口
*
* @author yfd
* @date 2025-09-05
*/
public interface TResourceOperationMapper
{
/**
* 查询地块经营
*
* @param id 地块经营主键
* @return 地块经营
*/
public TResourceOperation selectTResourceOperationById(Long id);

/**
* 查询地块经营列表
*
* @param tResourceOperation 地块经营
* @return 地块经营集合
*/
public List<TResourceOperation> selectTResourceOperationList(TResourceOperation tResourceOperation);

/**
* 新增地块经营
*
* @param tResourceOperation 地块经营
* @return 结果
*/
public int insertTResourceOperation(TResourceOperation tResourceOperation);

/**
* 批量新增地块经营
*
* @param list 地块经营
* @return 结果
*/
public int insertTResourceOperationBatch(List<TResourceOperation> list);

/**
* 修改地块经营
*
* @param tResourceOperation 地块经营
* @return 结果
*/
public int updateTResourceOperation(TResourceOperation tResourceOperation);

/**
* 批量修改 地块经营
*
* @param list 地块经营
* @return 结果
*/
public int updateTResourceOperationBatch(List<TResourceOperation> list);

/**
* 删除地块经营
*
* @param id 地块经营主键
* @return 结果
*/
public int deleteTResourceOperationById(Long id);

/**
* 批量删除地块经营
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteTResourceOperationByIds(Long[] ids);
}

+ 87
- 0
ruoyi-business/src/main/java/com/ruoyi/business/service/ITResourceLandService.java View File

@@ -0,0 +1,87 @@
package com.ruoyi.business.service;

import java.util.List;
import com.ruoyi.business.domain.TResourceLand;

/**
* 地块属性Service接口
*
* @author yfd
* @date 2025-09-05
*/
public interface ITResourceLandService
{
/**
* 查询地块属性
*
* @param DKBM 地块属性主键
* @return 地块属性
*/
public TResourceLand selectTResourceLandByDKBM(String DKBM);

/**
* 查询地块属性列表
*
* @param tResourceLand 地块属性
* @return 地块属性集合
*/
public List<TResourceLand> selectTResourceLandList(TResourceLand tResourceLand);

/**
* 导入地块属性数据
*
* @param list 地块属性数据列表
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
* @param userName 操作用户
* @return 结果
*/
public String importTResourceLand(List<TResourceLand> list, Boolean isUpdateSupport, String userName);

/**
* 新增地块属性
*
* @param tResourceLand 地块属性
* @return 结果
*/
public int insertTResourceLand(TResourceLand tResourceLand);

/**
* 批量新增地块属性
*
* @param list 地块属性
* @return 结果
*/
public int insertTResourceLandBatch(List<TResourceLand> list);

/**
* 修改地块属性
*
* @param tResourceLand 地块属性
* @return 结果
*/
public int updateTResourceLand(TResourceLand tResourceLand);

/**
* 批量修改 地块属性
*
* @param list 地块属性
* @return 结果
*/
public int updateTResourceLandBatch(List<TResourceLand> list);

/**
* 批量删除地块属性
*
* @param DKBMs 需要删除的地块属性主键集合
* @return 结果
*/
public int deleteTResourceLandByDKBMs(String[] DKBMs);

/**
* 删除地块属性信息
*
* @param DKBM 地块属性主键
* @return 结果
*/
public int deleteTResourceLandByDKBM(String DKBM);
}

+ 87
- 0
ruoyi-business/src/main/java/com/ruoyi/business/service/ITResourceOperationService.java View File

@@ -0,0 +1,87 @@
package com.ruoyi.business.service;

import java.util.List;
import com.ruoyi.business.domain.TResourceOperation;

/**
* 地块经营Service接口
*
* @author yfd
* @date 2025-09-05
*/
public interface ITResourceOperationService
{
/**
* 查询地块经营
*
* @param id 地块经营主键
* @return 地块经营
*/
public TResourceOperation selectTResourceOperationById(Long id);

/**
* 查询地块经营列表
*
* @param tResourceOperation 地块经营
* @return 地块经营集合
*/
public List<TResourceOperation> selectTResourceOperationList(TResourceOperation tResourceOperation);

/**
* 导入地块经营数据
*
* @param list 地块经营数据列表
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
* @param userName 操作用户
* @return 结果
*/
public String importTResourceOperation(List<TResourceOperation> list, Boolean isUpdateSupport, String userName);

/**
* 新增地块经营
*
* @param tResourceOperation 地块经营
* @return 结果
*/
public int insertTResourceOperation(TResourceOperation tResourceOperation);

/**
* 批量新增地块经营
*
* @param list 地块经营
* @return 结果
*/
public int insertTResourceOperationBatch(List<TResourceOperation> list);

/**
* 修改地块经营
*
* @param tResourceOperation 地块经营
* @return 结果
*/
public int updateTResourceOperation(TResourceOperation tResourceOperation);

/**
* 批量修改 地块经营
*
* @param list 地块经营
* @return 结果
*/
public int updateTResourceOperationBatch(List<TResourceOperation> list);

/**
* 批量删除地块经营
*
* @param ids 需要删除的地块经营主键集合
* @return 结果
*/
public int deleteTResourceOperationByIds(Long[] ids);

/**
* 删除地块经营信息
*
* @param id 地块经营主键
* @return 结果
*/
public int deleteTResourceOperationById(Long id);
}

+ 235
- 0
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/TResourceLandServiceImpl.java View File

@@ -0,0 +1,235 @@
package com.ruoyi.business.service.impl;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.DateUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.TResourceLandMapper;
import com.ruoyi.business.domain.TResourceLand;
import com.ruoyi.business.service.ITResourceLandService;
import org.springframework.transaction.annotation.Transactional;

/**
* 地块属性Service业务层处理
*
* @author yfd
* @date 2025-09-05
*/
@Service
public class TResourceLandServiceImpl implements ITResourceLandService
{
@Autowired
private TResourceLandMapper tResourceLandMapper;

/**
* 查询地块属性
*
* @param DKBM 地块属性主键
* @return 地块属性
*/
@Override
public TResourceLand selectTResourceLandByDKBM(String DKBM)
{
return tResourceLandMapper.selectTResourceLandByDKBM(DKBM);
}

/**
* 查询地块属性列表
*
* @param tResourceLand 地块属性
* @return 地块属性
*/
@Override
public List<TResourceLand> selectTResourceLandList(TResourceLand tResourceLand)
{
return tResourceLandMapper.selectTResourceLandList(tResourceLand);
}

/**
* 导入地块属性数据
*
* @param list 地块属性数据列表
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
* @param operName 操作用户
* @return 结果
*/
@Override
@Transactional
public String importTResourceLand(List<TResourceLand> list, Boolean isUpdateSupport, String operName) {
if (StringUtils.isEmpty(list)) {
throw new ServiceException("导入地块属性数据不能为空!");
}

int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
List<TResourceLand> insertList = Lists.newArrayList();
List<TResourceLand> updateList = Lists.newArrayList();

// 检验excel表中 【xxx】 是否存在重复,有重复的终止导入
List<String> repeatList = list.stream().collect(Collectors.groupingBy(TResourceLand::getDKBM, Collectors.counting()))
.entrySet().stream().filter(e -> e.getValue() > 1).map(Map.Entry::getKey).collect(Collectors.toList());
if (StringUtils.isNotEmpty(repeatList)) {
failureMsg.insert(0, "很抱歉,存在重复项,导入失败!共 " + repeatList.size() + " 个重复错错误如下:");
for (int i = 0; i < repeatList.size(); i++) {
String item = repeatList.get(i);
failureNum++;
failureMsg.append("<br/>" + failureNum + "、项目名 " + item + " 重复");
}
return failureMsg.toString();
}

// 缓存已存在的数据
TResourceLand tResourceLand = new TResourceLand();
List<TResourceLand> tResourceLandList = tResourceLandMapper.selectTResourceLandList(tResourceLand);

for (TResourceLand item : list) {
// 一定层次上校验并跳过空白行,最好是不空的唯一字段
if(StringUtils.isEmpty(item.getDKBM())){
continue;
}
// 验证是否存在这个地块属性信息
String id = item.getDKBM();
List<TResourceLand> filters = tResourceLandList.stream().filter(a -> a.getDKBM().equals(id)).collect(Collectors.toList());
if (StringUtils.isEmpty(filters)) { //不存在时,直接插入
item.setCreateBy(operName);
item.setCreateTime(DateUtils.getNowDate());
insertList.add(item);
successNum++;
} else { //存在时
if(isUpdateSupport){ //勾选则更新
item.setUpdateBy(operName);
item.setUpdateTime(DateUtils.getNowDate());
item.setDKBM(filters.get(0).getDKBM());
updateList.add(item);
successNum++;
}
}
}

// 执行更新或者保存
List<List<TResourceLand>> insertSplists = ListUtils.partition(insertList, 50);
insertSplists.forEach(insertSplist ->{
tResourceLandMapper.insertTResourceLandBatch(insertSplist);
});
List<List<TResourceLand>> updateSplists = ListUtils.partition(updateList, 30);
updateSplists.forEach(updateSplist ->{
tResourceLandMapper.updateTResourceLandBatch(updateSplist);
});

successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条。");
return successMsg.toString();
}

/**
* 计算地块属性地块代码
*
* @param tResourceLand 地块属性
* @return 结果
*/
public String calculatorDKBM(String orgCode)
{
String DKBM = orgCode;
if(StringUtils.isNotEmpty(DKBM) && DKBM.length() == 12){
DKBM = DKBM + "00";
}
String DKBMMax = tResourceLandMapper.selectTResourceLandMaxDKBM(DKBM);
if(StringUtils.isNotEmpty(DKBMMax)){
DKBM = DKBM + (Integer.parseInt(DKBMMax.substring(DKBMMax.length() - 5)) + 1);
}else {
DKBM = DKBM + "00001";
}
return DKBM;
}

/**
* 新增地块属性
*
* @param tResourceLand 地块属性
* @return 结果
*/
@Override
public int insertTResourceLand(TResourceLand tResourceLand)
{
tResourceLand.setDKBM(calculatorDKBM(tResourceLand.getOrgCode()));
tResourceLand.setCreateTime(DateUtils.getNowDate());
return tResourceLandMapper.insertTResourceLand(tResourceLand);
}

/**
* 批量新增地块属性
*
* @param list 地块属性
* @return 结果
*/
@Override
@Transactional
public int insertTResourceLandBatch(List<TResourceLand> list){
List<List<TResourceLand>> splists = ListUtils.partition(list, 50);
splists.forEach(splist->{
tResourceLandMapper.insertTResourceLandBatch(splist);
});
return 1;
}

/**
* 修改地块属性
*
* @param tResourceLand 地块属性
* @return 结果
*/
@Override
public int updateTResourceLand(TResourceLand tResourceLand)
{
tResourceLand.setUpdateTime(DateUtils.getNowDate());
return tResourceLandMapper.updateTResourceLand(tResourceLand);
}

/**
* 批量修改 地块属性
*
* @param list 地块属性
* @return 结果
*/
@Override
@Transactional
public int updateTResourceLandBatch(List<TResourceLand> list) {
List<List<TResourceLand>> splists = ListUtils.partition(list, 30);
splists.forEach(splist->{
tResourceLandMapper.updateTResourceLandBatch(splist);
});
return 1;
}

/**
* 批量删除地块属性
*
* @param DKBMs 需要删除的地块属性主键
* @return 结果
*/
@Override
public int deleteTResourceLandByDKBMs(String[] DKBMs)
{
return tResourceLandMapper.deleteTResourceLandByDKBMs(DKBMs);
}

/**
* 删除地块属性信息
*
* @param DKBM 地块属性主键
* @return 结果
*/
@Override
public int deleteTResourceLandByDKBM(String DKBM)
{
return tResourceLandMapper.deleteTResourceLandByDKBM(DKBM);
}
}

+ 214
- 0
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/TResourceOperationServiceImpl.java View File

@@ -0,0 +1,214 @@
package com.ruoyi.business.service.impl;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.DateUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.TResourceOperationMapper;
import com.ruoyi.business.domain.TResourceOperation;
import com.ruoyi.business.service.ITResourceOperationService;
import org.springframework.transaction.annotation.Transactional;

/**
* 地块经营Service业务层处理
*
* @author yfd
* @date 2025-09-05
*/
@Service
public class TResourceOperationServiceImpl implements ITResourceOperationService
{
@Autowired
private TResourceOperationMapper tResourceOperationMapper;

/**
* 查询地块经营
*
* @param id 地块经营主键
* @return 地块经营
*/
@Override
public TResourceOperation selectTResourceOperationById(Long id)
{
return tResourceOperationMapper.selectTResourceOperationById(id);
}

/**
* 查询地块经营列表
*
* @param tResourceOperation 地块经营
* @return 地块经营
*/
@Override
public List<TResourceOperation> selectTResourceOperationList(TResourceOperation tResourceOperation)
{
return tResourceOperationMapper.selectTResourceOperationList(tResourceOperation);
}

/**
* 导入地块经营数据
*
* @param list 地块经营数据列表
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
* @param operName 操作用户
* @return 结果
*/
@Override
@Transactional
public String importTResourceOperation(List<TResourceOperation> list, Boolean isUpdateSupport, String operName) {
if (StringUtils.isEmpty(list)) {
throw new ServiceException("导入地块经营数据不能为空!");
}

int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
List<TResourceOperation> insertList = Lists.newArrayList();
List<TResourceOperation> updateList = Lists.newArrayList();

// 检验excel表中 【xxx】 是否存在重复,有重复的终止导入
List<String> repeatList = list.stream().collect(Collectors.groupingBy(TResourceOperation::getDkbm, Collectors.counting()))
.entrySet().stream().filter(e -> e.getValue() > 1).map(Map.Entry::getKey).collect(Collectors.toList());
if (StringUtils.isNotEmpty(repeatList)) {
failureMsg.insert(0, "很抱歉,存在重复项,导入失败!共 " + repeatList.size() + " 个重复错错误如下:");
for (int i = 0; i < repeatList.size(); i++) {
String item = repeatList.get(i);
failureNum++;
failureMsg.append("<br/>" + failureNum + "、项目名 " + item + " 重复");
}
return failureMsg.toString();
}

// 缓存已存在的数据
TResourceOperation tResourceOperation = new TResourceOperation();
List<TResourceOperation> tResourceOperationList = tResourceOperationMapper.selectTResourceOperationList(tResourceOperation);

for (TResourceOperation item : list) {
// 一定层次上校验并跳过空白行,最好是不空的唯一字段
if(StringUtils.isEmpty(item.getDkbm())){
continue;
}
// 验证是否存在这个地块经营信息
Long id = item.getId();
List<TResourceOperation> filters = tResourceOperationList.stream().filter(a -> a.getId().equals(id)).collect(Collectors.toList());
if (StringUtils.isEmpty(filters)) { //不存在时,直接插入
item.setCreateBy(operName);
item.setCreateTime(DateUtils.getNowDate());
insertList.add(item);
successNum++;
} else { //存在时
if(isUpdateSupport){ //勾选则更新
item.setUpdateBy(operName);
item.setUpdateTime(DateUtils.getNowDate());
item.setId(filters.get(0).getId());
updateList.add(item);
successNum++;
}
}
}

// 执行更新或者保存
List<List<TResourceOperation>> insertSplists = ListUtils.partition(insertList, 50);
insertSplists.forEach(insertSplist ->{
tResourceOperationMapper.insertTResourceOperationBatch(insertSplist);
});
List<List<TResourceOperation>> updateSplists = ListUtils.partition(updateList, 30);
updateSplists.forEach(updateSplist ->{
tResourceOperationMapper.updateTResourceOperationBatch(updateSplist);
});

successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条。");
return successMsg.toString();
}


/**
* 新增地块经营
*
* @param tResourceOperation 地块经营
* @return 结果
*/
@Override
public int insertTResourceOperation(TResourceOperation tResourceOperation)
{
tResourceOperation.setCreateTime(DateUtils.getNowDate());
return tResourceOperationMapper.insertTResourceOperation(tResourceOperation);
}

/**
* 批量新增地块经营
*
* @param list 地块经营
* @return 结果
*/
@Override
@Transactional
public int insertTResourceOperationBatch(List<TResourceOperation> list){
List<List<TResourceOperation>> splists = ListUtils.partition(list, 50);
splists.forEach(splist->{
tResourceOperationMapper.insertTResourceOperationBatch(splist);
});
return 1;
}

/**
* 修改地块经营
*
* @param tResourceOperation 地块经营
* @return 结果
*/
@Override
public int updateTResourceOperation(TResourceOperation tResourceOperation)
{
tResourceOperation.setUpdateTime(DateUtils.getNowDate());
return tResourceOperationMapper.updateTResourceOperation(tResourceOperation);
}

/**
* 批量修改 地块经营
*
* @param list 地块经营
* @return 结果
*/
@Override
@Transactional
public int updateTResourceOperationBatch(List<TResourceOperation> list) {
List<List<TResourceOperation>> splists = ListUtils.partition(list, 30);
splists.forEach(splist->{
tResourceOperationMapper.updateTResourceOperationBatch(splist);
});
return 1;
}

/**
* 批量删除地块经营
*
* @param ids 需要删除的地块经营主键
* @return 结果
*/
@Override
public int deleteTResourceOperationByIds(Long[] ids)
{
return tResourceOperationMapper.deleteTResourceOperationByIds(ids);
}

/**
* 删除地块经营信息
*
* @param id 地块经营主键
* @return 结果
*/
@Override
public int deleteTResourceOperationById(Long id)
{
return tResourceOperationMapper.deleteTResourceOperationById(id);
}
}

+ 293
- 0
ruoyi-business/src/main/resources/mapper/business/TResourceLandMapper.xml View File

@@ -0,0 +1,293 @@
<?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.business.mapper.TResourceLandMapper">

<resultMap type="TResourceLand" id="TResourceLandResult">
<result property="fid" column="fid" />
<result property="BSM" column="BSM" />
<result property="YSDM" column="YSDM" />
<result property="DKBM" column="DKBM" />
<result property="DKMC" column="DKMC" />
<result property="SYQXZ" column="SYQXZ" />
<result property="DKLB" column="DKLB" />
<result property="TDLYLX" column="TDLYLX" />
<result property="DLDJ" column="DLDJ" />
<result property="TDYT" column="TDYT" />
<result property="SFJBNT" column="SFJBNT" />
<result property="DKDZ" column="DKDZ" />
<result property="DKXZ" column="DKXZ" />
<result property="DKNZ" column="DKNZ" />
<result property="DKBZ" column="DKBZ" />
<result property="DKBZXX" column="DKBZXX" />
<result property="ZJRXM" column="ZJRXM" />
<result property="KJZB" column="KJZB" />
<result property="SCMJ" column="SCMJ" />
<result property="SCMJM" column="SCMJM" />
<result property="theGeom" column="the_geom" />
<result property="surveyStatus" column="survey_status" />
<result property="importCode" column="import_code" />
<result property="deptName" column="dept_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>

<sql id="selectTResourceLandVo">
select fid, BSM, YSDM, DKBM, DKMC, SYQXZ, DKLB, TDLYLX, DLDJ, TDYT, SFJBNT, DKDZ, DKXZ, DKNZ, DKBZ, DKBZXX, ZJRXM, KJZB, SCMJ, SCMJM, the_geom, survey_status, import_code, dept_name, create_by, create_time, update_by, update_time from t_resource_land
</sql>

<select id="selectTResourceLandList" parameterType="TResourceLand" resultMap="TResourceLandResult">
<include refid="selectTResourceLandVo"/>
<where>
<if test="fid != null "> and fid = #{fid}</if>
<if test="BSM != null "> and BSM = #{BSM}</if>
<if test="YSDM != null and YSDM != ''"> and YSDM = #{YSDM}</if>
<if test="DKBM != null and DKBM != ''"> and DKBM = #{DKBM}</if>
<if test="DKMC != null and DKMC != ''"> and DKMC = #{DKMC}</if>
<if test="SYQXZ != null and SYQXZ != ''"> and SYQXZ = #{SYQXZ}</if>
<if test="DKLB != null and DKLB != ''"> and DKLB = #{DKLB}</if>
<if test="TDLYLX != null and TDLYLX != ''"> and TDLYLX = #{TDLYLX}</if>
<if test="DLDJ != null and DLDJ != ''"> and DLDJ = #{DLDJ}</if>
<if test="TDYT != null and TDYT != ''"> and TDYT = #{TDYT}</if>
<if test="SFJBNT != null and SFJBNT != ''"> and SFJBNT = #{SFJBNT}</if>
<if test="DKDZ != null and DKDZ != ''"> and DKDZ = #{DKDZ}</if>
<if test="DKXZ != null and DKXZ != ''"> and DKXZ = #{DKXZ}</if>
<if test="DKNZ != null and DKNZ != ''"> and DKNZ = #{DKNZ}</if>
<if test="DKBZ != null and DKBZ != ''"> and DKBZ = #{DKBZ}</if>
<if test="DKBZXX != null and DKBZXX != ''"> and DKBZXX = #{DKBZXX}</if>
<if test="ZJRXM != null and ZJRXM != ''"> and ZJRXM = #{ZJRXM}</if>
<if test="KJZB != null and KJZB != ''"> and KJZB = #{KJZB}</if>
<if test="SCMJ != null "> and SCMJ = #{SCMJ}</if>
<if test="SCMJM != null "> and SCMJM = #{SCMJM}</if>
<if test="theGeom != null and theGeom != ''"> and the_geom = #{theGeom}</if>
<if test="surveyStatus != null and surveyStatus != ''"> and survey_status = #{surveyStatus}</if>
<if test="importCode != null and importCode != ''"> and import_code = #{importCode}</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
</where>
</select>

<select id="selectTResourceLandByDKBM" parameterType="String" resultMap="TResourceLandResult">
<include refid="selectTResourceLandVo"/>
where DKBM = #{DKBM}
</select>

<insert id="insertTResourceLand" parameterType="TResourceLand">
insert into t_resource_land
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fid != null">fid,</if>
<if test="BSM != null">BSM,</if>
<if test="YSDM != null">YSDM,</if>
<if test="DKBM != null">DKBM,</if>
<if test="DKMC != null and DKMC != ''">DKMC,</if>
<if test="SYQXZ != null">SYQXZ,</if>
<if test="DKLB != null">DKLB,</if>
<if test="TDLYLX != null">TDLYLX,</if>
<if test="DLDJ != null">DLDJ,</if>
<if test="TDYT != null">TDYT,</if>
<if test="SFJBNT != null">SFJBNT,</if>
<if test="DKDZ != null">DKDZ,</if>
<if test="DKXZ != null">DKXZ,</if>
<if test="DKNZ != null">DKNZ,</if>
<if test="DKBZ != null">DKBZ,</if>
<if test="DKBZXX != null">DKBZXX,</if>
<if test="ZJRXM != null">ZJRXM,</if>
<if test="KJZB != null">KJZB,</if>
<if test="SCMJ != null">SCMJ,</if>
<if test="SCMJM != null">SCMJM,</if>
<if test="theGeom != null">the_geom,</if>
<if test="surveyStatus != null and surveyStatus != ''">survey_status,</if>
<if test="importCode != null and importCode != ''">import_code,</if>
<if test="deptName != null">dept_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fid != null">#{fid},</if>
<if test="BSM != null">#{BSM},</if>
<if test="YSDM != null">#{YSDM},</if>
<if test="DKBM != null">#{DKBM},</if>
<if test="DKMC != null and DKMC != ''">#{DKMC},</if>
<if test="SYQXZ != null">#{SYQXZ},</if>
<if test="DKLB != null">#{DKLB},</if>
<if test="TDLYLX != null">#{TDLYLX},</if>
<if test="DLDJ != null">#{DLDJ},</if>
<if test="TDYT != null">#{TDYT},</if>
<if test="SFJBNT != null">#{SFJBNT},</if>
<if test="DKDZ != null">#{DKDZ},</if>
<if test="DKXZ != null">#{DKXZ},</if>
<if test="DKNZ != null">#{DKNZ},</if>
<if test="DKBZ != null">#{DKBZ},</if>
<if test="DKBZXX != null">#{DKBZXX},</if>
<if test="ZJRXM != null">#{ZJRXM},</if>
<if test="KJZB != null">#{KJZB},</if>
<if test="SCMJ != null">#{SCMJ},</if>
<if test="SCMJM != null">#{SCMJM},</if>
<if test="theGeom != null">#{theGeom},</if>
<if test="surveyStatus != null and surveyStatus != ''">#{surveyStatus},</if>
<if test="importCode != null and importCode != ''">#{importCode},</if>
<if test="deptName != null">#{deptName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>

<insert id="insertTResourceLandBatch" parameterType="list" >
insert into t_resource_land
<trim prefix="(" suffix=")" suffixOverrides=",">
fid,
BSM,
YSDM,
DKBM,
DKMC,
SYQXZ,
DKLB,
TDLYLX,
DLDJ,
TDYT,
SFJBNT,
DKDZ,
DKXZ,
DKNZ,
DKBZ,
DKBZXX,
ZJRXM,
KJZB,
SCMJ,
SCMJM,
the_geom,
survey_status,
import_code,
dept_name,
create_by,
create_time,
update_by,
update_time,
</trim>
values
<foreach item="item" collection="list" separator="," >
<trim prefix="(" suffix=")" suffixOverrides=",">
#{item.fid},
#{item.BSM},
#{item.YSDM},
#{item.DKBM},
#{item.DKMC},
#{item.SYQXZ},
#{item.DKLB},
#{item.TDLYLX},
#{item.DLDJ},
#{item.TDYT},
#{item.SFJBNT},
#{item.DKDZ},
#{item.DKXZ},
#{item.DKNZ},
#{item.DKBZ},
#{item.DKBZXX},
#{item.ZJRXM},
#{item.KJZB},
#{item.SCMJ},
#{item.SCMJM},
#{item.theGeom},
#{item.surveyStatus},
#{item.importCode},
#{item.deptName},
#{item.createBy},
#{item.createTime},
#{item.updateBy},
#{item.updateTime},
</trim>
</foreach>
</insert>

<update id="updateTResourceLand" parameterType="TResourceLand">
update t_resource_land
<trim prefix="SET" suffixOverrides=",">
<if test="fid != null">fid = #{fid},</if>
<if test="BSM != null">BSM = #{BSM},</if>
<if test="YSDM != null">YSDM = #{YSDM},</if>
<if test="DKMC != null and DKMC != ''">DKMC = #{DKMC},</if>
<if test="SYQXZ != null">SYQXZ = #{SYQXZ},</if>
<if test="DKLB != null">DKLB = #{DKLB},</if>
<if test="TDLYLX != null">TDLYLX = #{TDLYLX},</if>
<if test="DLDJ != null">DLDJ = #{DLDJ},</if>
<if test="TDYT != null">TDYT = #{TDYT},</if>
<if test="SFJBNT != null">SFJBNT = #{SFJBNT},</if>
<if test="DKDZ != null">DKDZ = #{DKDZ},</if>
<if test="DKXZ != null">DKXZ = #{DKXZ},</if>
<if test="DKNZ != null">DKNZ = #{DKNZ},</if>
<if test="DKBZ != null">DKBZ = #{DKBZ},</if>
<if test="DKBZXX != null">DKBZXX = #{DKBZXX},</if>
<if test="ZJRXM != null">ZJRXM = #{ZJRXM},</if>
<if test="KJZB != null">KJZB = #{KJZB},</if>
<if test="SCMJ != null">SCMJ = #{SCMJ},</if>
<if test="SCMJM != null">SCMJM = #{SCMJM},</if>
<if test="theGeom != null">the_geom = #{theGeom},</if>
<if test="surveyStatus != null and surveyStatus != ''">survey_status = #{surveyStatus},</if>
<if test="importCode != null and importCode != ''">import_code = #{importCode},</if>
<if test="deptName != null">dept_name = #{deptName},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where DKBM = #{DKBM}
</update>

<!--批量更新-->
<update id="updateTResourceLandBatch" parameterType="list" >
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update t_resource_land
<set>
<if test="item.fid != null">fid = #{item.fid},</if>
<if test="item.BSM != null">BSM = #{item.BSM},</if>
<if test="item.YSDM != null">YSDM = #{item.YSDM},</if>
<if test="item.DKMC != null and item.DKMC != ''">DKMC = #{item.DKMC},</if>
<if test="item.SYQXZ != null">SYQXZ = #{item.SYQXZ},</if>
<if test="item.DKLB != null">DKLB = #{item.DKLB},</if>
<if test="item.TDLYLX != null">TDLYLX = #{item.TDLYLX},</if>
<if test="item.DLDJ != null">DLDJ = #{item.DLDJ},</if>
<if test="item.TDYT != null">TDYT = #{item.TDYT},</if>
<if test="item.SFJBNT != null">SFJBNT = #{item.SFJBNT},</if>
<if test="item.DKDZ != null">DKDZ = #{item.DKDZ},</if>
<if test="item.DKXZ != null">DKXZ = #{item.DKXZ},</if>
<if test="item.DKNZ != null">DKNZ = #{item.DKNZ},</if>
<if test="item.DKBZ != null">DKBZ = #{item.DKBZ},</if>
<if test="item.DKBZXX != null">DKBZXX = #{item.DKBZXX},</if>
<if test="item.ZJRXM != null">ZJRXM = #{item.ZJRXM},</if>
<if test="item.KJZB != null">KJZB = #{item.KJZB},</if>
<if test="item.SCMJ != null">SCMJ = #{item.SCMJ},</if>
<if test="item.SCMJM != null">SCMJM = #{item.SCMJM},</if>
<if test="item.theGeom != null">the_geom = #{item.theGeom},</if>
<if test="item.surveyStatus != null and item.surveyStatus != ''">survey_status = #{item.surveyStatus},</if>
<if test="item.importCode != null and item.importCode != ''">import_code = #{item.importCode},</if>
<if test="item.deptName != null">dept_name = #{item.deptName},</if>
<if test="item.createBy != null">create_by = #{item.createBy},</if>
<if test="item.createTime != null">create_time = #{item.createTime},</if>
<if test="item.updateBy != null">update_by = #{item.updateBy},</if>
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
</set>
where DKBM = #{item.DKBM}
</foreach>
</update>

<delete id="deleteTResourceLandByDKBM" parameterType="String">
delete from t_resource_land where DKBM = #{DKBM}
</delete>

<delete id="deleteTResourceLandByDKBMs" parameterType="String">
delete from t_resource_land where DKBM in
<foreach item="DKBM" collection="array" open="(" separator="," close=")">
#{DKBM}
</foreach>
</delete>

<select id="selectTResourceLandMaxDKBM" parameterType="String">
select max(DKBM) from t_resource_land where DKBM like concat(#{orgCode}, '%')
</select>
</mapper>

+ 236
- 0
ruoyi-business/src/main/resources/mapper/business/TResourceOperationMapper.xml View File

@@ -0,0 +1,236 @@
<?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.business.mapper.TResourceOperationMapper">

<resultMap type="TResourceOperation" id="TResourceOperationResult">
<result property="id" column="id" />
<result property="dkbm" column="dkbm" />
<result property="dkmc" column="dkmc" />
<result property="dkdz" column="dkdz" />
<result property="dkxz" column="dkxz" />
<result property="dknz" column="dknz" />
<result property="dkbz" column="dkbz" />
<result property="jymj" column="jymj" />
<result property="jyfs" column="jyfs" />
<result property="jydxmc" column="jydxmc" />
<result property="jykssj" column="jykssj" />
<result property="jyjssj" column="jyjssj" />
<result property="cbje" column="cbje" />
<result property="bz" column="bz" />
<result property="dkImg" column="dk_img" />
<result property="surveyStatus" column="survey_status" />
<result property="importCode" column="import_code" />
<result property="deptName" column="dept_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>

<sql id="selectTResourceOperationVo">
select id, dkbm, dkmc, dkdz, dkxz, dknz, dkbz, jymj, jyfs, jydxmc, jykssj, jyjssj, cbje, bz, dk_img, survey_status, import_code, dept_name, create_by, create_time, update_by, update_time from t_resource_operation
</sql>

<select id="selectTResourceOperationList" parameterType="TResourceOperation" resultMap="TResourceOperationResult">
<include refid="selectTResourceOperationVo"/>
<where>
<if test="dkbm != null and dkbm != ''"> and dkbm = #{dkbm}</if>
<if test="dkmc != null and dkmc != ''"> and dkmc = #{dkmc}</if>
<if test="dkdz != null and dkdz != ''"> and dkdz = #{dkdz}</if>
<if test="dkxz != null and dkxz != ''"> and dkxz = #{dkxz}</if>
<if test="dknz != null and dknz != ''"> and dknz = #{dknz}</if>
<if test="dkbz != null and dkbz != ''"> and dkbz = #{dkbz}</if>
<if test="jymj != null "> and jymj = #{jymj}</if>
<if test="jyfs != null and jyfs != ''"> and jyfs = #{jyfs}</if>
<if test="jydxmc != null and jydxmc != ''"> and jydxmc = #{jydxmc}</if>
<if test="jykssj != null "> and jykssj = #{jykssj}</if>
<if test="jyjssj != null "> and jyjssj = #{jyjssj}</if>
<if test="cbje != null "> and cbje = #{cbje}</if>
<if test="bz != null and bz != ''"> and bz = #{bz}</if>
<if test="dkImg != null and dkImg != ''"> and dk_img = #{dkImg}</if>
<if test="surveyStatus != null and surveyStatus != ''"> and survey_status = #{surveyStatus}</if>
<if test="importCode != null and importCode != ''"> and import_code = #{importCode}</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
</where>
</select>

<select id="selectTResourceOperationById" parameterType="Long" resultMap="TResourceOperationResult">
<include refid="selectTResourceOperationVo"/>
where id = #{id}
</select>

<insert id="insertTResourceOperation" parameterType="TResourceOperation" useGeneratedKeys="true" keyProperty="id">
insert into t_resource_operation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dkbm != null">dkbm,</if>
<if test="dkmc != null and dkmc != ''">dkmc,</if>
<if test="dkdz != null">dkdz,</if>
<if test="dkxz != null">dkxz,</if>
<if test="dknz != null">dknz,</if>
<if test="dkbz != null">dkbz,</if>
<if test="jymj != null">jymj,</if>
<if test="jyfs != null">jyfs,</if>
<if test="jydxmc != null">jydxmc,</if>
<if test="jykssj != null">jykssj,</if>
<if test="jyjssj != null">jyjssj,</if>
<if test="cbje != null">cbje,</if>
<if test="bz != null">bz,</if>
<if test="dkImg != null">dk_img,</if>
<if test="surveyStatus != null and surveyStatus != ''">survey_status,</if>
<if test="importCode != null and importCode != ''">import_code,</if>
<if test="deptName != null">dept_name,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dkbm != null">#{dkbm},</if>
<if test="dkmc != null and dkmc != ''">#{dkmc},</if>
<if test="dkdz != null">#{dkdz},</if>
<if test="dkxz != null">#{dkxz},</if>
<if test="dknz != null">#{dknz},</if>
<if test="dkbz != null">#{dkbz},</if>
<if test="jymj != null">#{jymj},</if>
<if test="jyfs != null">#{jyfs},</if>
<if test="jydxmc != null">#{jydxmc},</if>
<if test="jykssj != null">#{jykssj},</if>
<if test="jyjssj != null">#{jyjssj},</if>
<if test="cbje != null">#{cbje},</if>
<if test="bz != null">#{bz},</if>
<if test="dkImg != null">#{dkImg},</if>
<if test="surveyStatus != null and surveyStatus != ''">#{surveyStatus},</if>
<if test="importCode != null and importCode != ''">#{importCode},</if>
<if test="deptName != null">#{deptName},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>

<insert id="insertTResourceOperationBatch" parameterType="list" useGeneratedKeys="true" keyProperty="id">
insert into t_resource_operation
<trim prefix="(" suffix=")" suffixOverrides=",">
dkbm,
dkmc,
dkdz,
dkxz,
dknz,
dkbz,
jymj,
jyfs,
jydxmc,
jykssj,
jyjssj,
cbje,
bz,
dk_img,
survey_status,
import_code,
dept_name,
create_by,
create_time,
update_by,
update_time,
</trim>
values
<foreach item="item" collection="list" separator="," >
<trim prefix="(" suffix=")" suffixOverrides=",">
#{item.dkbm},
#{item.dkmc},
#{item.dkdz},
#{item.dkxz},
#{item.dknz},
#{item.dkbz},
#{item.jymj},
#{item.jyfs},
#{item.jydxmc},
#{item.jykssj},
#{item.jyjssj},
#{item.cbje},
#{item.bz},
#{item.dkImg},
#{item.surveyStatus},
#{item.importCode},
#{item.deptName},
#{item.createBy},
#{item.createTime},
#{item.updateBy},
#{item.updateTime},
</trim>
</foreach>
</insert>

<update id="updateTResourceOperation" parameterType="TResourceOperation">
update t_resource_operation
<trim prefix="SET" suffixOverrides=",">
<if test="dkbm != null">dkbm = #{dkbm},</if>
<if test="dkmc != null and dkmc != ''">dkmc = #{dkmc},</if>
<if test="dkdz != null">dkdz = #{dkdz},</if>
<if test="dkxz != null">dkxz = #{dkxz},</if>
<if test="dknz != null">dknz = #{dknz},</if>
<if test="dkbz != null">dkbz = #{dkbz},</if>
<if test="jymj != null">jymj = #{jymj},</if>
<if test="jyfs != null">jyfs = #{jyfs},</if>
<if test="jydxmc != null">jydxmc = #{jydxmc},</if>
<if test="jykssj != null">jykssj = #{jykssj},</if>
<if test="jyjssj != null">jyjssj = #{jyjssj},</if>
<if test="cbje != null">cbje = #{cbje},</if>
<if test="bz != null">bz = #{bz},</if>
<if test="dkImg != null">dk_img = #{dkImg},</if>
<if test="surveyStatus != null and surveyStatus != ''">survey_status = #{surveyStatus},</if>
<if test="importCode != null and importCode != ''">import_code = #{importCode},</if>
<if test="deptName != null">dept_name = #{deptName},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>

<!--批量更新-->
<update id="updateTResourceOperationBatch" parameterType="list" >
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update t_resource_operation
<set>
<if test="item.dkbm != null">dkbm = #{item.dkbm},</if>
<if test="item.dkmc != null and item.dkmc != ''">dkmc = #{item.dkmc},</if>
<if test="item.dkdz != null">dkdz = #{item.dkdz},</if>
<if test="item.dkxz != null">dkxz = #{item.dkxz},</if>
<if test="item.dknz != null">dknz = #{item.dknz},</if>
<if test="item.dkbz != null">dkbz = #{item.dkbz},</if>
<if test="item.jymj != null">jymj = #{item.jymj},</if>
<if test="item.jyfs != null">jyfs = #{item.jyfs},</if>
<if test="item.jydxmc != null">jydxmc = #{item.jydxmc},</if>
<if test="item.jykssj != null">jykssj = #{item.jykssj},</if>
<if test="item.jyjssj != null">jyjssj = #{item.jyjssj},</if>
<if test="item.cbje != null">cbje = #{item.cbje},</if>
<if test="item.bz != null">bz = #{item.bz},</if>
<if test="item.dkImg != null">dk_img = #{item.dkImg},</if>
<if test="item.surveyStatus != null and item.surveyStatus != ''">survey_status = #{item.surveyStatus},</if>
<if test="item.importCode != null and item.importCode != ''">import_code = #{item.importCode},</if>
<if test="item.deptName != null">dept_name = #{item.deptName},</if>
<if test="item.createBy != null and item.createBy != ''">create_by = #{item.createBy},</if>
<if test="item.createTime != null">create_time = #{item.createTime},</if>
<if test="item.updateBy != null">update_by = #{item.updateBy},</if>
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
</set>
where id = #{item.id}
</foreach>
</update>

<delete id="deleteTResourceOperationById" parameterType="Long">
delete from t_resource_operation where id = #{id}
</delete>

<delete id="deleteTResourceOperationByIds" parameterType="String">
delete from t_resource_operation where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

Loading…
Cancel
Save