Commit bf008b72 by jiang'yun

修改

parent 5bfd138c
......@@ -48,6 +48,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- SpringBoot 测试 -->
......@@ -233,6 +234,35 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.16</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>2.0.25</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
</dependency>
</dependencies>
<build>
......
package com.ruoyi.framework.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
public class JsonToMarkdown {
/**
* 将JSON字符串转换为Markdown格式
*/
public static String convert(String jsonString) {
try {
Object json = JSON.parse(jsonString);
if (json instanceof JSONObject) {
return processObject((JSONObject) json, 0);
} else if (json instanceof JSONArray) {
return processArray((JSONArray) json, 0);
}
} catch (Exception e) {
e.printStackTrace();
}
return "Invalid JSON format";
}
private static String processObject(JSONObject obj, int level) {
StringBuilder markdown = new StringBuilder();
// 检查是否适合用表格展示
boolean useTable = shouldUseTable(obj);
if (useTable && level == 0) {
// 根级简单对象使用表格
markdown.append("| Key | Value |\n");
markdown.append("| --- | --- |\n");
for (String key : obj.keySet()) {
Object value = obj.get(key);
markdown.append("| ")
.append(escapeMarkdown(key))
.append(" | ")
.append(formatValue(value, level + 1))
.append(" |\n");
}
} else {
// 使用列表格式
for (String key : obj.keySet()) {
Object value = obj.get(key);
addIndent(markdown, level);
markdown.append("- **")
.append(escapeMarkdown(key))
.append("**: ");
if (value instanceof JSONObject) {
markdown.append("\n").append(processObject((JSONObject) value, level + 1));
} else if (value instanceof JSONArray) {
markdown.append("\n").append(processArray((JSONArray) value, level + 1));
} else {
markdown.append(escapeMarkdown(String.valueOf(value))).append("\n");
}
}
}
return markdown.toString();
}
private static String processArray(JSONArray arr, int level) {
StringBuilder markdown = new StringBuilder();
for (int i = 0; i < arr.size(); i++) {
Object value = arr.get(i);
addIndent(markdown, level);
markdown.append("- ");
if (value instanceof JSONObject) {
markdown.append("Object:\n").append(processObject((JSONObject) value, level + 1));
} else if (value instanceof JSONArray) {
markdown.append("Array:\n").append(processArray((JSONArray) value, level + 1));
} else {
markdown.append(escapeMarkdown(String.valueOf(value))).append("\n");
}
}
return markdown.toString();
}
private static String formatValue(Object value, int level) {
if (value instanceof JSONObject) {
return processObject((JSONObject) value, level);
} else if (value instanceof JSONArray) {
return processArray((JSONArray) value, level);
} else {
return escapeMarkdown(String.valueOf(value));
}
}
private static boolean shouldUseTable(JSONObject obj) {
if (obj.isEmpty()) return false;
for (String key : obj.keySet()) {
Object value = obj.get(key);
if (value instanceof JSONObject || value instanceof JSONArray) {
return false;
}
}
return true;
}
private static void addIndent(StringBuilder sb, int level) {
for (int i = 0; i < level; i++) {
sb.append(" ");
}
}
private static String escapeMarkdown(String text) {
if (text == null) return "";
// 转义Markdown特殊字符
return text.replace("|", "\\|")
.replace("*", "\\*")
.replace("_", "\\_")
.replace("#", "\\#")
.replace("`", "\\`");
}
// 使用示例
public static void main(String[] args) {
String json = "{\"name\":\"John\",\"age\":30,\"hobbies\":[\"reading\",\"swimming\"],\"address\":{\"city\":\"New York\",\"zip\":\"10001\"}}";
String markdown = convert(json);
System.out.println(markdown);
}
}
\ No newline at end of file
......@@ -23,6 +23,8 @@ public class AjaxResult extends HashMap<String, Object>
/** 数据对象 */
public static final String DATA_TAG = "data";
public static final String ZDSM_TAG = "ZDSM";
/**
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
*/
......@@ -60,6 +62,28 @@ public class AjaxResult extends HashMap<String, Object>
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param code 状态码
* @param msg 返回内容
* @param data 数据对象
*/
public AjaxResult(int code, String msg, Object data,Object ZDSM)
{
super.put(CODE_TAG, code);
super.put(MSG_TAG, msg);
if (StringUtils.isNotNull(data))
{
super.put(DATA_TAG, data);
}
if (StringUtils.isNotNull(ZDSM))
{
super.put(ZDSM_TAG, ZDSM);
}
}
/**
* 返回成功消息
*
* @return 成功消息
......@@ -101,6 +125,26 @@ public class AjaxResult extends HashMap<String, Object>
{
return new AjaxResult(HttpStatus.SUCCESS, msg, data);
}
/**
* 返回成功消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 成功消息
*/
public static AjaxResult success(String msg, Object data,Object ZDSM)
{
return new AjaxResult(HttpStatus.SUCCESS, msg, data, ZDSM);
}
/**
* 返回成功数据
*
* @return 成功消息
*/
public static AjaxResult success(Object data,Object ZDSM)
{
return AjaxResult.success("操作成功", data, ZDSM);
}
/**
* 返回警告消息
......
package com.ruoyi.project.zjsgfa.controller;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.utils.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.zjsgfa.domain.SjDjjc;
import com.ruoyi.project.zjsgfa.service.ISjDjjcService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 设计信息-井基础信息Controller
*
* @author ruoyi
* @date 2025-06-23
*/
@RestController
@RequestMapping("/designInformation/sjDjjc")
public class SjDjjcController extends BaseController
{
@Autowired
private ISjDjjcService sjDjjcService;
/**
* 查询设计信息-井基础信息列表
*/
@PreAuthorize("@ss.hasPermi('designInformation:sjDjjc:list')")
@GetMapping("/list")
public TableDataInfo list(SjDjjc sjDjjc)
{
startPage();
List<SjDjjc> list = sjDjjcService.selectSjDjjcList(sjDjjc);
return getDataTable(list);
}
/**
* 获取井号下拉框
* @param sjDjjc
* @return
*/
@GetMapping("/selectList")
public AjaxResult selectList(SjDjjc sjDjjc)
{
List<SjDjjc> list = sjDjjcService.selectSjDjjcList(sjDjjc);
return AjaxResult.success(list);
}
/**
* 导出设计信息-井基础信息列表
*/
@PreAuthorize("@ss.hasPermi('designInformation:sjDjjc:export')")
@Log(title = "设计信息-井基础信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SjDjjc sjDjjc)
{
List<SjDjjc> list = sjDjjcService.selectSjDjjcList(sjDjjc);
ExcelUtil<SjDjjc> util = new ExcelUtil<SjDjjc>(SjDjjc.class);
util.exportExcel(response, list, "设计信息-井基础信息数据");
}
/**
* 获取设计信息-井基础信息详细信息
*/
@PreAuthorize("@ss.hasPermi('designInformation:sjDjjc:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sjDjjcService.selectSjDjjcById(id));
}
/**
* 新增设计信息-井基础信息
*/
@PreAuthorize("@ss.hasPermi('designInformation:sjDjjc:add')")
@Log(title = "设计信息-井基础信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SjDjjc sjDjjc)
{
return toAjax(sjDjjcService.insertSjDjjc(sjDjjc));
}
/**
* 修改设计信息-井基础信息
*/
@PreAuthorize("@ss.hasPermi('designInformation:sjDjjc:edit')")
@Log(title = "设计信息-井基础信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SjDjjc sjDjjc)
{
return toAjax(sjDjjcService.updateSjDjjc(sjDjjc));
}
/**
* 删除设计信息-井基础信息
*/
@PreAuthorize("@ss.hasPermi('designInformation:sjDjjc:remove')")
@Log(title = "设计信息-井基础信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sjDjjcService.deleteSjDjjcByIds(ids));
}
/**
* 下载导入模板
*/
@RequestMapping(value = "/downdrmb", method = {RequestMethod.GET, RequestMethod.POST})
public void export(HttpServletResponse response)throws IOException {
Workbook exl = null;
OutputStream out = null;
InputStream in = null;
try {
in =this.getClass().getResourceAsStream("/static/excel/sjdjjcdrmb.xlsx");
exl = WorkbookFactory.create(in);
out = response.getOutputStream();
response.reset();
String filename = URLEncoder.encode("导入模板.xlsx", "UTF-8");
response.setCharacterEncoding("UTF-8");
response.setHeader("Content-Disposition", "attachment;filename=" + filename);
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
Sheet sheet = exl.getSheet("Sheet1");
CellStyle cellStyle = exl.createCellStyle();
cellStyle.setAlignment(HorizontalAlignment.CENTER);
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle.setBorderBottom(BorderStyle.THIN); //下边框
cellStyle.setBorderLeft(BorderStyle.THIN);//左边框
cellStyle.setBorderTop(BorderStyle.THIN);//上边框
cellStyle.setBorderRight(BorderStyle.THIN);//右边框
cellStyle.setBottomBorderColor(IndexedColors.BLACK.getIndex());
cellStyle.setLeftBorderColor(IndexedColors.BLACK.getIndex());
cellStyle.setRightBorderColor(IndexedColors.BLACK.getIndex());
cellStyle.setTopBorderColor(IndexedColors.BLACK.getIndex());
Font cellFont = exl.createFont();
cellFont.setFontHeightInPoints((short)9); // 字体大小
cellFont.setFontName("宋体"); // 字体应用到当前单元格上
cellStyle.setFont(cellFont);
cellStyle.setWrapText(true);//设置自动换行
exl.write(out);
exl.close();
}catch (Exception e){
e.getMessage();
throw new IOException();
}finally{
if (exl != null) {
try {
exl.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
if (out != null) {
try {
out.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}
/**
* 导入数据
*/
@PreAuthorize("@ss.hasPermi('designInformation:sjDjjc:importData')")
@PostMapping("/importData")
@ResponseBody
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
XSSFWorkbook workbook = null;
try {
//装载流
workbook = new XSSFWorkbook(file.getInputStream());
// 获取一个工作表,下标从0开始
XSSFSheet sheet = workbook.getSheetAt(0);
int lastRowNum = sheet.getLastRowNum();
// 通过循环,逐行取出表中每行数据
for(int i=0;i<=lastRowNum;i++){//跳过第一行
if(i==0){
continue;
}
// 获取行
XSSFRow row = sheet.getRow(i);
System.out.println(row);
SjDjjc info=new SjDjjc();
String jh=new DataFormatter().formatCellValue(row.getCell(0));
if(StringUtils.isEmpty(jh)){
return AjaxResult.error("第"+(i+1)+"行井号不能为空");
}
info.setJh(jh);
String jb=new DataFormatter().formatCellValue(row.getCell(1));
if(StringUtils.isEmpty(jb)){
return AjaxResult.error("第"+(i+1)+"行井别不能为空");
}
info.setJb(jb);
String jx=new DataFormatter().formatCellValue(row.getCell(2));
if(StringUtils.isEmpty(jx)){
return AjaxResult.error("第"+(i+1)+"行井型不能为空");
}
info.setJx(jx);
String jkhzb=new DataFormatter().formatCellValue(row.getCell(3));
if(StringUtils.isEmpty(jkhzb)){
return AjaxResult.error("第"+(i+1)+"行井口横坐标不能为空");
}
info.setJkhzb(Double.parseDouble(jkhzb));
String jkzzb=new DataFormatter().formatCellValue(row.getCell(4));
if(StringUtils.isEmpty(jkzzb)){
return AjaxResult.error("第"+(i+1)+"行井口纵坐标不能为空");
}
info.setJkzzb(Double.parseDouble(jkzzb));
String gzwz=new DataFormatter().formatCellValue(row.getCell(5));
info.setGzwz(gzwz);
String wzcw=new DataFormatter().formatCellValue(row.getCell(6));
info.setWzcw(wzcw);
String ztmd=new DataFormatter().formatCellValue(row.getCell(7));
info.setZtmd(ztmd);
String wzyz=new DataFormatter().formatCellValue(row.getCell(8));
info.setWzyz(wzyz);
String wjff=new DataFormatter().formatCellValue(row.getCell(9));
info.setWjfa(wjff);
sjDjjcService.insertSjDjjc(info);
}
} catch (IOException e) {
e.getMessage();
e.printStackTrace();
throw new Exception("导入Excel失败,请联系网站管理员!");
} finally {
workbook.close();
}
return AjaxResult.success("导入成功");
}
}
package com.ruoyi.project.zjsgfa.controller;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSONObject;
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.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.zjsgfa.domain.SjJsjg;
import com.ruoyi.project.zjsgfa.service.ISjJsjgService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 设计信息-井身结构Controller
*
* @author ruoyi
* @date 2025-06-24
*/
@RestController
@RequestMapping("/system/sjJsjg")
public class SjJsjgController extends BaseController
{
@Autowired
private ISjJsjgService sjJsjgService;
/**
* 查询设计信息-井身结构列表
*/
@PreAuthorize("@ss.hasPermi('system:sjJsjg:list')")
@GetMapping("/list")
public TableDataInfo list(SjJsjg sjJsjg)
{
startPage();
List<SjJsjg> list = sjJsjgService.selectSjJsjgList(sjJsjg);
return getDataTable(list);
}
/**
* 导出设计信息-井身结构列表
*/
@PreAuthorize("@ss.hasPermi('system:sjJsjg:export')")
@Log(title = "设计信息-井身结构", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SjJsjg sjJsjg)
{
List<SjJsjg> list = sjJsjgService.selectSjJsjgList(sjJsjg);
ExcelUtil<SjJsjg> util = new ExcelUtil<SjJsjg>(SjJsjg.class);
util.exportExcel(response, list, "设计信息-井身结构数据");
}
/**
* 获取设计信息-井身结构详细信息
*/
@PreAuthorize("@ss.hasPermi('system:sjJsjg:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sjJsjgService.selectSjJsjgById(id));
}
/**
* 新增设计信息-井身结构
*/
@PreAuthorize("@ss.hasPermi('system:sjJsjg:add')")
@Log(title = "设计信息-井身结构", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SjJsjg sjJsjg)
{
return toAjax(sjJsjgService.insertSjJsjg(sjJsjg));
}
/**
* 修改设计信息-井身结构
*/
@PreAuthorize("@ss.hasPermi('system:sjJsjg:edit')")
@Log(title = "设计信息-井身结构", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SjJsjg sjJsjg)
{
return toAjax(sjJsjgService.updateSjJsjg(sjJsjg));
}
/**
* 删除设计信息-井身结构
*/
@PreAuthorize("@ss.hasPermi('system:sjJsjg:remove')")
@Log(title = "设计信息-井身结构", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sjJsjgService.deleteSjJsjgByIds(ids));
}
/**
* 查询井身结构图
*/
@GetMapping("/jsjgt")
public String jsjgt(SjJsjg sjJsjg)
{
Map jsjgt = sjJsjgService.selectJsjgt(sjJsjg);
JSONObject jsonObject = new JSONObject(jsjgt);
String jsonString = jsonObject.toJSONString();
return jsonString;
}
}
package com.ruoyi.project.zjsgfa.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
/**
* 设计信息-井基础信息对象 sj_djjc
*
* @author ruoyi
* @date 2025-06-23
*/
public class SjDjjc extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 井号 */
@Excel(name = "井号")
private String jh;
/** 井别 */
@Excel(name = "井别")
private String jb;
/** 井型 */
@Excel(name = "井型")
private String jx;
/** 井口横坐标 */
@Excel(name = "井口横坐标")
private Double jkhzb;
/** 井口纵坐标 */
@Excel(name = "井口纵坐标")
private Double jkzzb;
/** 构造位置 */
@Excel(name = "构造位置")
private String gzwz;
/** 完钻层位 */
@Excel(name = "完钻层位")
private String wzcw;
/** 钻探目的 */
@Excel(name = "钻探目的")
private String ztmd;
/** 完钻原则 */
@Excel(name = "完钻原则")
private String wzyz;
/** 完井方法 */
@Excel(name = "完井方法")
private String wjfa;
/** 创建人 */
@Excel(name = "创建人")
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdTime;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setJh(String jh)
{
this.jh = jh;
}
public String getJh()
{
return jh;
}
public void setJb(String jb)
{
this.jb = jb;
}
public String getJb()
{
return jb;
}
public void setJx(String jx)
{
this.jx = jx;
}
public String getJx()
{
return jx;
}
public void setJkhzb(Double jkhzb)
{
this.jkhzb = jkhzb;
}
public Double getJkhzb()
{
return jkhzb;
}
public void setJkzzb(Double jkzzb)
{
this.jkzzb = jkzzb;
}
public Double getJkzzb()
{
return jkzzb;
}
public void setGzwz(String gzwz)
{
this.gzwz = gzwz;
}
public String getGzwz()
{
return gzwz;
}
public void setWzcw(String wzcw)
{
this.wzcw = wzcw;
}
public String getWzcw()
{
return wzcw;
}
public void setZtmd(String ztmd)
{
this.ztmd = ztmd;
}
public String getZtmd()
{
return ztmd;
}
public void setWzyz(String wzyz)
{
this.wzyz = wzyz;
}
public String getWzyz()
{
return wzyz;
}
public void setWjfa(String wjfa)
{
this.wjfa = wjfa;
}
public String getWjfa()
{
return wjfa;
}
public void setCreatedBy(String createdBy)
{
this.createdBy = createdBy;
}
public String getCreatedBy()
{
return createdBy;
}
public void setCreatedTime(Date createdTime)
{
this.createdTime = createdTime;
}
public Date getCreatedTime()
{
return createdTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("jh", getJh())
.append("jb", getJb())
.append("jx", getJx())
.append("jkhzb", getJkhzb())
.append("jkzzb", getJkzzb())
.append("gzwz", getGzwz())
.append("wzcw", getWzcw())
.append("ztmd", getZtmd())
.append("wzyz", getWzyz())
.append("wjfa", getWjfa())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}
package com.ruoyi.project.zjsgfa.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
/**
* 设计信息-井身结构对象 sj_jsjg
*
* @author ruoyi
* @date 2025-06-24
*/
public class SjJsjg extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 井号 */
@Excel(name = "井号")
private String jh;
/** 开次 */
@Excel(name = "开次")
private String kc;
/** 钻头直径 */
@Excel(name = "钻头直径")
private BigDecimal ztzj;
/** 井深 */
@Excel(name = "井深")
private BigDecimal js;
/** 套管外径 */
@Excel(name = "套管外径")
private BigDecimal ttwj;
/** 套管顶深 */
@Excel(name = "套管顶深")
private BigDecimal ttds;
/** 套管下深 */
@Excel(name = "套管下深")
private BigDecimal ttxs;
/** 水泥返高 */
@Excel(name = "水泥返高")
private BigDecimal snfg;
/** 备注 */
@Excel(name = "备注")
private String bz;
/** 创建人 */
@Excel(name = "创建人")
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdTime;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setJh(String jh)
{
this.jh = jh;
}
public String getJh()
{
return jh;
}
public void setKc(String kc)
{
this.kc = kc;
}
public String getKc()
{
return kc;
}
public void setZtzj(BigDecimal ztzj)
{
this.ztzj = ztzj;
}
public BigDecimal getZtzj()
{
return ztzj;
}
public void setJs(BigDecimal js)
{
this.js = js;
}
public BigDecimal getJs()
{
return js;
}
public void setTtwj(BigDecimal ttwj)
{
this.ttwj = ttwj;
}
public BigDecimal getTtwj()
{
return ttwj;
}
public void setTtds(BigDecimal ttds)
{
this.ttds = ttds;
}
public BigDecimal getTtds()
{
return ttds;
}
public void setTtxs(BigDecimal ttxs)
{
this.ttxs = ttxs;
}
public BigDecimal getTtxs()
{
return ttxs;
}
public void setSnfg(BigDecimal snfg)
{
this.snfg = snfg;
}
public BigDecimal getSnfg()
{
return snfg;
}
public void setBz(String bz)
{
this.bz = bz;
}
public String getBz()
{
return bz;
}
public void setCreatedBy(String createdBy)
{
this.createdBy = createdBy;
}
public String getCreatedBy()
{
return createdBy;
}
public void setCreatedTime(Date createdTime)
{
this.createdTime = createdTime;
}
public Date getCreatedTime()
{
return createdTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("jh", getJh())
.append("kc", getKc())
.append("ztzj", getZtzj())
.append("js", getJs())
.append("ttwj", getTtwj())
.append("ttds", getTtds())
.append("ttxs", getTtxs())
.append("snfg", getSnfg())
.append("bz", getBz())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}
package com.ruoyi.project.zjsgfa.mapper;
import java.util.List;
import com.ruoyi.project.zjsgfa.domain.SjDjjc;
/**
* 设计信息-井基础信息Mapper接口
*
* @author ruoyi
* @date 2025-06-23
*/
public interface SjDjjcMapper
{
/**
* 查询设计信息-井基础信息
*
* @param id 设计信息-井基础信息主键
* @return 设计信息-井基础信息
*/
public SjDjjc selectSjDjjcById(Long id);
/**
* 查询设计信息-井基础信息列表
*
* @param sjDjjc 设计信息-井基础信息
* @return 设计信息-井基础信息集合
*/
public List<SjDjjc> selectSjDjjcList(SjDjjc sjDjjc);
/**
* 新增设计信息-井基础信息
*
* @param sjDjjc 设计信息-井基础信息
* @return 结果
*/
public int insertSjDjjc(SjDjjc sjDjjc);
/**
* 修改设计信息-井基础信息
*
* @param sjDjjc 设计信息-井基础信息
* @return 结果
*/
public int updateSjDjjc(SjDjjc sjDjjc);
/**
* 删除设计信息-井基础信息
*
* @param id 设计信息-井基础信息主键
* @return 结果
*/
public int deleteSjDjjcById(Long id);
/**
* 批量删除设计信息-井基础信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSjDjjcByIds(Long[] ids);
}
package com.ruoyi.project.zjsgfa.mapper;
import java.util.List;
import com.ruoyi.project.zjsgfa.domain.SjJsjg;
/**
* 设计信息-井身结构Mapper接口
*
* @author ruoyi
* @date 2025-06-24
*/
public interface SjJsjgMapper
{
/**
* 查询设计信息-井身结构
*
* @param id 设计信息-井身结构主键
* @return 设计信息-井身结构
*/
public SjJsjg selectSjJsjgById(Long id);
/**
* 查询设计信息-井身结构列表
*
* @param sjJsjg 设计信息-井身结构
* @return 设计信息-井身结构集合
*/
public List<SjJsjg> selectSjJsjgList(SjJsjg sjJsjg);
/**
* 新增设计信息-井身结构
*
* @param sjJsjg 设计信息-井身结构
* @return 结果
*/
public int insertSjJsjg(SjJsjg sjJsjg);
/**
* 修改设计信息-井身结构
*
* @param sjJsjg 设计信息-井身结构
* @return 结果
*/
public int updateSjJsjg(SjJsjg sjJsjg);
/**
* 删除设计信息-井身结构
*
* @param id 设计信息-井身结构主键
* @return 结果
*/
public int deleteSjJsjgById(Long id);
/**
* 批量删除设计信息-井身结构
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSjJsjgByIds(Long[] ids);
}
package com.ruoyi.project.zjsgfa.service;
import java.util.List;
import com.ruoyi.project.zjsgfa.domain.SjDjjc;
/**
* 设计信息-井基础信息Service接口
*
* @author ruoyi
* @date 2025-06-23
*/
public interface ISjDjjcService
{
/**
* 查询设计信息-井基础信息
*
* @param id 设计信息-井基础信息主键
* @return 设计信息-井基础信息
*/
public SjDjjc selectSjDjjcById(Long id);
/**
* 查询设计信息-井基础信息列表
*
* @param sjDjjc 设计信息-井基础信息
* @return 设计信息-井基础信息集合
*/
public List<SjDjjc> selectSjDjjcList(SjDjjc sjDjjc);
/**
* 新增设计信息-井基础信息
*
* @param sjDjjc 设计信息-井基础信息
* @return 结果
*/
public int insertSjDjjc(SjDjjc sjDjjc);
/**
* 修改设计信息-井基础信息
*
* @param sjDjjc 设计信息-井基础信息
* @return 结果
*/
public int updateSjDjjc(SjDjjc sjDjjc);
/**
* 批量删除设计信息-井基础信息
*
* @param ids 需要删除的设计信息-井基础信息主键集合
* @return 结果
*/
public int deleteSjDjjcByIds(Long[] ids);
/**
* 删除设计信息-井基础信息信息
*
* @param id 设计信息-井基础信息主键
* @return 结果
*/
public int deleteSjDjjcById(Long id);
}
package com.ruoyi.project.zjsgfa.service;
import java.util.List;
import java.util.Map;
import com.ruoyi.project.zjsgfa.domain.SjJsjg;
/**
* 设计信息-井身结构Service接口
*
* @author ruoyi
* @date 2025-06-24
*/
public interface ISjJsjgService
{
/**
* 查询设计信息-井身结构
*
* @param id 设计信息-井身结构主键
* @return 设计信息-井身结构
*/
public SjJsjg selectSjJsjgById(Long id);
/**
* 查询设计信息-井身结构列表
*
* @param sjJsjg 设计信息-井身结构
* @return 设计信息-井身结构集合
*/
public List<SjJsjg> selectSjJsjgList(SjJsjg sjJsjg);
/**
* 新增设计信息-井身结构
*
* @param sjJsjg 设计信息-井身结构
* @return 结果
*/
public int insertSjJsjg(SjJsjg sjJsjg);
/**
* 修改设计信息-井身结构
*
* @param sjJsjg 设计信息-井身结构
* @return 结果
*/
public int updateSjJsjg(SjJsjg sjJsjg);
/**
* 批量删除设计信息-井身结构
*
* @param ids 需要删除的设计信息-井身结构主键集合
* @return 结果
*/
public int deleteSjJsjgByIds(Long[] ids);
/**
* 删除设计信息-井身结构信息
*
* @param id 设计信息-井身结构主键
* @return 结果
*/
public int deleteSjJsjgById(Long id);
Map selectJsjgt(SjJsjg sjJsjg);
}
package com.ruoyi.project.zjsgfa.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.zjsgfa.mapper.SjDjjcMapper;
import com.ruoyi.project.zjsgfa.domain.SjDjjc;
import com.ruoyi.project.zjsgfa.service.ISjDjjcService;
/**
* 设计信息-井基础信息Service业务层处理
*
* @author ruoyi
* @date 2025-06-23
*/
@Service
public class SjDjjcServiceImpl implements ISjDjjcService
{
@Autowired
private SjDjjcMapper sjDjjcMapper;
/**
* 查询设计信息-井基础信息
*
* @param id 设计信息-井基础信息主键
* @return 设计信息-井基础信息
*/
@Override
public SjDjjc selectSjDjjcById(Long id)
{
return sjDjjcMapper.selectSjDjjcById(id);
}
/**
* 查询设计信息-井基础信息列表
*
* @param sjDjjc 设计信息-井基础信息
* @return 设计信息-井基础信息
*/
@Override
public List<SjDjjc> selectSjDjjcList(SjDjjc sjDjjc)
{
return sjDjjcMapper.selectSjDjjcList(sjDjjc);
}
/**
* 新增设计信息-井基础信息
*
* @param sjDjjc 设计信息-井基础信息
* @return 结果
*/
@Override
public int insertSjDjjc(SjDjjc sjDjjc)
{
return sjDjjcMapper.insertSjDjjc(sjDjjc);
}
/**
* 修改设计信息-井基础信息
*
* @param sjDjjc 设计信息-井基础信息
* @return 结果
*/
@Override
public int updateSjDjjc(SjDjjc sjDjjc)
{
sjDjjc.setUpdateTime(DateUtils.getNowDate());
return sjDjjcMapper.updateSjDjjc(sjDjjc);
}
/**
* 批量删除设计信息-井基础信息
*
* @param ids 需要删除的设计信息-井基础信息主键
* @return 结果
*/
@Override
public int deleteSjDjjcByIds(Long[] ids)
{
return sjDjjcMapper.deleteSjDjjcByIds(ids);
}
/**
* 删除设计信息-井基础信息信息
*
* @param id 设计信息-井基础信息主键
* @return 结果
*/
@Override
public int deleteSjDjjcById(Long id)
{
return sjDjjcMapper.deleteSjDjjcById(id);
}
}
package com.ruoyi.project.zjsgfa.service.impl;
import java.util.List;
import java.util.Map;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.zjsgfa.mapper.SjJsjgMapper;
import com.ruoyi.project.zjsgfa.domain.SjJsjg;
import com.ruoyi.project.zjsgfa.service.ISjJsjgService;
/**
* 设计信息-井身结构Service业务层处理
*
* @author ruoyi
* @date 2025-06-24
*/
@Service
public class SjJsjgServiceImpl implements ISjJsjgService
{
@Autowired
private SjJsjgMapper sjJsjgMapper;
/**
* 查询设计信息-井身结构
*
* @param id 设计信息-井身结构主键
* @return 设计信息-井身结构
*/
@Override
public SjJsjg selectSjJsjgById(Long id)
{
return sjJsjgMapper.selectSjJsjgById(id);
}
/**
* 查询设计信息-井身结构列表
*
* @param sjJsjg 设计信息-井身结构
* @return 设计信息-井身结构
*/
@Override
public List<SjJsjg> selectSjJsjgList(SjJsjg sjJsjg)
{
return sjJsjgMapper.selectSjJsjgList(sjJsjg);
}
/**
* 新增设计信息-井身结构
*
* @param sjJsjg 设计信息-井身结构
* @return 结果
*/
@Override
public int insertSjJsjg(SjJsjg sjJsjg)
{
return sjJsjgMapper.insertSjJsjg(sjJsjg);
}
/**
* 修改设计信息-井身结构
*
* @param sjJsjg 设计信息-井身结构
* @return 结果
*/
@Override
public int updateSjJsjg(SjJsjg sjJsjg)
{
sjJsjg.setUpdateTime(DateUtils.getNowDate());
return sjJsjgMapper.updateSjJsjg(sjJsjg);
}
/**
* 批量删除设计信息-井身结构
*
* @param ids 需要删除的设计信息-井身结构主键
* @return 结果
*/
@Override
public int deleteSjJsjgByIds(Long[] ids)
{
return sjJsjgMapper.deleteSjJsjgByIds(ids);
}
/**
* 删除设计信息-井身结构信息
*
* @param id 设计信息-井身结构主键
* @return 结果
*/
@Override
public int deleteSjJsjgById(Long id)
{
return sjJsjgMapper.deleteSjJsjgById(id);
}
@Override
public Map selectJsjgt(SjJsjg sjJsjg) {
List<SjJsjg> sjJsjgs = sjJsjgMapper.selectSjJsjgList(sjJsjg);
return null;
}
}
package com.ruoyi.project.zt.controller;
import cn.hutool.http.HttpRequest;
import com.google.gson.*;
import com.ruoyi.framework.util.JsonToMarkdown;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.zt.domian.CommonParam;
import com.ruoyi.project.zt.domian.DjDcInfo;
import com.ruoyi.project.zt.domian.Djjc;
import com.ruoyi.project.zt.domian.Ljinfo;
import com.ruoyi.project.zt.service.DjdcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/djdc")
public class DjdcController {
@Autowired
private DjdcService djdcService;
@GetMapping("/getList")
public AjaxResult getList(DjDcInfo info){
return AjaxResult.success(djdcService.getList(info));
}
/**
* 根据井号查询临井
*/
@GetMapping("/ljListByJh")
public AjaxResult ljListByJh(Ljinfo info){
return AjaxResult.success(djdcService.ljListByJh(info));
}
/**
* 获取井基础信息
*/
@PostMapping("/api")
public AjaxResult ff(@RequestBody CommonParam param){
String path = param.getPath();
Map<String,Object> map =new HashMap<>();
switch (path) {
case "getDjjcList":
//获取邻井基础信息
map.put("jh","井号");
map.put("kc","开次");
map.put("jd","井段");
map.put("cw","层位");
map.put("jc","进尺");
map.put("jxzs","机械钻速");
map.put("ztxh","钻头型号");
map.put("pz","喷嘴");
map.put("mxqk","磨损情况");
map.put("qzyy","起钻原因");
map.put("zb","指标");
List<Djjc> djjcList = djdcService.getDjjcList(param);
AjaxResult success = AjaxResult.success(djjcList, map);
Gson gson = new GsonBuilder().setPrettyPrinting().create();
// 将实体对象转换为JSON字符串
String json = gson.toJson(success);
String convert = JsonToMarkdown.convert(json);
System.out.println(convert);
return success;
case "getZqshfxList":
//获取邻井周期分析
map.put("jh","井号");
map.put("kc","开次");
map.put("cw","层位");
map.put("jc","进尺");
map.put("zjzq","钻进周期");
map.put("zwzq","中完周期");
map.put("zjsl","钻进速率");
map.put("zjycsl","钻进异常周期");
map.put("wjycsl","完井异常周期");
return AjaxResult.success( djdcService.getZqshfxList(param),map);
case "getZjzhfxList":
//获取钻具组合分析
map.put("jh","井号");
map.put("kc","开次");
map.put("jd","井段");
map.put("jc","进尺");
map.put("zjzhmx","钻具组合模型");
map.put("tsgj","特殊工具");
map.put("zjzh","钻具组合明细");
map.put("zb","时效");
return AjaxResult.success( djdcService.getZjzhfxList(param),map);
default:
return AjaxResult.success();
}
}
/**
* 调用长城大模型
* @param param
* @return
*/
@PostMapping("/dyAiModel")
public AjaxResult dyAiModel(CommonParam param){
Map<String,Object> map=new HashMap<>();
map.put("prompt",param.getZjzh()+" 这是一个钻具组合信息,请把这个钻具组合信息拆分成竖表,字段为钻具名称(zjmc)、型号(xh)、长度(cd),最终输出json格式数据,其他内容不输出,输出内容不换行,只要数据,反斜杠不输出");
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String json = gson.toJson(map);
String url="http://10.68.249.59:33331/api/chat/1";
String result2 = HttpRequest.post(url)
.body(json)
.execute().body();
System.out.println(result2);
// 解析API响应
Gson gsonres = new GsonBuilder().setPrettyPrinting().create();
JsonObject apiResponse = JsonParser.parseString(result2).getAsJsonObject();
// 提取message.content字段
JsonObject message = apiResponse.getAsJsonObject("message");
String content = message.get("content").getAsString();
// 提取content中的JSON部分(去除Markdown代码块标记)
String jsonContent = extractJsonContent(content);
// 解析并格式化JSON内容
JsonElement jsonElement = JsonParser.parseString(jsonContent);
String formattedJson = gson.toJson(jsonElement);
// 输出格式化后的JSON
System.out.println(formattedJson);
// 示例:处理解析后的数据
JsonObject dataObject = JsonParser.parseString(jsonContent).getAsJsonObject();
JsonArray dataArray = dataObject.getAsJsonArray("data");
// 遍历数据数组
for (JsonElement element : dataArray) {
JsonObject item = element.getAsJsonObject();
String zjmc = item.get("zjmc").getAsString();
String xh = item.get("xh").getAsString();
String cd = item.get("cd").getAsString();
System.out.printf("组件名称: %s, 型号: %s, 长度: %s%n", zjmc, xh, cd);
}
return AjaxResult.success();
}
/**
* 从Markdown代码块中提取JSON内容
*/
private static String extractJsonContent(String markdownContent) {
// 去除开头的```json和结尾的```
return markdownContent
.replaceFirst("^```json", "")
.replaceFirst("```$", "")
.trim();
}
}
package com.ruoyi.project.zt.domian;
import lombok.Data;
@Data
public class CommonParam {
//接口路径
private String path;
//井号
private String jh;
//开始完井时间
private String wjsjks;
//结束完井时间
private String wjsjjs;
//井底横坐标
private Double jdhzb;
//井底纵坐标
private Double jdzzb;
//钻具组合
private String zjzh;
}
package com.ruoyi.project.zt.domian;
import lombok.Data;
/**
* 单井地层信息
*/
@Data
public class DjDcInfo {
private String jh;
private String fclx;
private String djsd1;
private String djsd2;
private String dcmc;
private String hd;
private String jcgx;
private String ysmcList;
private String zhmcList;
}
package com.ruoyi.project.zt.domian;
import lombok.Data;
/**
* 钻具组合分析
*/
@Data
public class DjZjzhfx {
private String jh;
//开次
private String kc;
private Double ksjs;
private Double js;
//井段
private String jd;
//钻具组合模型
private String zjzhmx;
//特殊工具
private String tsgj;
//钻具组合明细
private String zjzh;
//进尺
private Double jc;
private Double jcsjhj;
//时效
private Double zb;
}
package com.ruoyi.project.zt.domian;
import lombok.Data;
/**
* 邻井周期分析
*/
@Data
public class DjZqsjfx {
//井号
private String jh;
//开始井深
private Double ksjs;
//结束井深
private Double js;
//开次
private String kc;
//进尺
private Double jc;
//到达层位
private String cw;
//钻进周期
private Double zjzq;
//中完周期
private Double zwzq;
//钻进速率
private Double zjsl;
//钻进异常周期
private Double zjycsl;
//完井异常周期
private Double wjycsl;
}
package com.ruoyi.project.zt.domian;
import lombok.Data;
/**
* 井基础信息
*/
@Data
public class Djjc {
//井号
private String jh;
//开始完井时间
private String wjsjks;
//结束完井时间
private String wjsjjs;
private String wjrq;
//井底横坐标
private Double jdhzb;
//井底纵坐标
private Double jdzzb;
//开次
private String kc;
//井段
private String jd;
//层位
private String cw;
//进尺
private Double jc;
//机械钻速
private Double jxzs;
//钻头型号
private String ztxh;
//喷嘴
private String pz;
//磨损情况
private String mxqk;
//起钻原因
private String qzyy;
//指标
private String zb;
//所钻地层
private String szdc;
private Integer xh;
private Integer PZ1;
private Integer PZ2;
private Integer PZ3;
private Integer PZ4;
private Integer PZ5;
private Integer PZ6;
private Integer PZ7;
private Integer PZ8;
private Integer PZ9;
private Integer PZ10;
private String lx;
private String npc;
private String wpc;
private String ycmsqk;
private String zcmsqk;
}
package com.ruoyi.project.zt.domian;
import lombok.Data;
@Data
public class Jsta {
private String jh;
private Integer xh;
private Double jd1;
private Double jd2;
private String sgzyxm;
private Double jhts;
private Double sjts;
private Double ljts;
}
package com.ruoyi.project.zt.domian;
import lombok.Data;
import java.util.Date;
/**
* 钻井日志
*/
@Data
public class Jswa {
private String jh;
// @Id
// @Temporal(TemporalType.DATE)
//@Column(name = "RQ", nullable = false)
private Date rq;
//@Column(name = "JS", precision = 8, scale = 2)
private Double js;
//@Column(name = "RJC", precision = 8, scale = 2)
private Double rjc;
//@Column(name = "ZTGF", length = 40)
private String ztgf;
//@Column(name = "ZY", length = 20)
private String zy;
//@Column(name = "ZS", length = 20)
private String zs;
//@Column(name = "PL", precision = 6, scale = 2)
private Double pl;
//@Column(name = "BY1", precision = 6, scale = 2)
private Double by1;
//@Column(name = "MD", precision = 6, scale = 2)
private Double md;
//@Column(name = "ND", precision = 6, scale = 2)
private Double nd;
//@Column(name = "HS", precision = 6, scale = 2)
private Double hs;
//@Column(name = "CZJ", precision = 6, scale = 2)
private Double czj;
//@Column(name = "QXZ", precision = 6, scale = 2)
private Double qxz;
//@Column(name = "JDG", precision = 6, scale = 2)
private Double jdg;
//@Column(name = "KHY", precision = 6, scale = 2)
private Double khy;
//@Column(name = "HZT", precision = 6, scale = 2)
private Double hzt;
//@Column(name = "XHZJY", precision = 6, scale = 2)
private Double xhzjy;
//@Column(name = "CJ", precision = 6, scale = 2)
private Double cj;
//@Column(name = "GJ", precision = 6, scale = 2)
private Double gj;
//@Column(name = "FZ", precision = 6, scale = 2)
private Double fz;
//@Column(name = "SG", precision = 6, scale = 2)
private Double sg;
//@Column(name = "XL", precision = 6, scale = 2)
private Double xl;
//@Column(name = "ZZTG", precision = 6, scale = 2)
private Double zztg;
//@Column(name = "ZRTG", precision = 6, scale = 2)
private Double zrtg;
//@Column(name = "FZQK", precision = 6, scale = 2)
private Double fzqk;
//@Column(name = "QT", precision = 6, scale = 2)
private Double qt;
//@Column(name = "ZGCS", precision = 6, scale = 2)
private Double zgcs;
//@Column(name = "BRZYGZ", length = 1000)
private String brzygz;
//@Column(name = "NJSS", precision = 6, scale = 2)
private Double njss;
private Double ksjs;
}
package com.ruoyi.project.zt.domian;
import lombok.Data;
/**
* 临井信息
*/
@Data
public class Ljinfo {
private String jh;
//井口横坐标
private Double jkhzb;
//井口纵坐标
private Double jkzzb;
//井底横坐标
private Double jdhzb;
//井底纵坐标
private Double jdzzb;
}
package com.ruoyi.project.zt.domian;
import lombok.Data;
@Data
public class Qzyy {
private String label;
private String value;
// 构造函数
public Qzyy(String label, String value) {
this.label = label;
this.value = value;
}
}
package com.ruoyi.project.zt.mapper;
import com.ruoyi.project.zt.domian.*;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface DjdcInfoMapper {
List<DjDcInfo> getList(DjDcInfo info);
List<Ljinfo> ljListByJh(Ljinfo info);
List<Djjc> getDjjcList(CommonParam param);
List<DjZqsjfx> getZqshfxList(CommonParam param);
DjZqsjfx getJcAndCw(DjZqsjfx djZqsjfx);
List<DjZjzhfx> getZjzhfxList(CommonParam param);
DjZjzhfx getJshaJc(String jh, Double ksjs, Double js);
Djjc getDjinfoByjh(String jh);
}
package com.ruoyi.project.zt.mapper;
import com.ruoyi.project.zt.domian.Jsta;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface JstaMapper {
List<Jsta> getList(Jsta jsta);
}
package com.ruoyi.project.zt.mapper;
import com.ruoyi.project.zt.domian.Jswa;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface JswaMapper {
List<Jswa> getList(Jswa jswa);
}
package com.ruoyi.project.zt.service;
import com.ruoyi.project.zt.domian.*;
import java.util.List;
public interface DjdcService {
List<DjDcInfo> getList(DjDcInfo info);
List<Ljinfo> ljListByJh(Ljinfo info);
List<Djjc> getDjjcList(CommonParam param);
List<DjZqsjfx> getZqshfxList(CommonParam param);
List<DjZjzhfx> getZjzhfxList(CommonParam param);
}
......@@ -12,10 +12,12 @@ spring:
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
enabled: true
driverClassName: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@192.168.31.167:1521/qianhe
username: HHZJJS
password: HHZJJS
# 初始连接数
initialSize: 5
# 最小连接池数量
......
<?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.project.zjsgfa.mapper.SjDjjcMapper">
<resultMap type="SjDjjc" id="SjDjjcResult">
<result property="id" column="id" />
<result property="jh" column="jh" />
<result property="jb" column="jb" />
<result property="jx" column="jx" />
<result property="jkhzb" column="jkhzb" />
<result property="jkzzb" column="jkzzb" />
<result property="gzwz" column="gzwz" />
<result property="wzcw" column="wzcw" />
<result property="ztmd" column="ztmd" />
<result property="wzyz" column="wzyz" />
<result property="wjfa" column="wjfa" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectSjDjjcVo">
select id, jh, jb, jx, jkhzb, jkzzb, gzwz, wzcw, ztmd, wzyz, wjfa, created_by, created_time, update_by, update_time from sj_djjc
</sql>
<select id="selectSjDjjcList" parameterType="SjDjjc" resultMap="SjDjjcResult">
<include refid="selectSjDjjcVo"/>
<where>
<if test="jh != null and jh != ''"> and jh like concat('%', #{jh}, '%')</if>
<if test="jb != null and jb != ''"> and jb like concat('%', #{jb}, '%')</if>
<if test="jx != null and jx != ''"> and jx like concat('%', #{jx}, '%')</if>
<if test="jkhzb != null "> and jkhzb >= #{jkhzb}</if>
<if test="jkzzb != null "> and jkzzb &lt;= #{jkzzb}</if>
<if test="gzwz != null and gzwz != ''"> and gzwz = #{gzwz}</if>
<if test="wzcw != null and wzcw != ''"> and wzcw = #{wzcw}</if>
<if test="ztmd != null and ztmd != ''"> and ztmd = #{ztmd}</if>
<if test="wzyz != null and wzyz != ''"> and wzyz = #{wzyz}</if>
<if test="wjfa != null and wjfa != ''"> and wjfa = #{wjfa}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
</where>
</select>
<select id="selectSjDjjcById" parameterType="Long" resultMap="SjDjjcResult">
<include refid="selectSjDjjcVo"/>
where id = #{id}
</select>
<insert id="insertSjDjjc" parameterType="SjDjjc" useGeneratedKeys="true" keyProperty="id">
insert into sj_djjc
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jh != null">jh,</if>
<if test="jb != null">jb,</if>
<if test="jx != null">jx,</if>
<if test="jkhzb != null">jkhzb,</if>
<if test="jkzzb != null">jkzzb,</if>
<if test="gzwz != null">gzwz,</if>
<if test="wzcw != null">wzcw,</if>
<if test="ztmd != null">ztmd,</if>
<if test="wzyz != null">wzyz,</if>
<if test="wjfa != null">wjfa,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jh != null">#{jh},</if>
<if test="jb != null">#{jb},</if>
<if test="jx != null">#{jx},</if>
<if test="jkhzb != null">#{jkhzb},</if>
<if test="jkzzb != null">#{jkzzb},</if>
<if test="gzwz != null">#{gzwz},</if>
<if test="wzcw != null">#{wzcw},</if>
<if test="ztmd != null">#{ztmd},</if>
<if test="wzyz != null">#{wzyz},</if>
<if test="wjfa != null">#{wjfa},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateSjDjjc" parameterType="SjDjjc">
update sj_djjc
<trim prefix="SET" suffixOverrides=",">
<if test="jh != null">jh = #{jh},</if>
<if test="jb != null">jb = #{jb},</if>
<if test="jx != null">jx = #{jx},</if>
<if test="jkhzb != null">jkhzb = #{jkhzb},</if>
<if test="jkzzb != null">jkzzb = #{jkzzb},</if>
<if test="gzwz != null">gzwz = #{gzwz},</if>
<if test="wzcw != null">wzcw = #{wzcw},</if>
<if test="ztmd != null">ztmd = #{ztmd},</if>
<if test="wzyz != null">wzyz = #{wzyz},</if>
<if test="wjfa != null">wjfa = #{wjfa},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSjDjjcById" parameterType="Long">
delete from sj_djjc where id = #{id}
</delete>
<delete id="deleteSjDjjcByIds" parameterType="String">
delete from sj_djjc where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.zjsgfa.mapper.SjJsjgMapper">
<resultMap type="SjJsjg" id="SjJsjgResult">
<result property="id" column="id" />
<result property="jh" column="jh" />
<result property="kc" column="kc" />
<result property="ztzj" column="ztzj" />
<result property="js" column="js" />
<result property="ttwj" column="ttwj" />
<result property="ttds" column="ttds" />
<result property="ttxs" column="ttxs" />
<result property="snfg" column="snfg" />
<result property="bz" column="bz" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectSjJsjgVo">
select id, jh, kc, ztzj, js, ttwj, ttds, ttxs, snfg, bz, created_by, created_time, update_by, update_time from sj_jsjg
</sql>
<select id="selectSjJsjgList" parameterType="SjJsjg" resultMap="SjJsjgResult">
<include refid="selectSjJsjgVo"/>
<where>
<if test="jh != null and jh != ''"> and jh = #{jh}</if>
<if test="kc != null and kc != ''"> and kc = #{kc}</if>
<if test="ztzj != null "> and ztzj = #{ztzj}</if>
<if test="js != null "> and js = #{js}</if>
<if test="ttwj != null "> and ttwj = #{ttwj}</if>
<if test="ttds != null "> and ttds = #{ttds}</if>
<if test="ttxs != null "> and ttxs = #{ttxs}</if>
<if test="snfg != null "> and snfg = #{snfg}</if>
<if test="bz != null and bz != ''"> and bz = #{bz}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
</where>
order by jh ,kc
</select>
<select id="selectSjJsjgById" parameterType="Long" resultMap="SjJsjgResult">
<include refid="selectSjJsjgVo"/>
where id = #{id}
</select>
<insert id="insertSjJsjg" parameterType="SjJsjg" useGeneratedKeys="true" keyProperty="id">
insert into sj_jsjg
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jh != null">jh,</if>
<if test="kc != null">kc,</if>
<if test="ztzj != null">ztzj,</if>
<if test="js != null">js,</if>
<if test="ttwj != null">ttwj,</if>
<if test="ttds != null">ttds,</if>
<if test="ttxs != null">ttxs,</if>
<if test="snfg != null">snfg,</if>
<if test="bz != null">bz,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jh != null">#{jh},</if>
<if test="kc != null">#{kc},</if>
<if test="ztzj != null">#{ztzj},</if>
<if test="js != null">#{js},</if>
<if test="ttwj != null">#{ttwj},</if>
<if test="ttds != null">#{ttds},</if>
<if test="ttxs != null">#{ttxs},</if>
<if test="snfg != null">#{snfg},</if>
<if test="bz != null">#{bz},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateSjJsjg" parameterType="SjJsjg">
update sj_jsjg
<trim prefix="SET" suffixOverrides=",">
<if test="jh != null">jh = #{jh},</if>
<if test="kc != null">kc = #{kc},</if>
<if test="ztzj != null">ztzj = #{ztzj},</if>
<if test="js != null">js = #{js},</if>
<if test="ttwj != null">ttwj = #{ttwj},</if>
<if test="ttds != null">ttds = #{ttds},</if>
<if test="ttxs != null">ttxs = #{ttxs},</if>
<if test="snfg != null">snfg = #{snfg},</if>
<if test="bz != null">bz = #{bz},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSjJsjgById" parameterType="Long">
delete from sj_jsjg where id = #{id}
</delete>
<delete id="deleteSjJsjgByIds" parameterType="String">
delete from sj_jsjg where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.zt.mapper.DjdcInfoMapper">
<select id="getList" resultType="com.ruoyi.project.zt.domian.DjDcInfo">
select A.jh,
A.djsd1,
A.djsd2,
A.dcmc,
A.hd,
A.jcgx,A.ysmc_list,b.zhmc_list from (
SELECT
B.jh,
B.djsd1,
B.djsd2,
B.dcmc,
B.hd,
B.jcgx,
LISTAGG ( b.ysmc, ', ' ) WITHIN GROUP ( ORDER BY b.ysmc ) AS ysmc_list
FROM
(
SELECT
B.jh,
B.djsd1,
B.djsd2,
B.dcmc,
B.hd,
B.jcgx,
A.ysmc
FROM
AZF07 B
LEFT JOIN AZL02 A ON B.jh = A.jh
AND A.djsd1 > B.djsd1
AND A.djsd2 &lt; B.djsd2
WHERE
B.jh LIKE concat(#{jh},'%')
AND B.fclx = #{fclx}
GROUP BY
B.jh,
B.djsd1,
B.djsd2,
B.dcmc,
B.hd,
B.jcgx,
a.ysmc
ORDER BY
B.djsd1
) B
GROUP BY
B.jh,
B.djsd1,
B.djsd2,
B.dcmc,
B.hd,
B.jcgx
ORDER BY
B.djsd1 )A
left join
(
SELECT
B.jh,
B.djsd1,
B.djsd2,
B.dcmc,
B.hd,
B.jcgx,
LISTAGG ( b.zhjs, ', ' ) WITHIN GROUP ( ORDER BY b.zhjs ) AS zhmc_list
FROM
(
SELECT
B.jh,
B.djsd1,
B.djsd2,
B.dcmc,
B.hd,
B.jcgx,
A.zhjs
FROM
AZF07 B
LEFT JOIN AZF09 A ON B.jh = A.jh
AND A.djsd1 > B.djsd1
AND A.djsd2 &lt; B.djsd2
WHERE
B.jh LIKE concat(#{jh},'%')
AND B.fclx = #{fclx}
GROUP BY
B.jh,
B.djsd1,
B.djsd2,
B.dcmc,
B.hd,
B.jcgx,
a.zhjs
ORDER BY
B.djsd1
) B
GROUP BY
B.jh,
B.djsd1,
B.djsd2,
B.dcmc,
B.hd,
B.jcgx
ORDER BY
B.djsd1) B on a.jh =b.jh and a.djsd1=b.djsd1 and a.djsd2=b.djsd2 and a.dcmc=b.dcmc and a.hd=b.hd ;
</select>
<select id="ljListByJh" resultType="com.ruoyi.project.zt.domian.Ljinfo">
SELECT a.jh, a.jkhzb, a.jkzzb, a.jdhzb, a.jdzzb
FROM JSBA a
INNER JOIN JSBA b ON b.jh = #{jh}
WHERE
ABS(a.jdhzb - b.jdhzb) &lt; 1000 -- 按井底坐标选
AND
ABS(a.jdzzb - b.jdzzb) &lt; 1000
</select>
<!-- &#45;&#45;-->
<!-- &#45;&#45; ABS(a.jkhzb - b.jkhzb) &lt; 10 &#45;&#45; 按井口坐标-->
<!-- &#45;&#45; AND-->
<!-- &#45;&#45; ABS(a.jkzzb - b.jkzzb) &lt; 10;-->
<select id="getDjjcList" resultType="com.ruoyi.project.zt.domian.Djjc">
select a.jh,a.jdhzb,a.jdzzb,to_char(b.WJRQ,'YYYY-MM-DD') wjrq,c.kc,c.jd,ksjs,c.JS,xh,
SZDC cw,
JC,
jxzs,
ZTXH,
PZ1,
PZ2,
PZ3,
PZ4,
PZ5,
PZ6,
PZ7,
PZ8,
PZ9,
PZ10,
lx,
Npc,
WPC,
YCMSQK,
ZCMSQK,
Qzyy,
zb
from HHZJJS.JSBA a
left join HHZJJS.jsaa b on a.jh = b.jh
left join (
SELECT
jh,kc,(CASE WHEN kc = 1 THEN 0 ELSE LAG_JS END) ksjs,js, CONCAT( CASE WHEN kc = 1 THEN '0-' ELSE LAG_JS || '-'END,JS) AS jd
FROM (
SELECT
jh, ROW_NUMBER() OVER (PARTITION BY jh ORDER BY js) AS kc,
JS,
LAG(JS, 1, 0) OVER (PARTITION BY jh ORDER BY js) AS LAG_JS
FROM HHZJJS.JSDB
) t) c on a.jh=c.jh
left join (
select jh,xh,
SZDC,
JC,
jxzs,
ZTXH,
PZ1,
PZ2,
PZ3,
PZ4,
PZ5,
PZ6,
PZ7,
PZ8,
PZ9,
PZ10,
lx,
Npc,
WPC,
YCMSQK,
ZCMSQK,
Qzyy,
zzjs,
ROUND(jc / case when (JCSJHJ / 24) =0 then 1 else (JCSJHJ / 24) end , 2) zb
from HHZJJS.JSHA
order by xh
) d on a.JH=d.jh and d.zzjs>ksjs and d.zzjs&lt;=js
where 1=1
<if test="jdhzb!=null">
and ABS(#{jdhzb} - a.jdhzb) &lt; 1000
</if>
<if test="jdzzb!=null">
AND ABS(#{jdzzb} - a.jdzzb) &lt; 1000
</if>
<if test="wjsjks!=null and wjsjks!=''">
and to_char(b.WJRQ,'YYYY-MM-DD')>=#{wjsjks}
</if>
<if test="wjsjjs!=null and wjsjjs!=''">
and to_char(b.WJRQ,'YYYY-MM-DD')&lt;=#{wjsjjs}
</if>
order by kc,jh,XH
</select>
<select id="getZqshfxList" resultType="com.ruoyi.project.zt.domian.DjZqsjfx">
select a.jh,c.kc,ksjs,c.js
from HHZJJS.JSBA a
left join HHZJJS.jsaa b on a.jh = b.jh
left join (
SELECT
jh,kc,(CASE WHEN kc = 1 THEN 0 ELSE LAG_JS END) ksjs,js
FROM (
SELECT
jh, ROW_NUMBER() OVER (PARTITION BY jh ORDER BY js) AS kc,
JS,
LAG(JS, 1, 0) OVER (PARTITION BY jh ORDER BY js) AS LAG_JS
FROM HHZJJS.JSDB
) t) c on a.jh=c.jh
where 1=1
<if test="jdhzb!=null">
and ABS(#{jdhzb} - a.jdhzb) &lt; 1000
</if>
<if test="jdzzb!=null">
AND ABS(#{jdzzb} - a.jdzzb) &lt; 1000
</if>
<if test="wjsjks!=null and wjsjks!=''">
and to_char(b.WJRQ,'YYYY-MM-DD')>=#{wjsjks}
</if>
<if test="wjsjjs!=null and wjsjjs!=''">
and to_char(b.WJRQ,'YYYY-MM-DD')&lt;=#{wjsjjs}
</if>
<if test="jh!=null and jh!=''">
and a.jh = #{jh}
</if>
order by kc,jh
</select>
<select id="getJcAndCw" resultType="com.ruoyi.project.zt.domian.DjZqsjfx">
select jh,sum(jc) jc ,LISTAGG ( SZDC, '- ' ) WITHIN GROUP ( ORDER BY xh ) AS cw
from HHZJJS.JSHA a
where 1=1
<if test="jh!=null and jh!=''">
and a. jh =#{jh}
</if>
<if test="ksjs!=null">
and zzjs > #{ksjs}
</if>
<if test="js!=null">
and zzjs &lt;= #{js}
</if>
group by jh
</select>
<select id="getZjzhfxList" resultType="com.ruoyi.project.zt.domian.DjZjzhfx">
select a.jh,
c.kc,
c.jd,
ksjs,
c.JS,
d.ZJZH,d.ZJJD
from HHZJJS.JSBA a
left join HHZJJS.jsaa b on a.jh = b.jh
left join (SELECT jh,
kc,
(CASE WHEN kc = 1 THEN 0 ELSE LAG_JS END) ksjs,
js,
CONCAT(CASE WHEN kc = 1 THEN '0-' ELSE LAG_JS || '-' END, JS) AS jd
FROM (SELECT jh,
ROW_NUMBER() OVER (PARTITION BY jh ORDER BY js) AS kc,
JS,
LAG(JS, 1, 0) OVER (PARTITION BY jh ORDER BY js) AS LAG_JS
FROM HHZJJS.JSDB) t) c on a.jh = c.jh
left join HHZJJS.JSFA d on a.JH=d.JH and c.kc=d.XH
where 1 = 1
<if test="jdhzb!=null">
and ABS(#{jdhzb} - a.jdhzb) &lt; 1000
</if>
<if test="jdzzb!=null">
AND ABS(#{jdzzb} - a.jdzzb) &lt; 1000
</if>
<if test="wjsjks!=null and wjsjks!=''">
and to_char(b.WJRQ,'YYYY-MM-DD')>=#{wjsjks}
</if>
<if test="wjsjjs!=null and wjsjjs!=''">
and to_char(b.WJRQ,'YYYY-MM-DD')&lt;=#{wjsjjs}
</if>
<if test="jh!=null and jh!=''">
and a.jh = #{jh}
</if>
order by kc, jh
</select>
<select id="getJshaJc" resultType="com.ruoyi.project.zt.domian.DjZjzhfx">
select jh,
nvl(sum(jc),0) jc,
nvl(ROUND(sum(JCSJHJ)/24,2),0) jcsjhj
from HHZJJS.JSHA
where jh = #{jh}
and zzjs > #{ksjs}
and zzjs &lt;= #{js}
group by jh
</select>
<select id="getDjinfoByjh" resultType="com.ruoyi.project.zt.domian.Djjc">
select JDHZB,JDZZB from HHZJJS.JSBA a where a.JH =#{jh}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.zt.mapper.JstaMapper">
<select id="getList" resultType="com.ruoyi.project.zt.domian.Jsta">
select *
from HHZJJS.JSTA a
where 1=1
<if test="jh!=null and jh!=''">
and jh =#{jh}
</if>
<if test="jd1!=null ">
and jd2 > #{jd1}
</if>
<if test="jd2!=null ">
and jd2 &lt;= #{jd2}
</if>
order by jh, xh
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.zt.mapper.JswaMapper">
<select id="getList" resultType="com.ruoyi.project.zt.domian.Jswa">
select jh, rq, nvl(js,0) js, nvl(rjc,0) rjc,nvl(sg,0) sg, nvl(xl,0)xl,nvl(zrtg,0) zrtg, nvl(zztg,0)zztg,nvl(fzqk,0) fzqk from HHZJJS.JSWA where 1=1
<if test="jh!=null and jh!=''">
and jh =#{jh}
</if>
<if test="ksjs!=null ">
and js > #{ksjs}
</if>
<if test="js!=null ">
and js &lt;= #{js}
</if>
order by rq
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment