Browse Source

1丶导出陈哥要的表格

2丶月调整单
develop
bobol 10 months ago
parent
commit
0f318d523c
  1. 2
      lzbi-admin/src/main/resources/application-test.yml
  2. 45
      lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiDayPlanBillMasterService.java
  3. 1
      lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiMonthPlanBillMasterService.java
  4. 2
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetAdjustDayMasterController.java
  5. 131
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetAdjustMonthMasterController.java
  6. 10
      lzbi-module/src/main/java/com/lzbi/draft/controller/ReportController.java
  7. 105
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetAdjustMonthMaster.java
  8. 86
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetAdjustMonthSub.java
  9. 63
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetAdjustMonthMasterMapper.java
  10. 63
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetAdjustMonthSubMapper.java
  11. 91
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustMonthMasterService.java
  12. 91
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustMonthSubService.java
  13. 115
      lzbi-module/src/main/java/com/lzbi/task/service/WorkParamReadService.java
  14. 0
      lzbi-module/src/main/resources/mapper/draft/DcBusiTargetAdjustDayMasterMapper.xml
  15. 0
      lzbi-module/src/main/resources/mapper/draft/DcBusiTargetAdjustDaySubMapper.xml
  16. 148
      lzbi-module/src/main/resources/mapper/draft/DcBusiTargetAdjustMonthMasterMapper.xml
  17. 128
      lzbi-module/src/main/resources/mapper/draft/DcBusiTargetAdjustMonthSubMapper.xml

2
lzbi-admin/src/main/resources/application-test.yml

@ -99,6 +99,8 @@ spring:
password: 123456 password: 123456
primary: master primary: master
luenmeilz: luenmeilz:
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
profile: /data/luenmeilz_bi_backend/upload
#视频设备监控地址 #视频设备监控地址
vedio-server: vedio-server:
url: http://10.10.10.40:18000 url: http://10.10.10.40:18000

45
lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiDayPlanBillMasterService.java

@ -15,13 +15,18 @@ import com.lzbi.system.service.impl.SysDeptServiceImpl;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget; import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper; import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 计划单据主Service业务层处理 * 计划单据主Service业务层处理
@ -58,11 +63,11 @@ public class DcBusiDayPlanBillMasterService extends ServiceImpl<DcBusiDayPlanBil
DcBusiDayPlanBillMaster dcBusiDayPlanBillMaster = baseMapper.selectDcBusiPlanBillMasterByBillNo(billNo); DcBusiDayPlanBillMaster dcBusiDayPlanBillMaster = baseMapper.selectDcBusiPlanBillMasterByBillNo(billNo);
DcBusiDayPlanBillSub params = new DcBusiDayPlanBillSub(); DcBusiDayPlanBillSub params = new DcBusiDayPlanBillSub();
params.setBillNo(billNo); params.setBillNo(billNo);
List<DcBusiDayPlanBillSub> dcBusiDayPlanBillSubs = dcBusiDayPlanBillSubMapper.selectDcBusiPlanBillSubList(params); List<DcBusiDayPlanBillSub> subList = dcBusiDayPlanBillSubMapper.selectDcBusiPlanBillSubList(params);
if (!CollectionUtils.isEmpty(dcBusiDayPlanBillSubs)) { if (!CollectionUtils.isEmpty(subList)) {
dcBusiDayPlanBillMaster.setDcBusiDayPlanBillSubList(dcBusiDayPlanBillSubs); dcBusiDayPlanBillMaster.setDcBusiDayPlanBillSubList(subList);
dcBusiDayPlanBillMaster.setFieldCode(dcBusiDayPlanBillSubs.get(0).getFieldCode()); dcBusiDayPlanBillMaster.setFieldCode(subList.get(0).getFieldCode());
dcBusiDayPlanBillMaster.setFieldName(dcBusiDayPlanBillSubs.get(0).getFieldName()); dcBusiDayPlanBillMaster.setFieldName(subList.get(0).getFieldName());
} }
return dcBusiDayPlanBillMaster; return dcBusiDayPlanBillMaster;
} }
@ -158,7 +163,7 @@ public class DcBusiDayPlanBillMasterService extends ServiceImpl<DcBusiDayPlanBil
dcBusiTargetDraftDaynew.setTargetCode(subList.get(i).getTargetCode()); dcBusiTargetDraftDaynew.setTargetCode(subList.get(i).getTargetCode());
dcBusiTargetDraftDaynew.setDateYear(subList.get(i).getDateYear()); dcBusiTargetDraftDaynew.setDateYear(subList.get(i).getDateYear());
dcBusiTargetDraftDaynew.setDateMonth(subList.get(i).getDateMonth()); dcBusiTargetDraftDaynew.setDateMonth(subList.get(i).getDateMonth());
dcBusiTargetDraftDaynew.setDateDay(subList.get(i).getDateDay()); dcBusiTargetDraftDaynew.setDateDay(StringUtils.leftPad(subList.get(i).getDateDay(), 2, "0"));
List<DcBusiTargetDraftDaynew> dcBusiTargetDraftDaynews = dcBusiTargetDraftDaynewMapper.selectDcBusiTargetDraftDaynewList(dcBusiTargetDraftDaynew); List<DcBusiTargetDraftDaynew> dcBusiTargetDraftDaynews = dcBusiTargetDraftDaynewMapper.selectDcBusiTargetDraftDaynewList(dcBusiTargetDraftDaynew);
// 如果底稿表数据为空,则新增底稿数据,否则,加上计划值修改 // 如果底稿表数据为空,则新增底稿数据,否则,加上计划值修改
if (CollectionUtils.isEmpty(dcBusiTargetDraftDaynews)) { if (CollectionUtils.isEmpty(dcBusiTargetDraftDaynews)) {
@ -175,7 +180,7 @@ public class DcBusiDayPlanBillMasterService extends ServiceImpl<DcBusiDayPlanBil
dcBusiTargetDraftDaynewMapper.insertDcBusiTargetDraftDaynew(dcBusiTargetDraftDaynew); dcBusiTargetDraftDaynewMapper.insertDcBusiTargetDraftDaynew(dcBusiTargetDraftDaynew);
} else { } else {
dcBusiTargetDraftDaynew = dcBusiTargetDraftDaynews.get(0); dcBusiTargetDraftDaynew = dcBusiTargetDraftDaynews.get(0);
dcBusiTargetDraftDaynew.setValuePlan(dcBusiTargetDraftDaynew.getValuePlan().add(subList.get(i).getPlanValue())); dcBusiTargetDraftDaynew.setValuePlan(subList.get(i).getPlanValue());
dcBusiTargetDraftDaynewMapper.updateDcBusiTargetDraftDaynew(dcBusiTargetDraftDaynew); dcBusiTargetDraftDaynewMapper.updateDcBusiTargetDraftDaynew(dcBusiTargetDraftDaynew);
} }
} }
@ -197,32 +202,6 @@ public class DcBusiDayPlanBillMasterService extends ServiceImpl<DcBusiDayPlanBil
if ("1".equals(master.getCheckStatus())) { if ("1".equals(master.getCheckStatus())) {
throw new RuntimeException("反审核失败,单据未审核通过"); throw new RuntimeException("反审核失败,单据未审核通过");
} }
// 如果单据状态为已审核状态,需要把底稿表数据恢复
if ("2".equals(master.getCheckStatus())) {
// 查询子表数据
DcBusiDayPlanBillSub subParams = new DcBusiDayPlanBillSub();
subParams.setBillNo(billNo);
List<DcBusiDayPlanBillSub> subList = dcBusiDayPlanBillSubMapper.selectDcBusiPlanBillSubList(subParams);
DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew;
for (int i = 0, len = subList.size(); i < len; i++) {
dcBusiTargetDraftDaynew = new DcBusiTargetDraftDaynew();
dcBusiTargetDraftDaynew.setCompanyId(master.getCompanyId());
dcBusiTargetDraftDaynew.setOrganizeId(master.getOragnizeId());
dcBusiTargetDraftDaynew.setFieldCode(subList.get(i).getFieldCode());
dcBusiTargetDraftDaynew.setAssetCode(subList.get(i).getAssetCode());
dcBusiTargetDraftDaynew.setTargetCode(subList.get(i).getTargetCode());
dcBusiTargetDraftDaynew.setDateYear(subList.get(i).getDateYear());
dcBusiTargetDraftDaynew.setDateMonth(subList.get(i).getDateMonth());
dcBusiTargetDraftDaynew.setDateDay(subList.get(i).getDateDay());
List<DcBusiTargetDraftDaynew> dcBusiTargetDraftDaynews = dcBusiTargetDraftDaynewMapper.selectDcBusiTargetDraftDaynewList(dcBusiTargetDraftDaynew);
// 如果底稿表数据不为空,则减去计划值
if (!CollectionUtils.isEmpty(dcBusiTargetDraftDaynews)) {
dcBusiTargetDraftDaynew = dcBusiTargetDraftDaynews.get(0);
dcBusiTargetDraftDaynew.setValuePlan(dcBusiTargetDraftDaynew.getValuePlan().subtract(subList.get(i).getPlanValue()));
dcBusiTargetDraftDaynewMapper.updateDcBusiTargetDraftDaynew(dcBusiTargetDraftDaynew);
}
}
}
master.setUpdatedBy(SecurityUtils.getUsername()); master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate()); master.setCreatedTime(DateUtils.getNowDate());
master.setBillNo(billNo); master.setBillNo(billNo);

1
lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiMonthPlanBillMasterService.java

@ -91,6 +91,7 @@ public class DcBusiMonthPlanBillMasterService extends ServiceImpl<DcBusiMonthPla
public int insertDcBusiMonthPlanBillMaster(DcBusiMonthPlanBillMaster dcBusiMonthPlanBillMaster) public int insertDcBusiMonthPlanBillMaster(DcBusiMonthPlanBillMaster dcBusiMonthPlanBillMaster)
{ {
DcBusiMonthPlanBillMaster params = new DcBusiMonthPlanBillMaster(); DcBusiMonthPlanBillMaster params = new DcBusiMonthPlanBillMaster();
params.setBillNo(dcBusiMonthPlanBillMaster.getBillNo());
List<DcBusiMonthPlanBillMaster> dcBusiMonthPlanBillMasters = baseMapper.selectDcBusiMonthPlanBillMasterList(params); List<DcBusiMonthPlanBillMaster> dcBusiMonthPlanBillMasters = baseMapper.selectDcBusiMonthPlanBillMasterList(params);
if (!CollectionUtils.isEmpty(dcBusiMonthPlanBillMasters)) { if (!CollectionUtils.isEmpty(dcBusiMonthPlanBillMasters)) {
throw new RuntimeException("单据号已存在,请重新获取"); throw new RuntimeException("单据号已存在,请重新获取");

2
lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetAdjustDayMasterController.java

@ -26,7 +26,7 @@ import java.util.List;
* @author lienbo * @author lienbo
* @date 2023-12-05 * @date 2023-12-05
*/ */
@Api(value = "资产指标调整单",tags = "资产指标调整单") @Api(value = "资产指标调整单",tags = "资产指标调整单")
@RestController @RestController
@RequestMapping("/asset/targetDayAdjustBill") @RequestMapping("/asset/targetDayAdjustBill")
public class DcBusiTargetAdjustDayMasterController extends BaseController public class DcBusiTargetAdjustDayMasterController extends BaseController

131
lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetAdjustMonthMasterController.java

@ -0,0 +1,131 @@
package com.lzbi.draft.controller;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.lzbi.common.annotation.Log;
import com.lzbi.common.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.enums.BusinessType;
import com.lzbi.draft.domain. DcBusiTargetAdjustMonthMaster;
import com.lzbi.draft.service.DcBusiTargetAdjustMonthMasterService;
import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo;
/**
* 指标月调整单Controller
*
* @author lienbo
* @date 2024-01-03
*/
@RestController
@RequestMapping("/asset/targetMonthAdjustBill")
public class DcBusiTargetAdjustMonthMasterController extends BaseController
{
@Autowired
private DcBusiTargetAdjustMonthMasterService dcBusiTargetAdjustMonthMasterService;
/**
* 查询指标月调整单列表
*/
@ApiOperation("查询指标月调整单列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetAdjustMonthMaster", value = "", dataType = "DcBusiTargetAdjustMonthMaster", dataTypeClass = DcBusiTargetAdjustMonthMaster.class),
})
@PreAuthorize("@ss.hasPermi('draft:targetMonthAdjustBill:list')")
@GetMapping("/list")
public TableDataInfo list(DcBusiTargetAdjustMonthMaster DcBusiTargetAdjustMonthMaster)
{
startPage();
List< DcBusiTargetAdjustMonthMaster> list = dcBusiTargetAdjustMonthMasterService.selectDcBusiTargetAdjustMonthMasterList(DcBusiTargetAdjustMonthMaster);
return getDataTable(list);
}
/**
* 导出指标月调整单列表
*/
@ApiOperation("导出指标月调整单列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetAdjustMonthMaster", value = "", dataType = "DcBusiTargetAdjustMonthMaster", dataTypeClass = DcBusiTargetAdjustMonthMaster.class),
})
@PreAuthorize("@ss.hasPermi('draft:targetMonthAdjustBill:export')")
@Log(title = "指标月调整单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response,DcBusiTargetAdjustMonthMaster DcBusiTargetAdjustMonthMaster)
{
List<DcBusiTargetAdjustMonthMaster> list = dcBusiTargetAdjustMonthMasterService.selectDcBusiTargetAdjustMonthMasterList(DcBusiTargetAdjustMonthMaster);
ExcelUtil<DcBusiTargetAdjustMonthMaster> util = new ExcelUtil<DcBusiTargetAdjustMonthMaster>(DcBusiTargetAdjustMonthMaster.class);
util.exportExcel(response, list, "指标月调整单数据");
}
/**
* 获取指标月调整单详细信息
*/
@ApiOperation("获取指标月调整单详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class),
})
@PreAuthorize("@ss.hasPermi('draft:targetMonthAdjustBill:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(dcBusiTargetAdjustMonthMasterService.selectDcBusiTargetAdjustMonthMasterById(id));
}
/**
* 新增指标月调整单
*/
@ApiOperation("新增指标月调整单")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetAdjustMonthMaster", value = "", dataType = "DcBusiTargetAdjustMonthMaster", dataTypeClass = DcBusiTargetAdjustMonthMaster.class),
})
@PreAuthorize("@ss.hasPermi('draft:targetMonthAdjustBill:add')")
@Log(title = "指标月调整单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcBusiTargetAdjustMonthMaster DcBusiTargetAdjustMonthMaster)
{
return toAjax(dcBusiTargetAdjustMonthMasterService.insertDcBusiTargetAdjustMonthMaster(DcBusiTargetAdjustMonthMaster));
}
/**
* 修改指标月调整单
*/
@ApiOperation("修改指标月调整单")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetAdjustMonthMaster", value = "", dataType = "DcBusiTargetAdjustMonthMaster", dataTypeClass = DcBusiTargetAdjustMonthMaster.class),
})
@PreAuthorize("@ss.hasPermi('draft:targetMonthAdjustBill:edit')")
@Log(title = "指标月调整单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcBusiTargetAdjustMonthMaster DcBusiTargetAdjustMonthMaster)
{
return toAjax(dcBusiTargetAdjustMonthMasterService.updateDcBusiTargetAdjustMonthMaster(DcBusiTargetAdjustMonthMaster));
}
/**
* 删除指标月调整单
*/
@ApiOperation("删除指标月调整单")
@ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class),
})
@PreAuthorize("@ss.hasPermi('draft:targetMonthAdjustBill:remove')")
@Log(title = "指标月调整单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcBusiTargetAdjustMonthMasterService.deleteDcBusiTargetAdjustMonthMasterByIds(ids));
}
}

10
lzbi-module/src/main/java/com/lzbi/draft/controller/ReportController.java

@ -12,6 +12,7 @@ import com.lzbi.draft.service.ReportService;
import com.lzbi.task.domain.*; import com.lzbi.task.domain.*;
import com.lzbi.task.service.WorkParamReadService; import com.lzbi.task.service.WorkParamReadService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -87,8 +88,8 @@ public class ReportController extends BaseController {
} catch (InterruptedException e) { } catch (InterruptedException e) {
log.error("门闩异常", e); log.error("门闩异常", e);
} }
String fileName = "/数据报表_" + System.currentTimeMillis() + ".xlsx"; String fileName = "数据报表_" + readQueryReq.getBeginTime() + "~" + readQueryReq.getEndTime() + "_" + System.currentTimeMillis() + ".xlsx";
String filePath = ruoYiConfig.getProfile() + fileName; String filePath = ruoYiConfig.getProfile() + "/" + fileName;
log.info("文件路径:{}", filePath); log.info("文件路径:{}", filePath);
// 导出文件 // 导出文件
File file = new File(filePath); File file = new File(filePath);
@ -133,7 +134,7 @@ public class ReportController extends BaseController {
try { try {
inputStream = new FileInputStream(file); inputStream = new FileInputStream(file);
bos = new ByteArrayOutputStream(1024); bos = new ByteArrayOutputStream(1024);
int len = -1; int len;
byte[] b = new byte[1024]; byte[] b = new byte[1024];
while ((len = inputStream.read(b)) != -1) { while ((len = inputStream.read(b)) != -1) {
bos.write(b, 0, len); bos.write(b, 0, len);
@ -164,6 +165,7 @@ public class ReportController extends BaseController {
/** /**
* 获取数据 * 获取数据
*
* @param readQueryReq * @param readQueryReq
* @return * @return
*/ */
@ -174,6 +176,7 @@ public class ReportController extends BaseController {
/** /**
* 获取数据 * 获取数据
*
* @param readQueryReq * @param readQueryReq
* @return * @return
*/ */
@ -184,6 +187,7 @@ public class ReportController extends BaseController {
/** /**
* 获取小时天气 * 获取小时天气
*
* @param readQueryReq * @param readQueryReq
* @return * @return
*/ */

105
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetAdjustMonthMaster.java

@ -0,0 +1,105 @@
package com.lzbi.draft.domain;
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 lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import lombok.experimental.Accessors;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
/**
* 指标月调整单对象 dc_busi_target_adjust_month_master
*
* @author lienbo
* @date 2024-01-03
*/
@Data
@Accessors(chain = true)
public class DcBusiTargetAdjustMonthMaster extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 单据号 */
@Excel(name = "单据号")
@ApiModelProperty(name = "单据号",notes = "billSerial")
private String billSerial;
/** 单据类别 */
@Excel(name = "单据类别")
@ApiModelProperty(name = "单据类别",notes = "biilType")
private String biilType;
/** 公司ID */
@Excel(name = "公司ID")
@ApiModelProperty(name = "公司ID",notes = "companyId")
private Long companyId;
/** 公司名称 */
@Excel(name = "公司名称")
@ApiModelProperty(name = "公司名称",notes = "companyName")
private String companyName;
/** 组织机构名称 */
@Excel(name = "组织机构名称")
@ApiModelProperty(name = "组织机构名称",notes = "organizeName")
private String organizeName;
/** 组织机构ID */
@Excel(name = "组织机构ID")
@ApiModelProperty(name = "组织机构ID",notes = "oragnizeId")
private Long oragnizeId;
/** 统计单元编码 */
@Excel(name = "统计单元编码")
@ApiModelProperty(name = "统计单元编码",notes = "assetCode")
private String assetCode;
/** 统计单元名称 */
@Excel(name = "统计单元名称")
@ApiModelProperty(name = "统计单元名称",notes = "assetName")
private String assetName;
/** 统计专业代码 */
@Excel(name = "统计专业代码")
@ApiModelProperty(name = "统计专业代码",notes = "fieldCode")
private String fieldCode;
/** 统计专业名称 */
@Excel(name = "统计专业名称")
@ApiModelProperty(name = "统计专业名称",notes = "fieldName")
private String fieldName;
/** 主键 */
private Long id;
/** 调整目标日期 */
@Excel(name = "调整目标日期")
@ApiModelProperty(name = "调整目标日期",notes = "dateAdjust")
private String dateAdjust;
/** 创建人 */
private String createdBy;
/** 创建时间 */
private Date createdTime;
/** 更新人 */
private String updatedBy;
/** 更新时间 */
private Date updatedTime;
/** 审核状态;0待审核 1 已经审核 2已处理 */
@Excel(name = "审核状态;0待审核 1 已经审核 2已处理")
@ApiModelProperty(name = "审核状态;0待审核 1 已经审核 2已处理",notes = "checkStatus")
private String checkStatus;
/** 审核类型;1人工2自动 */
@Excel(name = "审核类型;1人工2自动")
@ApiModelProperty(name = "审核类型;1人工2自动",notes = "checkType")
private String checkType;
}

86
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetAdjustMonthSub.java

@ -0,0 +1,86 @@
package com.lzbi.draft.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 lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import lombok.experimental.Accessors;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
/**
* 统计单元指标调整单子()对象 dc_busi_target_adjust_month_sub
*
* @author lienbo
* @date 2024-01-03
*/
@Data
@Accessors(chain = true)
public class DcBusiTargetAdjustMonthSub extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 创建人 */
private String createdBy;
/** 创建时间 */
private Date createdTime;
/** 更新人 */
private String updatedBy;
/** 更新时间 */
private Date updatedTime;
/** 主键 */
private Long id;
/** 主单据编号 */
@Excel(name = "主单据编号")
@ApiModelProperty(name = "主单据编号",notes = "billNoMaster")
private String billNoMaster;
/** 指标编码 */
@Excel(name = "指标编码")
@ApiModelProperty(name = "指标编码",notes = "targetCode")
private String targetCode;
/** 指标名称 */
@Excel(name = "指标名称")
@ApiModelProperty(name = "指标名称",notes = "targetName")
private String targetName;
/** 指标单位 */
@Excel(name = "指标单位")
@ApiModelProperty(name = "指标单位",notes = "tagetUnit")
private String tagetUnit;
/** 日期调整日期 */
@Excel(name = "日期调整日期")
@ApiModelProperty(name = "日期调整日期",notes = "adjustDate")
private String adjustDate;
/** 调整时间 */
@Excel(name = "调整时间")
@ApiModelProperty(name = "调整时间",notes = "adjstTime")
private Long adjstTime;
/** 原值 */
@Excel(name = "原值")
@ApiModelProperty(name = "原值",notes = "valOrigin")
private BigDecimal valOrigin;
/** 调整值 */
@Excel(name = "调整值")
@ApiModelProperty(name = "调整值",notes = "valAdjust")
private BigDecimal valAdjust;
/** 结果值 */
@Excel(name = "结果值")
@ApiModelProperty(name = "结果值",notes = "valResult")
private BigDecimal valResult;
}

63
lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetAdjustMonthMasterMapper.java

@ -0,0 +1,63 @@
package com.lzbi.draft.mapper;
import java.util.List;
import com.lzbi.draft.domain.DcBusiTargetAdjustMonthMaster;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 指标月调整单Mapper接口
*
* @author lienbo
* @date 2024-01-03
*/
public interface DcBusiTargetAdjustMonthMasterMapper extends BaseMapper<DcBusiTargetAdjustMonthMaster>
{
/**
* 查询指标月调整单
*
* @param id 指标月调整单主键
* @return 指标月调整单
*/
public DcBusiTargetAdjustMonthMaster selectDcBusiTargetAdjustMonthMasterById(Long id);
/**
* 查询指标月调整单列表
*
* @param dcBusiTargetAdjustMonthMaster 指标月调整单
* @return 指标月调整单集合
*/
public List<DcBusiTargetAdjustMonthMaster> selectDcBusiTargetAdjustMonthMasterList(DcBusiTargetAdjustMonthMaster dcBusiTargetAdjustMonthMaster);
/**
* 新增指标月调整单
*
* @param dcBusiTargetAdjustMonthMaster 指标月调整单
* @return 结果
*/
public int insertDcBusiTargetAdjustMonthMaster(DcBusiTargetAdjustMonthMaster dcBusiTargetAdjustMonthMaster);
/**
* 修改指标月调整单
*
* @param dcBusiTargetAdjustMonthMaster 指标月调整单
* @return 结果
*/
public int updateDcBusiTargetAdjustMonthMaster(DcBusiTargetAdjustMonthMaster dcBusiTargetAdjustMonthMaster);
/**
* 删除指标月调整单
*
* @param id 指标月调整单主键
* @return 结果
*/
public int deleteDcBusiTargetAdjustMonthMasterById(Long id);
/**
* 批量删除指标月调整单
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiTargetAdjustMonthMasterByIds(Long[] ids);
}

63
lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetAdjustMonthSubMapper.java

@ -0,0 +1,63 @@
package com.lzbi.draft.mapper;
import java.util.List;
import com.lzbi.draft.domain.DcBusiTargetAdjustMonthSub;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 统计单元指标调整单子()Mapper接口
*
* @author lienbo
* @date 2024-01-03
*/
public interface DcBusiTargetAdjustMonthSubMapper extends BaseMapper<DcBusiTargetAdjustMonthSub>
{
/**
* 查询统计单元指标调整单子()
*
* @param id 统计单元指标调整单子()主键
* @return 统计单元指标调整单子()
*/
public DcBusiTargetAdjustMonthSub selectDcBusiTargetAdjustMonthSubById(Long id);
/**
* 查询统计单元指标调整单子()列表
*
* @param dcBusiTargetAdjustMonthSub 统计单元指标调整单子()
* @return 统计单元指标调整单子()集合
*/
public List<DcBusiTargetAdjustMonthSub> selectDcBusiTargetAdjustMonthSubList(DcBusiTargetAdjustMonthSub dcBusiTargetAdjustMonthSub);
/**
* 新增统计单元指标调整单子()
*
* @param dcBusiTargetAdjustMonthSub 统计单元指标调整单子()
* @return 结果
*/
public int insertDcBusiTargetAdjustMonthSub(DcBusiTargetAdjustMonthSub dcBusiTargetAdjustMonthSub);
/**
* 修改统计单元指标调整单子()
*
* @param dcBusiTargetAdjustMonthSub 统计单元指标调整单子()
* @return 结果
*/
public int updateDcBusiTargetAdjustMonthSub(DcBusiTargetAdjustMonthSub dcBusiTargetAdjustMonthSub);
/**
* 删除统计单元指标调整单子()
*
* @param id 统计单元指标调整单子()主键
* @return 结果
*/
public int deleteDcBusiTargetAdjustMonthSubById(Long id);
/**
* 批量删除统计单元指标调整单子()
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiTargetAdjustMonthSubByIds(Long[] ids);
}

91
lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustMonthMasterService.java

@ -0,0 +1,91 @@
package com.lzbi.draft.service;
import java.util.List;
import com.lzbi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.lzbi.draft.domain.DcBusiTargetAdjustMonthMaster;
import com.lzbi.draft.mapper.DcBusiTargetAdjustMonthMasterMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 指标月调整单Service业务层处理
*
* @author lienbo
* @date 2024-01-03
*/
@Service
public class DcBusiTargetAdjustMonthMasterService extends ServiceImpl<DcBusiTargetAdjustMonthMasterMapper, DcBusiTargetAdjustMonthMaster> implements IService<DcBusiTargetAdjustMonthMaster>
{
/**
* 查询指标月调整单
*
* @param id 指标月调整单主键
* @return 指标月调整单
*/
public DcBusiTargetAdjustMonthMaster selectDcBusiTargetAdjustMonthMasterById(Long id)
{
return baseMapper.selectDcBusiTargetAdjustMonthMasterById(id);
}
/**
* 查询指标月调整单列表
*
* @param dcBusiTargetAdjustMonthMaster 指标月调整单
* @return 指标月调整单
*/
public List<DcBusiTargetAdjustMonthMaster> selectDcBusiTargetAdjustMonthMasterList(DcBusiTargetAdjustMonthMaster dcBusiTargetAdjustMonthMaster)
{
return baseMapper.selectDcBusiTargetAdjustMonthMasterList(dcBusiTargetAdjustMonthMaster);
}
/**
* 新增指标月调整单
*
* @param dcBusiTargetAdjustMonthMaster 指标月调整单
* @return 结果
*/
public int insertDcBusiTargetAdjustMonthMaster(DcBusiTargetAdjustMonthMaster dcBusiTargetAdjustMonthMaster)
{
dcBusiTargetAdjustMonthMaster.setCreatedTime(DateUtils.getNowDate());
return baseMapper.insertDcBusiTargetAdjustMonthMaster(dcBusiTargetAdjustMonthMaster);
}
/**
* 修改指标月调整单
*
* @param dcBusiTargetAdjustMonthMaster 指标月调整单
* @return 结果
*/
public int updateDcBusiTargetAdjustMonthMaster(DcBusiTargetAdjustMonthMaster dcBusiTargetAdjustMonthMaster)
{
dcBusiTargetAdjustMonthMaster.setUpdatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBusiTargetAdjustMonthMaster(dcBusiTargetAdjustMonthMaster);
}
/**
* 批量删除指标月调整单
*
* @param ids 需要删除的指标月调整单主键
* @return 结果
*/
public int deleteDcBusiTargetAdjustMonthMasterByIds(Long[] ids)
{
return baseMapper.deleteDcBusiTargetAdjustMonthMasterByIds(ids);
}
/**
* 删除指标月调整单信息
*
* @param id 指标月调整单主键
* @return 结果
*/
public int deleteDcBusiTargetAdjustMonthMasterById(Long id)
{
return baseMapper.deleteDcBusiTargetAdjustMonthMasterById(id);
}
}

91
lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustMonthSubService.java

@ -0,0 +1,91 @@
package com.lzbi.draft.service;
import java.util.List;
import com.lzbi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.lzbi.draft.domain.DcBusiTargetAdjustMonthSub;
import com.lzbi.draft.mapper.DcBusiTargetAdjustMonthSubMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 统计单元指标调整单子()Service业务层处理
*
* @author lienbo
* @date 2024-01-03
*/
@Service
public class DcBusiTargetAdjustMonthSubService extends ServiceImpl<DcBusiTargetAdjustMonthSubMapper, DcBusiTargetAdjustMonthSub> implements IService<DcBusiTargetAdjustMonthSub>
{
/**
* 查询统计单元指标调整单子()
*
* @param id 统计单元指标调整单子()主键
* @return 统计单元指标调整单子()
*/
public DcBusiTargetAdjustMonthSub selectDcBusiTargetAdjustMonthSubById(Long id)
{
return baseMapper.selectDcBusiTargetAdjustMonthSubById(id);
}
/**
* 查询统计单元指标调整单子()列表
*
* @param dcBusiTargetAdjustMonthSub 统计单元指标调整单子()
* @return 统计单元指标调整单子()
*/
public List<DcBusiTargetAdjustMonthSub> selectDcBusiTargetAdjustMonthSubList(DcBusiTargetAdjustMonthSub dcBusiTargetAdjustMonthSub)
{
return baseMapper.selectDcBusiTargetAdjustMonthSubList(dcBusiTargetAdjustMonthSub);
}
/**
* 新增统计单元指标调整单子()
*
* @param dcBusiTargetAdjustMonthSub 统计单元指标调整单子()
* @return 结果
*/
public int insertDcBusiTargetAdjustMonthSub(DcBusiTargetAdjustMonthSub dcBusiTargetAdjustMonthSub)
{
dcBusiTargetAdjustMonthSub.setCreatedTime(DateUtils.getNowDate());
return baseMapper.insertDcBusiTargetAdjustMonthSub(dcBusiTargetAdjustMonthSub);
}
/**
* 修改统计单元指标调整单子()
*
* @param dcBusiTargetAdjustMonthSub 统计单元指标调整单子()
* @return 结果
*/
public int updateDcBusiTargetAdjustMonthSub(DcBusiTargetAdjustMonthSub dcBusiTargetAdjustMonthSub)
{
dcBusiTargetAdjustMonthSub.setUpdatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBusiTargetAdjustMonthSub(dcBusiTargetAdjustMonthSub);
}
/**
* 批量删除统计单元指标调整单子()
*
* @param ids 需要删除的统计单元指标调整单子()主键
* @return 结果
*/
public int deleteDcBusiTargetAdjustMonthSubByIds(Long[] ids)
{
return baseMapper.deleteDcBusiTargetAdjustMonthSubByIds(ids);
}
/**
* 删除统计单元指标调整单子()信息
*
* @param id 统计单元指标调整单子()主键
* @return 结果
*/
public int deleteDcBusiTargetAdjustMonthSubById(Long id)
{
return baseMapper.deleteDcBusiTargetAdjustMonthSubById(id);
}
}

115
lzbi-module/src/main/java/com/lzbi/task/service/WorkParamReadService.java

@ -63,13 +63,13 @@ public class WorkParamReadService extends ServiceImpl<WorkParamReadMapper, WorkP
} }
private List<String> splitByDay(String startDateStr, String endDateStr) { private List<String> splitByDay(String startDateStr, String endDateStr) {
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH"); DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDateTime startDate = LocalDateTime.parse(startDateStr, dateTimeFormatter); LocalDate startDate = LocalDate.parse(startDateStr, dateTimeFormatter);
LocalDateTime endDate = LocalDateTime.parse(endDateStr, dateTimeFormatter); LocalDate endDate = LocalDate.parse(endDateStr, dateTimeFormatter);
List<String> dateRange = new ArrayList<>(); List<String> dateRange = new ArrayList<>();
while (!startDate.isAfter(endDate)) { while (!startDate.isAfter(endDate)) {
dateRange.add(dateTimeFormatter.format(startDate)); dateRange.add(dateTimeFormatter.format(startDate));
startDate = startDate.plusDays(7); startDate = startDate.plusDays(2);
} }
dateRange.add(endDateStr); dateRange.add(endDateStr);
return dateRange; return dateRange;
@ -81,43 +81,62 @@ public class WorkParamReadService extends ServiceImpl<WorkParamReadMapper, WorkP
Field[] fields = clazz.getDeclaredFields(); Field[] fields = clazz.getDeclaredFields();
String[] DEVICE_CODE_ARR = new String[]{"00011","00053","00054","00050","00055","00051","00052","00059","00056","00057","00022","00023","00024","00009","00058","00026","00029","00030","00031","00032","00044","00013","00007","00017","00046","00042","00019","00016","00001","00028","00045","00021","00010","00041","00015","00014","00005","00006","00002","00003","00004","00008","00018","00027","00043","00020","00040"}; String[] DEVICE_CODE_ARR = new String[]{"00011","00053","00054","00050","00055","00051","00052","00059","00056","00057","00022","00023","00024","00009","00058","00026","00029","00030","00031","00032","00044","00013","00007","00017","00046","00042","00019","00016","00001","00028","00045","00021","00010","00041","00015","00014","00005","00006","00002","00003","00004","00008","00018","00027","00043","00020","00040"};
String[] PARAM_CODE_ARR = new String[]{"007", "009", "011", "012", "013", "014", "045", "046", "047", "048", "001", "002"}; String[] PARAM_CODE_ARR = new String[]{"007", "009", "011", "012", "013", "014", "045", "046", "047", "048", "001", "002"};
Vector<WorkDataDTO> workDataDTOS = new Vector(); long beginTime = System.currentTimeMillis();
int size = DEVICE_CODE_ARR.length;
int SIGN = 10; readQueryReq.setParamCodes(Arrays.asList(PARAM_CODE_ARR));
CountDownLatch countDownLatch = new CountDownLatch(SIGN); readQueryReq.setDeviceCodes(Arrays.asList(DEVICE_CODE_ARR));
AtomicInteger index = new AtomicInteger(0); List<WorkDataDTO> workDataDTOS = multipDeviceReadService.getMultipleDeviceData(readQueryReq);
log.info("查询起始时间:{}", System.currentTimeMillis());
for (int i = 0, sign = SIGN; i < sign && i < size; i++) { // int size = DEVICE_CODE_ARR.length;
CountDownLatch finalCountDownLatch = countDownLatch; // ReadQueryReq req;
threadPoolTaskExecutor.execute(() -> { // for (int i = 0; i < size; i++) {
int ii = index.getAndAdd(1); // for (int j = 0, len = dateList.size(); j < len - 1; j++) {
log.info("ii = {}", ii); // req = new ReadQueryReq();
ReadQueryReq req = new ReadQueryReq(); // req.setBeginTime(dateList.get(j));
req.setBeginTime(readQueryReq.getBeginTime()); // req.setEndTime(dateList.get(j + 1));
req.setEndTime(readQueryReq.getEndTime()); // req.setParamCodes(Arrays.asList(PARAM_CODE_ARR));
req.setParamCodes(Arrays.asList(PARAM_CODE_ARR)); // req.setDeviceCodes(Arrays.asList(DEVICE_CODE_ARR[i]));
req.setDeviceCodes(Arrays.asList(DEVICE_CODE_ARR[ii])); // workDataDTOS.addAll(multipDeviceReadService.getMultipleDeviceData(req));
log.info("{} {} sql执行起始时间 {}", ii, DEVICE_CODE_ARR[ii], System.currentTimeMillis()); // req = null;
workDataDTOS.addAll(multipDeviceReadService.getMultipleDeviceData(req)); // }
log.info("{} {} sql执行结束时间 {}", ii, DEVICE_CODE_ARR[ii], System.currentTimeMillis()); // }
req = null;
finalCountDownLatch.countDown(); // Vector<WorkDataDTO> workDataDTOS = new Vector<>();
}); // int size = DEVICE_CODE_ARR.length;
if (i == sign - 1 || i == size - 1) { // int SIGN = 5;
try { // CountDownLatch countDownLatch = new CountDownLatch(SIGN);
countDownLatch.await(); // AtomicInteger index = new AtomicInteger(0);
int j = size - 1 - i; // for (int i = 0, sign = SIGN; i < sign && i < size; i++) {
if (j < SIGN) { // CountDownLatch finalCountDownLatch = countDownLatch;
SIGN = j; // threadPoolTaskExecutor.execute(() -> {
} // int ii = index.getAndAdd(1);
sign += SIGN; // ReadQueryReq req = new ReadQueryReq();
countDownLatch = new CountDownLatch(SIGN); // req.setBeginTime(readQueryReq.getBeginTime());
} catch (InterruptedException e) { // req.setEndTime(readQueryReq.getEndTime());
log.error("门闩异常", e); // req.setParamCodes(Arrays.asList(PARAM_CODE_ARR));
} // req.setDeviceCodes(Arrays.asList(DEVICE_CODE_ARR[ii]));
} // long startTime = System.currentTimeMillis();
} // workDataDTOS.addAll(multipDeviceReadService.getMultipleDeviceData(req));
log.info("查询结束时间:{}", System.currentTimeMillis()); // log.info("{} {} sql执行时间 {}", ii, DEVICE_CODE_ARR[ii], System.currentTimeMillis() - startTime);
// req = null;
// finalCountDownLatch.countDown();
// });
// if (i == sign - 1 || i == size - 1) {
// try {
// countDownLatch.await();
// int j = size - 1 - i;
// if (j < SIGN) {
// SIGN = j;
// }
// sign += SIGN;
// countDownLatch = new CountDownLatch(SIGN);
// } catch (InterruptedException e) {
// log.error("门闩异常", e);
// }
// }
// }
log.info("查询时间:{}", System.currentTimeMillis() - beginTime);
if (!CollectionUtils.isEmpty(workDataDTOS)) { if (!CollectionUtils.isEmpty(workDataDTOS)) {
Map<String, List<WorkDataDTO>> timeMap = workDataDTOS.stream().collect(Collectors.groupingBy(WorkDataDTO::getThour)); Map<String, List<WorkDataDTO>> timeMap = workDataDTOS.stream().collect(Collectors.groupingBy(WorkDataDTO::getThour));
Set<String> keySet = timeMap.keySet(); Set<String> keySet = timeMap.keySet();
@ -180,6 +199,20 @@ public class WorkParamReadService extends ServiceImpl<WorkParamReadMapper, WorkP
readQueryReq.setDeviceCodes(Arrays.asList(DEVICE_CODE_ARR)); readQueryReq.setDeviceCodes(Arrays.asList(DEVICE_CODE_ARR));
Class<DaTangGuanJingDataVO> clazz = DaTangGuanJingDataVO.class; Class<DaTangGuanJingDataVO> clazz = DaTangGuanJingDataVO.class;
Field[] fields = clazz.getDeclaredFields(); Field[] fields = clazz.getDeclaredFields();
// List<String> dateList = this.splitByDay(readQueryReq.getBeginTime(), readQueryReq.getEndTime());
// List<WorkDataDTO> workDataDTOS = new ArrayList<>();
// ReadQueryReq req;
// for (int j = 0, len = dateList.size(); j < len - 1; j++) {
// req = new ReadQueryReq();
// req.setBeginTime(dateList.get(j));
// req.setEndTime(dateList.get(j + 1));
// req.setParamCodes(Arrays.asList(PARAM_CODE_ARR));
// req.setDeviceCodes(Arrays.asList(DEVICE_CODE_ARR));
// workDataDTOS.addAll(multipDeviceReadService.getMultipleDeviceData(req));
// req = null;
// }
Vector<DaTangGuanJingDataVO> list = new Vector<>(); Vector<DaTangGuanJingDataVO> list = new Vector<>();
List<WorkDataDTO> workDataDTOS = baseMapper.readWorkData2(readQueryReq); List<WorkDataDTO> workDataDTOS = baseMapper.readWorkData2(readQueryReq);
if (!CollectionUtils.isEmpty(workDataDTOS)) { if (!CollectionUtils.isEmpty(workDataDTOS)) {

0
lzbi-module/src/main/resources/mapper/asset/DcBusiTargetAdjustDayMasterMapper.xml → lzbi-module/src/main/resources/mapper/draft/DcBusiTargetAdjustDayMasterMapper.xml

0
lzbi-module/src/main/resources/mapper/asset/DcBusiTargetAdjustDaySubMapper.xml → lzbi-module/src/main/resources/mapper/draft/DcBusiTargetAdjustDaySubMapper.xml

148
lzbi-module/src/main/resources/mapper/draft/DcBusiTargetAdjustMonthMasterMapper.xml

@ -0,0 +1,148 @@
<?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.lzbi.draft.mapper.DcBusiTargetAdjustMonthMasterMapper">
<resultMap type="com.lzbi.draft.domain.DcBusiTargetAdjustMonthMaster" id="DcBusiTargetAdjustMonthMasterResult">
<result property="billSerial" column="bill_serial" />
<result property="biilType" column="biil_type" />
<result property="companyId" column="company_id" />
<result property="companyName" column="company_name" />
<result property="organizeName" column="organize_name" />
<result property="oragnizeId" column="oragnize_id" />
<result property="assetCode" column="asset_code" />
<result property="assetName" column="asset_name" />
<result property="fieldCode" column="field_code" />
<result property="fieldName" column="field_name" />
<result property="id" column="id" />
<result property="dateAdjust" column="date_adjust" />
<result property="tenantId" column="tenant_id" />
<result property="revision" column="revision" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="deleteBy" column="delete_by" />
<result property="deleteTime" column="delete_time" />
<result property="checkStatus" column="check_status" />
<result property="checkType" column="check_type" />
</resultMap>
<sql id="selectDcBusiTargetAdjustMonthMasterVo">
select bill_serial, biil_type, company_id, company_name, organize_name, oragnize_id, asset_code, asset_name, field_code, field_name, id, date_adjust, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, check_status, check_type from dc_busi_target_adjust_month_master
</sql>
<select id="selectDcBusiTargetAdjustMonthMasterList" parameterType="DcBusiTargetAdjustMonthMaster" resultMap="DcBusiTargetAdjustMonthMasterResult">
<include refid="selectDcBusiTargetAdjustMonthMasterVo"/>
<where>
<if test="billSerial != null and billSerial != ''"> and bill_serial = #{billSerial}</if>
<if test="biilType != null and biilType != ''"> and biil_type = #{biilType}</if>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="organizeName != null and organizeName != ''"> and organize_name like concat('%', #{organizeName}, '%')</if>
<if test="oragnizeId != null "> and oragnize_id = #{oragnizeId}</if>
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if>
<if test="assetName != null and assetName != ''"> and asset_name like concat('%', #{assetName}, '%')</if>
<if test="fieldCode != null and fieldCode != ''"> and field_code = #{fieldCode}</if>
<if test="fieldName != null and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if>
<if test="dateAdjust != null and dateAdjust != ''"> and date_adjust = #{dateAdjust}</if>
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</if>
<if test="checkType != null and checkType != ''"> and check_type = #{checkType}</if>
</where>
</select>
<select id="selectDcBusiTargetAdjustMonthMasterById" parameterType="Long" resultMap="DcBusiTargetAdjustMonthMasterResult">
<include refid="selectDcBusiTargetAdjustMonthMasterVo"/>
where id = #{id}
</select>
<insert id="insertDcBusiTargetAdjustMonthMaster" parameterType="DcBusiTargetAdjustMonthMaster" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_target_adjust_month_master
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billSerial != null">bill_serial,</if>
<if test="biilType != null">biil_type,</if>
<if test="companyId != null">company_id,</if>
<if test="companyName != null">company_name,</if>
<if test="organizeName != null">organize_name,</if>
<if test="oragnizeId != null">oragnize_id,</if>
<if test="assetCode != null">asset_code,</if>
<if test="assetName != null">asset_name,</if>
<if test="fieldCode != null">field_code,</if>
<if test="fieldName != null">field_name,</if>
<if test="dateAdjust != null">date_adjust,</if>
<if test="tenantId != null">tenant_id,</if>
<if test="revision != null">revision,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="deleteBy != null">delete_by,</if>
<if test="deleteTime != null">delete_time,</if>
<if test="checkStatus != null">check_status,</if>
<if test="checkType != null">check_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billSerial != null">#{billSerial},</if>
<if test="biilType != null">#{biilType},</if>
<if test="companyId != null">#{companyId},</if>
<if test="companyName != null">#{companyName},</if>
<if test="organizeName != null">#{organizeName},</if>
<if test="oragnizeId != null">#{oragnizeId},</if>
<if test="assetCode != null">#{assetCode},</if>
<if test="assetName != null">#{assetName},</if>
<if test="fieldCode != null">#{fieldCode},</if>
<if test="fieldName != null">#{fieldName},</if>
<if test="dateAdjust != null">#{dateAdjust},</if>
<if test="tenantId != null">#{tenantId},</if>
<if test="revision != null">#{revision},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="deleteBy != null">#{deleteBy},</if>
<if test="deleteTime != null">#{deleteTime},</if>
<if test="checkStatus != null">#{checkStatus},</if>
<if test="checkType != null">#{checkType},</if>
</trim>
</insert>
<update id="updateDcBusiTargetAdjustMonthMaster" parameterType="DcBusiTargetAdjustMonthMaster">
update dc_busi_target_adjust_month_master
<trim prefix="SET" suffixOverrides=",">
<if test="billSerial != null">bill_serial = #{billSerial},</if>
<if test="biilType != null">biil_type = #{biilType},</if>
<if test="companyId != null">company_id = #{companyId},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="organizeName != null">organize_name = #{organizeName},</if>
<if test="oragnizeId != null">oragnize_id = #{oragnizeId},</if>
<if test="assetCode != null">asset_code = #{assetCode},</if>
<if test="assetName != null">asset_name = #{assetName},</if>
<if test="fieldCode != null">field_code = #{fieldCode},</if>
<if test="fieldName != null">field_name = #{fieldName},</if>
<if test="dateAdjust != null">date_adjust = #{dateAdjust},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="deleteBy != null">delete_by = #{deleteBy},</if>
<if test="deleteTime != null">delete_time = #{deleteTime},</if>
<if test="checkStatus != null">check_status = #{checkStatus},</if>
<if test="checkType != null">check_type = #{checkType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcBusiTargetAdjustMonthMasterById" parameterType="Long">
delete from dc_busi_target_adjust_month_master where id = #{id}
</delete>
<delete id="deleteDcBusiTargetAdjustMonthMasterByIds" parameterType="String">
delete from dc_busi_target_adjust_month_master where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

128
lzbi-module/src/main/resources/mapper/draft/DcBusiTargetAdjustMonthSubMapper.xml

@ -0,0 +1,128 @@
<?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.lzbi.draft.mapper.DcBusiTargetAdjustMonthSubMapper">
<resultMap type="com.lzbi.draft.domain.DcBusiTargetAdjustMonthSub" id="DcBusiTargetAdjustMonthSubResult">
<result property="tenantId" column="tenant_id" />
<result property="revision" column="revision" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="deleteBy" column="delete_by" />
<result property="deleteTime" column="delete_time" />
<result property="id" column="id" />
<result property="billNoMaster" column="bill_no_master" />
<result property="targetCode" column="target_code" />
<result property="targetName" column="target_name" />
<result property="tagetUnit" column="taget_unit" />
<result property="adjustDate" column="adjust_date" />
<result property="adjstTime" column="adjst_time" />
<result property="valOrigin" column="val_origin" />
<result property="valAdjust" column="val_adjust" />
<result property="valResult" column="val_result" />
</resultMap>
<sql id="selectDcBusiTargetAdjustMonthSubVo">
select tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, id, bill_no_master, target_code, target_name, taget_unit, adjust_date, adjst_time, val_origin, val_adjust, val_result from dc_busi_target_adjust_month_sub
</sql>
<select id="selectDcBusiTargetAdjustMonthSubList" parameterType="DcBusiTargetAdjustMonthSub" resultMap="DcBusiTargetAdjustMonthSubResult">
<include refid="selectDcBusiTargetAdjustMonthSubVo"/>
<where>
<if test="billNoMaster != null and billNoMaster != ''"> and bill_no_master = #{billNoMaster}</if>
<if test="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if>
<if test="targetName != null and targetName != ''"> and target_name like concat('%', #{targetName}, '%')</if>
<if test="tagetUnit != null and tagetUnit != ''"> and taget_unit = #{tagetUnit}</if>
<if test="adjustDate != null and adjustDate != ''"> and adjust_date = #{adjustDate}</if>
<if test="adjstTime != null "> and adjst_time = #{adjstTime}</if>
<if test="valOrigin != null "> and val_origin = #{valOrigin}</if>
<if test="valAdjust != null "> and val_adjust = #{valAdjust}</if>
<if test="valResult != null "> and val_result = #{valResult}</if>
</where>
</select>
<select id="selectDcBusiTargetAdjustMonthSubById" parameterType="Long" resultMap="DcBusiTargetAdjustMonthSubResult">
<include refid="selectDcBusiTargetAdjustMonthSubVo"/>
where id = #{id}
</select>
<insert id="insertDcBusiTargetAdjustMonthSub" parameterType="DcBusiTargetAdjustMonthSub" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_target_adjust_month_sub
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tenantId != null">tenant_id,</if>
<if test="revision != null">revision,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="deleteBy != null">delete_by,</if>
<if test="deleteTime != null">delete_time,</if>
<if test="billNoMaster != null">bill_no_master,</if>
<if test="targetCode != null">target_code,</if>
<if test="targetName != null">target_name,</if>
<if test="tagetUnit != null">taget_unit,</if>
<if test="adjustDate != null">adjust_date,</if>
<if test="adjstTime != null">adjst_time,</if>
<if test="valOrigin != null">val_origin,</if>
<if test="valAdjust != null">val_adjust,</if>
<if test="valResult != null">val_result,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tenantId != null">#{tenantId},</if>
<if test="revision != null">#{revision},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="deleteBy != null">#{deleteBy},</if>
<if test="deleteTime != null">#{deleteTime},</if>
<if test="billNoMaster != null">#{billNoMaster},</if>
<if test="targetCode != null">#{targetCode},</if>
<if test="targetName != null">#{targetName},</if>
<if test="tagetUnit != null">#{tagetUnit},</if>
<if test="adjustDate != null">#{adjustDate},</if>
<if test="adjstTime != null">#{adjstTime},</if>
<if test="valOrigin != null">#{valOrigin},</if>
<if test="valAdjust != null">#{valAdjust},</if>
<if test="valResult != null">#{valResult},</if>
</trim>
</insert>
<update id="updateDcBusiTargetAdjustMonthSub" parameterType="DcBusiTargetAdjustMonthSub">
update dc_busi_target_adjust_month_sub
<trim prefix="SET" suffixOverrides=",">
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="deleteBy != null">delete_by = #{deleteBy},</if>
<if test="deleteTime != null">delete_time = #{deleteTime},</if>
<if test="billNoMaster != null">bill_no_master = #{billNoMaster},</if>
<if test="targetCode != null">target_code = #{targetCode},</if>
<if test="targetName != null">target_name = #{targetName},</if>
<if test="tagetUnit != null">taget_unit = #{tagetUnit},</if>
<if test="adjustDate != null">adjust_date = #{adjustDate},</if>
<if test="adjstTime != null">adjst_time = #{adjstTime},</if>
<if test="valOrigin != null">val_origin = #{valOrigin},</if>
<if test="valAdjust != null">val_adjust = #{valAdjust},</if>
<if test="valResult != null">val_result = #{valResult},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcBusiTargetAdjustMonthSubById" parameterType="Long">
delete from dc_busi_target_adjust_month_sub where id = #{id}
</delete>
<delete id="deleteDcBusiTargetAdjustMonthSubByIds" parameterType="String">
delete from dc_busi_target_adjust_month_sub where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save