add - 多数据源、电检数据记录
parent
ab1bfed6b4
commit
acb0d08999
@ -0,0 +1,99 @@
|
||||
package com.aucma.report.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.aucma.common.utils.DateUtils;
|
||||
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.aucma.common.annotation.Log;
|
||||
import com.aucma.common.core.controller.BaseController;
|
||||
import com.aucma.common.core.domain.AjaxResult;
|
||||
import com.aucma.common.enums.BusinessType;
|
||||
import com.aucma.report.domain.RecordElectricalInspection;
|
||||
import com.aucma.report.service.IRecordElectricalInspectionService;
|
||||
import com.aucma.common.utils.poi.ExcelUtil;
|
||||
import com.aucma.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 电检数据记录Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/report/electricalInspection" )
|
||||
public class RecordElectricalInspectionController extends BaseController {
|
||||
@Autowired
|
||||
private IRecordElectricalInspectionService recordElectricalInspectionService;
|
||||
|
||||
/**
|
||||
* 查询电检数据记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:electricalInspection:list')" )
|
||||
@GetMapping("/list" )
|
||||
public TableDataInfo list(RecordElectricalInspection recordElectricalInspection) {
|
||||
startPage();
|
||||
List<RecordElectricalInspection> list = recordElectricalInspectionService.selectRecordElectricalInspectionList(recordElectricalInspection);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出电检数据记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:electricalInspection:export')" )
|
||||
@Log(title = "电检数据记录" , businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export" )
|
||||
public void export(HttpServletResponse response, RecordElectricalInspection recordElectricalInspection) {
|
||||
List<RecordElectricalInspection> list = recordElectricalInspectionService.selectRecordElectricalInspectionList(recordElectricalInspection);
|
||||
ExcelUtil<RecordElectricalInspection> util = new ExcelUtil<RecordElectricalInspection>(RecordElectricalInspection. class);
|
||||
util.exportExcel(response, list, "电检数据记录数据" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电检数据记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:electricalInspection:query')" )
|
||||
@GetMapping(value = "/{uuid}" )
|
||||
public AjaxResult getInfo(@PathVariable("uuid" ) String uuid) {
|
||||
return success(recordElectricalInspectionService.selectRecordElectricalInspectionByUuid(uuid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电检数据记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:electricalInspection:add')" )
|
||||
@Log(title = "电检数据记录" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RecordElectricalInspection recordElectricalInspection) {
|
||||
return toAjax(recordElectricalInspectionService.insertRecordElectricalInspection(recordElectricalInspection));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电检数据记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:electricalInspection:edit')" )
|
||||
@Log(title = "电检数据记录" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RecordElectricalInspection recordElectricalInspection) {
|
||||
return toAjax(recordElectricalInspectionService.updateRecordElectricalInspection(recordElectricalInspection));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电检数据记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:electricalInspection:remove')" )
|
||||
@Log(title = "电检数据记录" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{uuids}" )
|
||||
public AjaxResult remove(@PathVariable String[] uuids) {
|
||||
return toAjax(recordElectricalInspectionService.deleteRecordElectricalInspectionByUuids(uuids));
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package com.aucma.report.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.aucma.common.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.aucma.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 电检数据明细对象 detail_electricalinspection
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-09
|
||||
*/
|
||||
public class DetailElectricalinspection extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标识
|
||||
*/
|
||||
@Excel(name = "标识")
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
@Excel(name = "序号")
|
||||
private Long serialnumber;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
@Excel(name = "项目名称")
|
||||
private String projectname;
|
||||
|
||||
/**
|
||||
* 测试条件
|
||||
*/
|
||||
@Excel(name = "测试条件")
|
||||
private String testcondition;
|
||||
|
||||
/**
|
||||
* 测试值
|
||||
*/
|
||||
@Excel(name = "测试值")
|
||||
private String testvalue;
|
||||
|
||||
/**
|
||||
* 测试结果
|
||||
*/
|
||||
@Excel(name = "测试结果")
|
||||
private String testresult;
|
||||
|
||||
/**
|
||||
* 记录时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date recordtime;
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setSerialnumber(Long serialnumber) {
|
||||
this.serialnumber = serialnumber;
|
||||
}
|
||||
|
||||
public Long getSerialnumber() {
|
||||
return serialnumber;
|
||||
}
|
||||
|
||||
public void setProjectname(String projectname) {
|
||||
this.projectname = projectname;
|
||||
}
|
||||
|
||||
public String getProjectname() {
|
||||
return projectname;
|
||||
}
|
||||
|
||||
public void setTestcondition(String testcondition) {
|
||||
this.testcondition = testcondition;
|
||||
}
|
||||
|
||||
public String getTestcondition() {
|
||||
return testcondition;
|
||||
}
|
||||
|
||||
public void setTestvalue(String testvalue) {
|
||||
this.testvalue = testvalue;
|
||||
}
|
||||
|
||||
public String getTestvalue() {
|
||||
return testvalue;
|
||||
}
|
||||
|
||||
public void setTestresult(String testresult) {
|
||||
this.testresult = testresult;
|
||||
}
|
||||
|
||||
public String getTestresult() {
|
||||
return testresult;
|
||||
}
|
||||
|
||||
public void setRecordtime(Date recordtime) {
|
||||
this.recordtime = recordtime;
|
||||
}
|
||||
|
||||
public Date getRecordtime() {
|
||||
return recordtime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("uuid", getUuid())
|
||||
.append("serialnumber", getSerialnumber())
|
||||
.append("projectname", getProjectname())
|
||||
.append("testcondition", getTestcondition())
|
||||
.append("testvalue", getTestvalue())
|
||||
.append("testresult", getTestresult())
|
||||
.append("recordtime", getRecordtime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package com.aucma.report.domain;
|
||||
|
||||
import java.util.List;
|
||||
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.aucma.common.annotation.Excel;
|
||||
import com.aucma.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 电检数据记录对象 record_electricalinspection
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-09
|
||||
*/
|
||||
public class RecordElectricalInspection extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 唯一标识
|
||||
*/
|
||||
@Excel(name = "唯一标识")
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
* 测试总结果
|
||||
*/
|
||||
@Excel(name = "测试总结果")
|
||||
private String result;
|
||||
|
||||
/**
|
||||
* 产品条码
|
||||
*/
|
||||
@Excel(name = "产品条码")
|
||||
private String barcode;
|
||||
|
||||
/**
|
||||
* 测试时间
|
||||
*/
|
||||
@Excel(name = "测试时间")
|
||||
private String testTime;
|
||||
|
||||
/**
|
||||
* 测试数据
|
||||
*/
|
||||
@Excel(name = "测试数据")
|
||||
private String testData;
|
||||
|
||||
/**
|
||||
* 记录时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date recordTime;
|
||||
|
||||
/**
|
||||
* 电检数据明细信息
|
||||
*/
|
||||
private List<DetailElectricalinspection> detailElectricalinspectionList;
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public void setTestTime(String testTime) {
|
||||
this.testTime = testTime;
|
||||
}
|
||||
|
||||
public String getTestTime() {
|
||||
return testTime;
|
||||
}
|
||||
|
||||
public void setTestData(String testData) {
|
||||
this.testData = testData;
|
||||
}
|
||||
|
||||
public String getTestData() {
|
||||
return testData;
|
||||
}
|
||||
|
||||
public void setRecordTime(Date recordTime) {
|
||||
this.recordTime = recordTime;
|
||||
}
|
||||
|
||||
public Date getRecordTime() {
|
||||
return recordTime;
|
||||
}
|
||||
|
||||
public List<DetailElectricalinspection> getDetailElectricalinspectionList() {
|
||||
return detailElectricalinspectionList;
|
||||
}
|
||||
|
||||
public void setDetailElectricalinspectionList(List<DetailElectricalinspection> detailElectricalinspectionList) {
|
||||
this.detailElectricalinspectionList = detailElectricalinspectionList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("uuid", getUuid())
|
||||
.append("result", getResult())
|
||||
.append("barcode", getBarcode())
|
||||
.append("testTime", getTestTime())
|
||||
.append("testData", getTestData())
|
||||
.append("recordTime", getRecordTime())
|
||||
.append("detailElectricalinspectionList", getDetailElectricalinspectionList())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.aucma.report.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.aucma.common.annotation.DataSource;
|
||||
import com.aucma.common.enums.DataSourceType;
|
||||
import com.aucma.report.domain.RecordElectricalInspection;
|
||||
import com.aucma.report.domain.DetailElectricalinspection;
|
||||
|
||||
/**
|
||||
* 电检数据记录Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-09
|
||||
*/
|
||||
@DataSource(value = DataSourceType.SLAVE)
|
||||
public interface RecordElectricalInspectionMapper
|
||||
{
|
||||
/**
|
||||
* 查询电检数据记录
|
||||
*
|
||||
* @param uuid 电检数据记录主键
|
||||
* @return 电检数据记录
|
||||
*/
|
||||
public RecordElectricalInspection selectRecordElectricalInspectionByUuid(String uuid);
|
||||
|
||||
/**
|
||||
* 查询电检数据记录列表
|
||||
*
|
||||
* @param recordElectricalInspection 电检数据记录
|
||||
* @return 电检数据记录集合
|
||||
*/
|
||||
public List<RecordElectricalInspection> selectRecordElectricalInspectionList(RecordElectricalInspection recordElectricalInspection);
|
||||
|
||||
/**
|
||||
* 新增电检数据记录
|
||||
*
|
||||
* @param recordElectricalInspection 电检数据记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRecordElectricalInspection(RecordElectricalInspection recordElectricalInspection);
|
||||
|
||||
/**
|
||||
* 修改电检数据记录
|
||||
*
|
||||
* @param recordElectricalInspection 电检数据记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRecordElectricalInspection(RecordElectricalInspection recordElectricalInspection);
|
||||
|
||||
/**
|
||||
* 删除电检数据记录
|
||||
*
|
||||
* @param uuid 电检数据记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRecordElectricalInspectionByUuid(String uuid);
|
||||
|
||||
/**
|
||||
* 批量删除电检数据记录
|
||||
*
|
||||
* @param uuids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRecordElectricalInspectionByUuids(String[] uuids);
|
||||
|
||||
/**
|
||||
* 批量删除电检数据明细
|
||||
*
|
||||
* @param uuids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDetailElectricalinspectionByUuids(String[] uuids);
|
||||
|
||||
/**
|
||||
* 批量新增电检数据明细
|
||||
*
|
||||
* @param detailElectricalinspectionList 电检数据明细列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchDetailElectricalinspection(List<DetailElectricalinspection> detailElectricalinspectionList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过电检数据记录主键删除电检数据明细信息
|
||||
*
|
||||
* @param uuid 电检数据记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDetailElectricalinspectionByUuid(String uuid);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.aucma.report.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.report.domain.RecordElectricalInspection;
|
||||
|
||||
/**
|
||||
* 电检数据记录Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-09
|
||||
*/
|
||||
public interface IRecordElectricalInspectionService
|
||||
{
|
||||
/**
|
||||
* 查询电检数据记录
|
||||
*
|
||||
* @param uuid 电检数据记录主键
|
||||
* @return 电检数据记录
|
||||
*/
|
||||
public RecordElectricalInspection selectRecordElectricalInspectionByUuid(String uuid);
|
||||
|
||||
/**
|
||||
* 查询电检数据记录列表
|
||||
*
|
||||
* @param recordElectricalInspection 电检数据记录
|
||||
* @return 电检数据记录集合
|
||||
*/
|
||||
public List<RecordElectricalInspection> selectRecordElectricalInspectionList(RecordElectricalInspection recordElectricalInspection);
|
||||
|
||||
/**
|
||||
* 新增电检数据记录
|
||||
*
|
||||
* @param recordElectricalInspection 电检数据记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRecordElectricalInspection(RecordElectricalInspection recordElectricalInspection);
|
||||
|
||||
/**
|
||||
* 修改电检数据记录
|
||||
*
|
||||
* @param recordElectricalInspection 电检数据记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRecordElectricalInspection(RecordElectricalInspection recordElectricalInspection);
|
||||
|
||||
/**
|
||||
* 批量删除电检数据记录
|
||||
*
|
||||
* @param uuids 需要删除的电检数据记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRecordElectricalInspectionByUuids(String[] uuids);
|
||||
|
||||
/**
|
||||
* 删除电检数据记录信息
|
||||
*
|
||||
* @param uuid 电检数据记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRecordElectricalInspectionByUuid(String uuid);
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package com.aucma.report.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import com.aucma.common.utils.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.aucma.report.domain.DetailElectricalinspection;
|
||||
import com.aucma.report.mapper.RecordElectricalInspectionMapper;
|
||||
import com.aucma.report.domain.RecordElectricalInspection;
|
||||
import com.aucma.report.service.IRecordElectricalInspectionService;
|
||||
|
||||
/**
|
||||
* 电检数据记录Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-09
|
||||
*/
|
||||
@Service
|
||||
public class RecordElectricalInspectionServiceImpl implements IRecordElectricalInspectionService
|
||||
{
|
||||
@Autowired
|
||||
private RecordElectricalInspectionMapper recordElectricalInspectionMapper;
|
||||
|
||||
/**
|
||||
* 查询电检数据记录
|
||||
*
|
||||
* @param uuid 电检数据记录主键
|
||||
* @return 电检数据记录
|
||||
*/
|
||||
@Override
|
||||
public RecordElectricalInspection selectRecordElectricalInspectionByUuid(String uuid)
|
||||
{
|
||||
return recordElectricalInspectionMapper.selectRecordElectricalInspectionByUuid(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询电检数据记录列表
|
||||
*
|
||||
* @param recordElectricalInspection 电检数据记录
|
||||
* @return 电检数据记录
|
||||
*/
|
||||
@Override
|
||||
public List<RecordElectricalInspection> selectRecordElectricalInspectionList(RecordElectricalInspection recordElectricalInspection)
|
||||
{
|
||||
return recordElectricalInspectionMapper.selectRecordElectricalInspectionList(recordElectricalInspection);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电检数据记录
|
||||
*
|
||||
* @param recordElectricalInspection 电检数据记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertRecordElectricalInspection(RecordElectricalInspection recordElectricalInspection)
|
||||
{
|
||||
int rows = recordElectricalInspectionMapper.insertRecordElectricalInspection(recordElectricalInspection);
|
||||
insertDetailElectricalinspection(recordElectricalInspection);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电检数据记录
|
||||
*
|
||||
* @param recordElectricalInspection 电检数据记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateRecordElectricalInspection(RecordElectricalInspection recordElectricalInspection)
|
||||
{
|
||||
recordElectricalInspectionMapper.deleteDetailElectricalinspectionByUuid(recordElectricalInspection.getUuid());
|
||||
insertDetailElectricalinspection(recordElectricalInspection);
|
||||
return recordElectricalInspectionMapper.updateRecordElectricalInspection(recordElectricalInspection);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除电检数据记录
|
||||
*
|
||||
* @param uuids 需要删除的电检数据记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteRecordElectricalInspectionByUuids(String[] uuids)
|
||||
{
|
||||
recordElectricalInspectionMapper.deleteDetailElectricalinspectionByUuids(uuids);
|
||||
return recordElectricalInspectionMapper.deleteRecordElectricalInspectionByUuids(uuids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电检数据记录信息
|
||||
*
|
||||
* @param uuid 电检数据记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteRecordElectricalInspectionByUuid(String uuid)
|
||||
{
|
||||
recordElectricalInspectionMapper.deleteDetailElectricalinspectionByUuid(uuid);
|
||||
return recordElectricalInspectionMapper.deleteRecordElectricalInspectionByUuid(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电检数据明细信息
|
||||
*
|
||||
* @param recordElectricalInspection 电检数据记录对象
|
||||
*/
|
||||
public void insertDetailElectricalinspection(RecordElectricalInspection recordElectricalInspection)
|
||||
{
|
||||
List<DetailElectricalinspection> detailElectricalinspectionList = recordElectricalInspection.getDetailElectricalinspectionList();
|
||||
String uuid = recordElectricalInspection.getUuid();
|
||||
if (StringUtils.isNotNull(detailElectricalinspectionList))
|
||||
{
|
||||
List<DetailElectricalinspection> list = new ArrayList<DetailElectricalinspection>();
|
||||
for (DetailElectricalinspection detailElectricalinspection : detailElectricalinspectionList)
|
||||
{
|
||||
detailElectricalinspection.setUuid(uuid);
|
||||
list.add(detailElectricalinspection);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
recordElectricalInspectionMapper.batchDetailElectricalinspection(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
<?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.aucma.report.mapper.RecordElectricalInspectionMapper">
|
||||
|
||||
<resultMap type="RecordElectricalInspection" id="RecordElectricalInspectionResult">
|
||||
<result property="uuid" column="uuid"/>
|
||||
<result property="result" column="result"/>
|
||||
<result property="barcode" column="barcode"/>
|
||||
<result property="testTime" column="testtime"/>
|
||||
<result property="testData" column="testdata"/>
|
||||
<result property="recordTime" column="recordtime"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="RecordElectricalInspectionDetailElectricalinspectionResult" type="RecordElectricalInspection"
|
||||
extends="RecordElectricalInspectionResult">
|
||||
<collection property="detailElectricalinspectionList" notNullColumn="sub_uuid" javaType="java.util.List"
|
||||
resultMap="DetailElectricalinspectionResult"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="DetailElectricalinspection" id="DetailElectricalinspectionResult">
|
||||
<result property="uuid" column="sub_uuid"/>
|
||||
<result property="serialnumber" column="sub_serialnumber"/>
|
||||
<result property="projectname" column="sub_projectname"/>
|
||||
<result property="testcondition" column="sub_testcondition"/>
|
||||
<result property="testvalue" column="sub_testvalue"/>
|
||||
<result property="testresult" column="sub_testresult"/>
|
||||
<result property="recordtime" column="sub_recordtime"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRecordElectricalInspectionVo">
|
||||
select uuid, result, barcode, testtime, testdata, recordtime
|
||||
from record_electricalinspection
|
||||
</sql>
|
||||
|
||||
<select id="selectRecordElectricalInspectionList" parameterType="RecordElectricalInspection"
|
||||
resultMap="RecordElectricalInspectionResult">
|
||||
<include refid="selectRecordElectricalInspectionVo"/>
|
||||
<where>
|
||||
<if test="uuid != null and uuid != ''">and uuid = #{uuid}</if>
|
||||
<if test="result != null and result != ''">and result = #{result}</if>
|
||||
<if test="barcode != null and barcode != ''">and barcode = #{barcode}</if>
|
||||
<if test="testTime != null and testTime != ''">and testtime = #{testTime}</if>
|
||||
<if test="testData != null and testData != ''">and testdata = #{testData}</if>
|
||||
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''">
|
||||
and recordtime between to_date(#{params.beginRecordTime}, 'yyyy-mm-dd hh24:mi:ss') and
|
||||
to_date(#{params.endRecordTime}, 'yyyy-mm-dd hh24:mi:ss')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRecordElectricalInspectionByUuid" parameterType="String"
|
||||
resultMap="RecordElectricalInspectionDetailElectricalinspectionResult">
|
||||
select a.uuid,
|
||||
a.result,
|
||||
a.barcode,
|
||||
a.testtime,
|
||||
a.testdata,
|
||||
a.recordtime,
|
||||
b.uuid as sub_uuid,
|
||||
b.serialnumber as sub_serialnumber,
|
||||
b.projectname as sub_projectname,
|
||||
b.testcondition as sub_testcondition,
|
||||
b.testvalue as sub_testvalue,
|
||||
b.testresult as sub_testresult,
|
||||
b.recordtime as sub_recordtime
|
||||
from record_electricalinspection a
|
||||
left join detail_electricalinspection b on b.uuid = a.testdata
|
||||
where a.uuid = #{uuid}
|
||||
</select>
|
||||
|
||||
<insert id="insertRecordElectricalInspection" parameterType="RecordElectricalInspection">
|
||||
insert into record_electricalinspection
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="uuid != null">uuid,</if>
|
||||
<if test="result != null">result,</if>
|
||||
<if test="barcode != null">barcode,</if>
|
||||
<if test="testTime != null">testtime,</if>
|
||||
<if test="testData != null">testdata,</if>
|
||||
<if test="recordTime != null">recordtime,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="uuid != null">#{uuid},</if>
|
||||
<if test="result != null">#{result},</if>
|
||||
<if test="barcode != null">#{barcode},</if>
|
||||
<if test="testTime != null">#{testTime},</if>
|
||||
<if test="testData != null">#{testData},</if>
|
||||
<if test="recordTime != null">#{recordTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRecordElectricalInspection" parameterType="RecordElectricalInspection">
|
||||
update record_electricalinspection
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="result != null">result = #{result},</if>
|
||||
<if test="barcode != null">barcode = #{barcode},</if>
|
||||
<if test="testTime != null">testtime = #{testTime},</if>
|
||||
<if test="testData != null">testdata = #{testData},</if>
|
||||
<if test="recordTime != null">recordtime = #{recordTime},</if>
|
||||
</trim>
|
||||
where uuid = #{uuid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRecordElectricalInspectionByUuid" parameterType="String">
|
||||
delete
|
||||
from record_electricalinspection
|
||||
where uuid = #{uuid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRecordElectricalInspectionByUuids" parameterType="String">
|
||||
delete from record_electricalinspection where uuid in
|
||||
<foreach item="uuid" collection="array" open="(" separator="," close=")">
|
||||
#{uuid}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDetailElectricalinspectionByUuids" parameterType="String">
|
||||
delete from detail_electricalinspection where uuid in
|
||||
<foreach item="uuid" collection="array" open="(" separator="," close=")">
|
||||
#{uuid}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDetailElectricalinspectionByUuid" parameterType="String">
|
||||
delete
|
||||
from detail_electricalinspection
|
||||
where uuid = #{uuid}
|
||||
</delete>
|
||||
|
||||
<insert id="batchDetailElectricalinspection">
|
||||
insert all
|
||||
<foreach item="item" index="index" collection="list">
|
||||
into detail_electricalinspection( uuid, serialnumber, projectname, testcondition, testvalue, testresult,
|
||||
recordtime) values ( #{item.uuid}, #{item.serialnumber}, #{item.projectname}, #{item.testcondition},
|
||||
#{item.testvalue}, #{item.testresult}, #{item.recordtime})
|
||||
</foreach>
|
||||
SELECT 1 FROM DUAL
|
||||
</insert>
|
||||
</mapper>
|
Loading…
Reference in New Issue