Browse Source

日指标计划

develop
bobol 11 months ago
parent
commit
31d6d47252
  1. 130
      lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiTargetDraftDaynew.java
  2. 63
      lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiTargetDraftDaynewMapper.java
  3. 91
      lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiTargetDraftDaynewService.java
  4. 45
      lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanBillMasterController.java
  5. 6
      lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanBillMaster.java
  6. 2
      lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanBillSub.java
  7. 20
      lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanBillMasterMapper.java
  8. 213
      lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanBillMasterService.java
  9. 122
      lzbi-module/src/main/resources/mapper/asset/DcBusiPlanBillMasterMapper.xml
  10. 44
      lzbi-module/src/main/resources/mapper/asset/DcBusiPlanBillSubMapper.xml
  11. 178
      lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDaynewMapper.xml
  12. 6
      lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml

130
lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiTargetDraftDaynew.java

@ -0,0 +1,130 @@
package com.lzbi.bi.domain;
import java.math.BigDecimal;
import java.util.Date;
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_draft_daynew
*
* @author lienbo
* @date 2023-12-25
*/
@Data
@Accessors(chain = true)
public class DcBusiTargetDraftDaynew extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 创建人 */
private String createdBy;
/** 创建时间 */
private Date createdTime;
/** 更新人 */
private String updatedBy;
/** 更新时间 */
private Date updatedTime;
/** 公司ID */
@Excel(name = "公司ID")
@ApiModelProperty(name = "公司ID",notes = "companyId")
private Long companyId;
/** 公司名称 */
@Excel(name = "公司名称")
@ApiModelProperty(name = "公司名称",notes = "companyName")
private String companyName;
/** 组织ID */
@Excel(name = "组织ID")
@ApiModelProperty(name = "组织ID",notes = "organizeId")
private Long organizeId;
/** 组织名称 */
@Excel(name = "组织名称")
@ApiModelProperty(name = "组织名称",notes = "organizeName")
private String organizeName;
/** 统计单元编码 */
@Excel(name = "统计单元编码")
@ApiModelProperty(name = "统计单元编码",notes = "assetCode")
private String assetCode;
/** 统计单元名称 */
@Excel(name = "统计单元名称")
@ApiModelProperty(name = "统计单元名称",notes = "assetName")
private String assetName;
/** 指标编码 */
@Excel(name = "指标编码")
@ApiModelProperty(name = "指标编码",notes = "targetCode")
private String targetCode;
/** 指标名称 */
@Excel(name = "指标名称")
@ApiModelProperty(name = "指标名称",notes = "tagetName")
private String tagetName;
/** 指标模型编码 */
@Excel(name = "指标模型编码")
@ApiModelProperty(name = "指标模型编码",notes = "targetModelCode")
private String targetModelCode;
/** 指标原值 */
@Excel(name = "指标原值")
@ApiModelProperty(name = "指标原值",notes = "valueOriginal")
private BigDecimal valueOriginal;
/** 指标结果值 */
@Excel(name = "指标结果值")
@ApiModelProperty(name = "指标结果值",notes = "valueResult")
private BigDecimal valueResult;
/** 指标计划值 */
@Excel(name = "指标计划值")
@ApiModelProperty(name = "指标计划值",notes = "valuePlan")
private BigDecimal valuePlan;
/** 年 */
@Excel(name = "年")
@ApiModelProperty(name = "年",notes = "dateYear")
private String dateYear;
/** 月 */
@Excel(name = "月")
@ApiModelProperty(name = "月",notes = "dateMonth")
private String dateMonth;
/** 日 */
@Excel(name = "日")
@ApiModelProperty(name = "日",notes = "dateDay")
private String dateDay;
/** 指标临时值 */
@Excel(name = "指标临时值")
@ApiModelProperty(name = "指标临时值",notes = "valueTemp")
private BigDecimal valueTemp;
/** 所属专业编码 */
@Excel(name = "所属专业编码")
@ApiModelProperty(name = "所属专业编码",notes = "fieldCode")
private String fieldCode;
/** 所属专业名称 */
@Excel(name = "所属专业名称")
@ApiModelProperty(name = "所属专业名称",notes = "fieldName")
private String fieldName;
/** 调整值 */
@Excel(name = "调整值")
@ApiModelProperty(name = "调整值",notes = "valueAdjust")
private BigDecimal valueAdjust;
}

63
lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiTargetDraftDaynewMapper.java

@ -0,0 +1,63 @@
package com.lzbi.bi.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lzbi.bi.domain.DcBusiTargetDraftDaynew;
/**
* 指标数据底稿日-新结构Mapper接口
*
* @author lienbo
* @date 2023-12-25
*/
public interface DcBusiTargetDraftDaynewMapper extends BaseMapper<DcBusiTargetDraftDaynew>
{
/**
* 查询指标数据底稿日-新结构
*
* @param id 指标数据底稿日-新结构主键
* @return 指标数据底稿日-新结构
*/
public DcBusiTargetDraftDaynew selectDcBusiTargetDraftDaynewById(String id);
/**
* 查询指标数据底稿日-新结构列表
*
* @param dcBusiTargetDraftDaynew 指标数据底稿日-新结构
* @return 指标数据底稿日-新结构集合
*/
public List<DcBusiTargetDraftDaynew> selectDcBusiTargetDraftDaynewList(DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew);
/**
* 新增指标数据底稿日-新结构
*
* @param dcBusiTargetDraftDaynew 指标数据底稿日-新结构
* @return 结果
*/
public int insertDcBusiTargetDraftDaynew(DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew);
/**
* 修改指标数据底稿日-新结构
*
* @param dcBusiTargetDraftDaynew 指标数据底稿日-新结构
* @return 结果
*/
public int updateDcBusiTargetDraftDaynew(DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew);
/**
* 删除指标数据底稿日-新结构
*
* @param id 指标数据底稿日-新结构主键
* @return 结果
*/
public int deleteDcBusiTargetDraftDaynewById(String id);
/**
* 批量删除指标数据底稿日-新结构
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiTargetDraftDaynewByIds(String[] ids);
}

91
lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiTargetDraftDaynewService.java

@ -0,0 +1,91 @@
package com.lzbi.bi.service;
import java.util.List;
import com.lzbi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.lzbi.bi.domain.DcBusiTargetDraftDaynew;
import com.lzbi.bi.mapper.DcBusiTargetDraftDaynewMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 指标数据底稿日-新结构Service业务层处理
*
* @author 李恩博
* @date 2023-12-25
*/
@Service
public class DcBusiTargetDraftDaynewService extends ServiceImpl<DcBusiTargetDraftDaynewMapper, DcBusiTargetDraftDaynew> implements IService<DcBusiTargetDraftDaynew>
{
/**
* 查询指标数据底稿日-新结构
*
* @param id 指标数据底稿日-新结构主键
* @return 指标数据底稿日-新结构
*/
public DcBusiTargetDraftDaynew selectDcBusiTargetDraftDaynewById(String id)
{
return baseMapper.selectDcBusiTargetDraftDaynewById(id);
}
/**
* 查询指标数据底稿日-新结构列表
*
* @param dcBusiTargetDraftDaynew 指标数据底稿日-新结构
* @return 指标数据底稿日-新结构
*/
public List<DcBusiTargetDraftDaynew> selectDcBusiTargetDraftDaynewList(DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew)
{
return baseMapper.selectDcBusiTargetDraftDaynewList(dcBusiTargetDraftDaynew);
}
/**
* 新增指标数据底稿日-新结构
*
* @param dcBusiTargetDraftDaynew 指标数据底稿日-新结构
* @return 结果
*/
public int insertDcBusiTargetDraftDaynew(DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew)
{
dcBusiTargetDraftDaynew.setCreatedTime(DateUtils.getNowDate());
return baseMapper.insertDcBusiTargetDraftDaynew(dcBusiTargetDraftDaynew);
}
/**
* 修改指标数据底稿日-新结构
*
* @param dcBusiTargetDraftDaynew 指标数据底稿日-新结构
* @return 结果
*/
public int updateDcBusiTargetDraftDaynew(DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew)
{
dcBusiTargetDraftDaynew.setUpdatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBusiTargetDraftDaynew(dcBusiTargetDraftDaynew);
}
/**
* 批量删除指标数据底稿日-新结构
*
* @param ids 需要删除的指标数据底稿日-新结构主键
* @return 结果
*/
public int deleteDcBusiTargetDraftDaynewByIds(String[] ids)
{
return baseMapper.deleteDcBusiTargetDraftDaynewByIds(ids);
}
/**
* 删除指标数据底稿日-新结构信息
*
* @param id 指标数据底稿日-新结构主键
* @return 结果
*/
public int deleteDcBusiTargetDraftDaynewById(String id)
{
return baseMapper.deleteDcBusiTargetDraftDaynewById(id);
}
}

45
lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanBillMasterController.java

@ -1,4 +1,7 @@
package com.lzbi.bill.controller;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.common.utils.SecurityUtils;
import com.lzbi.draft.domain.DcBusiTargetBillMaster;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@ -83,6 +86,20 @@ public class DcBusiPlanBillMasterController extends BaseController
return success(dcBusiPlanBillMasterService.selectDcBusiPlanBillMasterById(id));
}
/**
* 获取计划单据主详细信息
*/
@ApiOperation("获取计划单据主详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class),
})
@PreAuthorize("@ss.hasPermi('bill:planBillMaster:query')")
@GetMapping(value = "/billNo/{billNo}")
public AjaxResult getInfo(@PathVariable("billNo") String billNo)
{
return success(dcBusiPlanBillMasterService.selectDcBusiPlanBillMasterByBillNo(billNo));
}
/**
* 新增计划单据主
*/
@ -128,4 +145,32 @@ public class DcBusiPlanBillMasterController extends BaseController
{
return toAjax(dcBusiPlanBillMasterService.deleteDcBusiPlanBillMasterByIds(ids));
}
@ApiOperation("驳回")
@ApiImplicitParams({
@ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class),
})
@PostMapping("/checkBack/{billNo}")
public AjaxResult checkBack(@PathVariable String billNo){
return AjaxResult.success(dcBusiPlanBillMasterService.checkBack(billNo));
}
@ApiOperation("审核")
@ApiImplicitParams({
@ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class),
})
@PostMapping("/checkPass/{billNo}")
public AjaxResult checkPass(@PathVariable String billNo){
return AjaxResult.success(dcBusiPlanBillMasterService.checkPass(billNo));
}
@ApiOperation("反审核")
@ApiImplicitParams({
@ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class),
})
@PostMapping("/checkRevert/{billNo}")
public AjaxResult checkRevert(@PathVariable String billNo){
return AjaxResult.success(dcBusiPlanBillMasterService.checkRevert(billNo));
}
}

6
lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanBillMaster.java

@ -79,6 +79,12 @@ public class DcBusiPlanBillMaster extends BaseModuleEntity
/** 组织机构ID */
private Long oragnizeId;
/** 所属专业 */
private String fieldCode;
/** 所属专业名称 */
private String fieldName;
/** 计划单据明细信息 */
private List<DcBusiPlanBillSub> dcBusiPlanBillSubList;

2
lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanBillSub.java

@ -49,7 +49,7 @@ public class DcBusiPlanBillSub
/** 指标名称 */
@Excel(name = "指标名称")
private String tagetName;
private String targetName;
/** 参数值 */
@Excel(name = "参数值")

20
lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanBillMasterMapper.java

@ -21,6 +21,13 @@ public interface DcBusiPlanBillMasterMapper extends BaseMapper<DcBusiPlanBillMas
* @return 计划单据主
*/
public DcBusiPlanBillMaster selectDcBusiPlanBillMasterById(Long id);
/**
* 查询计划单据主
*
* @param billNo 单据号
* @return 计划单据主
*/
public DcBusiPlanBillMaster selectDcBusiPlanBillMasterByBillNo(String billNo);
/**
* 查询计划单据主列表
@ -46,6 +53,15 @@ public interface DcBusiPlanBillMasterMapper extends BaseMapper<DcBusiPlanBillMas
*/
public int updateDcBusiPlanBillMaster(DcBusiPlanBillMaster dcBusiPlanBillMaster);
/**
* 修改计划单据主
*
* @param dcBusiPlanBillMaster 计划单据主
* @return 结果
*/
public int updateDcBusiPlanBillMasterByBillNo(DcBusiPlanBillMaster dcBusiPlanBillMaster);
/**
* 删除计划单据主
*
@ -82,8 +98,8 @@ public interface DcBusiPlanBillMasterMapper extends BaseMapper<DcBusiPlanBillMas
/**
* 通过计划单据主主键删除计划单据明细信息
*
* @param id 计划单据主ID
* @param billNo 计划单据号
* @return 结果
*/
public int deleteDcBusiPlanBillSubByBillNo(Long id);
public int deleteDcBusiPlanBillSubByBillNo(String billNo);
}

213
lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanBillMasterService.java

@ -2,16 +2,29 @@ package com.lzbi.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lzbi.bi.domain.DcBusiTargetDraftDaynew;
import com.lzbi.bi.mapper.DcBusiTargetDraftDaynewMapper;
import com.lzbi.bill.domain.DcBusiPlanBillMaster;
import com.lzbi.bill.domain.DcBusiPlanBillSub;
import com.lzbi.bill.mapper.DcBusiPlanBillMasterMapper;
import com.lzbi.bill.mapper.DcBusiPlanBillSubMapper;
import com.lzbi.common.core.domain.entity.SysDept;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.common.utils.SecurityUtils;
import com.lzbi.common.utils.StringUtils;
import com.lzbi.system.service.impl.SysDeptServiceImpl;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* 计划单据主Service业务层处理
*
@ -19,8 +32,19 @@ import java.util.List;
* @date 2023-12-21
*/
@Service
public class DcBusiPlanBillMasterService extends ServiceImpl<DcBusiPlanBillMasterMapper, DcBusiPlanBillMaster> implements IService<DcBusiPlanBillMaster>
{
public class DcBusiPlanBillMasterService extends ServiceImpl<DcBusiPlanBillMasterMapper, DcBusiPlanBillMaster> implements IService<DcBusiPlanBillMaster> {
@Autowired
private SysDeptServiceImpl sysDeptService;
@Resource
private DcBusiPlanBillSubMapper dcBusiPlanBillSubMapper;
@Resource
private DcBusiTargetDraftDaynewMapper dcBusiTargetDraftDaynewMapper;
@Resource
private DcBaseAssetTargetMapper dcBaseAssetTargetMapper;
/**
* 查询计划单据主
@ -28,19 +52,30 @@ public class DcBusiPlanBillMasterService extends ServiceImpl<DcBusiPlanBillMaste
* @param id 计划单据主主键
* @return 计划单据主
*/
public DcBusiPlanBillMaster selectDcBusiPlanBillMasterById(Long id)
{
public DcBusiPlanBillMaster selectDcBusiPlanBillMasterById(Long id) {
return baseMapper.selectDcBusiPlanBillMasterById(id);
}
public DcBusiPlanBillMaster selectDcBusiPlanBillMasterByBillNo(String billNo) {
DcBusiPlanBillMaster dcBusiPlanBillMaster = baseMapper.selectDcBusiPlanBillMasterByBillNo(billNo);
DcBusiPlanBillSub params = new DcBusiPlanBillSub();
params.setBillNo(billNo);
List<DcBusiPlanBillSub> dcBusiPlanBillSubs = dcBusiPlanBillSubMapper.selectDcBusiPlanBillSubList(params);
if (!CollectionUtils.isEmpty(dcBusiPlanBillSubs)) {
dcBusiPlanBillMaster.setDcBusiPlanBillSubList(dcBusiPlanBillSubs);
dcBusiPlanBillMaster.setFieldCode(dcBusiPlanBillSubs.get(0).getFieldCode());
dcBusiPlanBillMaster.setFieldName(dcBusiPlanBillSubs.get(0).getFieldName());
}
return dcBusiPlanBillMaster;
}
/**
* 查询计划单据主列表
*
* @param dcBusiPlanBillMaster 计划单据主
* @return 计划单据主
*/
public List<DcBusiPlanBillMaster> selectDcBusiPlanBillMasterList(DcBusiPlanBillMaster dcBusiPlanBillMaster)
{
public List<DcBusiPlanBillMaster> selectDcBusiPlanBillMasterList(DcBusiPlanBillMaster dcBusiPlanBillMaster) {
return baseMapper.selectDcBusiPlanBillMasterList(dcBusiPlanBillMaster);
}
@ -51,10 +86,26 @@ public class DcBusiPlanBillMasterService extends ServiceImpl<DcBusiPlanBillMaste
* @return 结果
*/
@Transactional
public int insertDcBusiPlanBillMaster(DcBusiPlanBillMaster dcBusiPlanBillMaster)
{
public int insertDcBusiPlanBillMaster(DcBusiPlanBillMaster dcBusiPlanBillMaster) {
DcBusiPlanBillMaster params = new DcBusiPlanBillMaster();
params.setBillNo(dcBusiPlanBillMaster.getBillNo());
List<DcBusiPlanBillMaster> dcBusiPlanBillMasters = this.selectDcBusiPlanBillMasterList(params);
// 如果单据号重复了
if (!CollectionUtils.isEmpty(dcBusiPlanBillMasters)) {
throw new RuntimeException("单据号已存在,不可重复录入");
}
// 查询公司
SysDept company = sysDeptService.selectDeptById(dcBusiPlanBillMaster.getCompanyId());
if (ObjectUtils.isNotEmpty(company)) {
dcBusiPlanBillMaster.setCompanyName(company.getDeptName());
}
// 查询组织
SysDept organize = sysDeptService.selectDeptById(dcBusiPlanBillMaster.getOragnizeId());
if (ObjectUtils.isNotEmpty(organize)) {
dcBusiPlanBillMaster.setOrganizeName(organize.getDeptName());
}
dcBusiPlanBillMaster.setCreatedTime(DateUtils.getNowDate());
dcBusiPlanBillMaster.setCreatedBy(SecurityUtils.getLoginUser().getUsername());
int rows = baseMapper.insertDcBusiPlanBillMaster(dcBusiPlanBillMaster);
insertDcBusiPlanBillSub(dcBusiPlanBillMaster);
return rows;
@ -68,12 +119,118 @@ public class DcBusiPlanBillMasterService extends ServiceImpl<DcBusiPlanBillMaste
*/
@Transactional
public int updateDcBusiPlanBillMaster(DcBusiPlanBillMaster dcBusiPlanBillMaster)
{
public int updateDcBusiPlanBillMaster(DcBusiPlanBillMaster dcBusiPlanBillMaster) {
dcBusiPlanBillMaster.setUpdatedTime(DateUtils.getNowDate());
baseMapper.deleteDcBusiPlanBillSubByBillNo(dcBusiPlanBillMaster.getId());
dcBusiPlanBillMaster.setUpdatedBy(SecurityUtils.getLoginUser().getUsername());
baseMapper.deleteDcBusiPlanBillSubByBillNo(dcBusiPlanBillMaster.getBillNo());
insertDcBusiPlanBillSub(dcBusiPlanBillMaster);
return baseMapper.updateDcBusiPlanBillMaster(dcBusiPlanBillMaster);
return baseMapper.updateDcBusiPlanBillMasterByBillNo(dcBusiPlanBillMaster);
}
public int checkBack(String billNo) {
DcBusiPlanBillMaster master = new DcBusiPlanBillMaster();
master.setBillNo(billNo);
master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate());
master.setCheckStatus("0");
return baseMapper.updateDcBusiPlanBillMasterByBillNo(master);
}
@Transactional(rollbackFor = Exception.class)
public int checkPass(String billNo) {
// 查询主表数据
DcBusiPlanBillMaster master = baseMapper.selectDcBusiPlanBillMasterByBillNo(billNo);
if ("0".equals(master.getCheckStatus())) {
throw new RuntimeException("审核失败,单据未提交");
}
if ("2".equals(master.getCheckStatus())) {
throw new RuntimeException("审核失败,单据已审核");
}
// 查询子表数据
DcBusiPlanBillSub subParams = new DcBusiPlanBillSub();
subParams.setBillNo(billNo);
List<DcBusiPlanBillSub> subList = dcBusiPlanBillSubMapper.selectDcBusiPlanBillSubList(subParams);
if (!CollectionUtils.isEmpty(subList)) {
// 循环修改底稿表数据
for (int i = 0, len = subList.size(); i < len; i++) {
DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew = new DcBusiTargetDraftDaynew();
dcBusiTargetDraftDaynew.setCompanyId(master.getCompanyId());
dcBusiTargetDraftDaynew.setOrganizeId(master.getOragnizeId());
dcBusiTargetDraftDaynew.setFieldCode(master.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.setCompanyName(master.getCompanyName());
dcBusiTargetDraftDaynew.setOrganizeName(master.getOrganizeName());
dcBusiTargetDraftDaynew.setFieldName(master.getFieldName());
dcBusiTargetDraftDaynew.setAssetName(subList.get(i).getAssetName());
dcBusiTargetDraftDaynew.setTagetName(subList.get(i).getTargetName());
DcBaseAssetTarget dcBaseAssetTarget = dcBaseAssetTargetMapper.selectDcBaseAssetTargetByTargetCodeAndAssetCode(subList.get(i).getAssetCode(), subList.get(i).getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetTarget)) {
dcBusiTargetDraftDaynew.setTargetModelCode(dcBaseAssetTarget.getTargetModelCode());
}
dcBusiTargetDraftDaynew.setValuePlan(subList.get(i).getPlanValue());
dcBusiTargetDraftDaynewMapper.insertDcBusiTargetDraftDaynew(dcBusiTargetDraftDaynew);
} else {
dcBusiTargetDraftDaynew = dcBusiTargetDraftDaynews.get(0);
dcBusiTargetDraftDaynew.setValuePlan(dcBusiTargetDraftDaynew.getValuePlan().add(subList.get(i).getPlanValue()));
dcBusiTargetDraftDaynewMapper.updateDcBusiTargetDraftDaynew(dcBusiTargetDraftDaynew);
}
}
}
// 修改计划单状态为2
master.setUpdatedBy(SecurityUtils.getUsername());
master.setCreatedTime(DateUtils.getNowDate());
master.setBillNo(billNo);
master.setCheckStatus("2");
return baseMapper.updateDcBusiPlanBillMasterByBillNo(master);
}
@Transactional(rollbackFor = Exception.class)
public int checkRevert(String billNo) {
// 查询主表
DcBusiPlanBillMaster master = baseMapper.selectDcBusiPlanBillMasterByBillNo(billNo);
if ("0".equals(master.getCheckStatus())) {
throw new RuntimeException("反审核失败,单据未提交");
}
if ("1".equals(master.getCheckStatus())) {
throw new RuntimeException("反审核失败,单据未审核通过");
}
// 如果单据状态为已审核状态,需要把底稿表数据恢复
if ("2".equals(master.getCheckStatus())) {
// 查询子表数据
DcBusiPlanBillSub subParams = new DcBusiPlanBillSub();
subParams.setBillNo(billNo);
List<DcBusiPlanBillSub> subList = dcBusiPlanBillSubMapper.selectDcBusiPlanBillSubList(subParams);
for (int i = 0, len = subList.size(); i < len; i++) {
DcBusiTargetDraftDaynew dcBusiTargetDraftDaynew = new DcBusiTargetDraftDaynew();
dcBusiTargetDraftDaynew.setCompanyId(master.getCompanyId());
dcBusiTargetDraftDaynew.setOrganizeId(master.getOragnizeId());
dcBusiTargetDraftDaynew.setFieldCode(master.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.setCreatedTime(DateUtils.getNowDate());
master.setBillNo(billNo);
master.setCheckStatus("0");
return baseMapper.updateDcBusiPlanBillMasterByBillNo(master);
}
/**
@ -84,8 +241,7 @@ public class DcBusiPlanBillMasterService extends ServiceImpl<DcBusiPlanBillMaste
*/
@Transactional
public int deleteDcBusiPlanBillMasterByIds(Long[] ids)
{
public int deleteDcBusiPlanBillMasterByIds(Long[] ids) {
baseMapper.deleteDcBusiPlanBillSubByBillNos(ids);
return baseMapper.deleteDcBusiPlanBillMasterByIds(ids);
}
@ -98,9 +254,11 @@ public class DcBusiPlanBillMasterService extends ServiceImpl<DcBusiPlanBillMaste
*/
@Transactional
public int deleteDcBusiPlanBillMasterById(Long id)
{
baseMapper.deleteDcBusiPlanBillSubByBillNo(id);
public int deleteDcBusiPlanBillMasterById(Long id) {
DcBusiPlanBillMaster dcBusiPlanBillMaster = baseMapper.selectDcBusiPlanBillMasterById(id);
if (ObjectUtils.isNotEmpty(dcBusiPlanBillMaster)) {
baseMapper.deleteDcBusiPlanBillSubByBillNo(dcBusiPlanBillMaster.getBillNo());
}
return baseMapper.deleteDcBusiPlanBillMasterById(id);
}
@ -109,21 +267,12 @@ public class DcBusiPlanBillMasterService extends ServiceImpl<DcBusiPlanBillMaste
*
* @param dcBusiPlanBillMaster 计划单据主对象
*/
public void insertDcBusiPlanBillSub(DcBusiPlanBillMaster dcBusiPlanBillMaster)
{
public void insertDcBusiPlanBillSub(DcBusiPlanBillMaster dcBusiPlanBillMaster) {
List<DcBusiPlanBillSub> dcBusiPlanBillSubDaoList = dcBusiPlanBillMaster.getDcBusiPlanBillSubList();
String billNo = dcBusiPlanBillMaster.getBillNo();
if (StringUtils.isNotNull(dcBusiPlanBillSubDaoList))
{
List<DcBusiPlanBillSub> list = new ArrayList<DcBusiPlanBillSub>();
for (DcBusiPlanBillSub dcBusiPlanBillSubDao : dcBusiPlanBillSubDaoList)
{
dcBusiPlanBillSubDao.setBillNo(billNo);
list.add(dcBusiPlanBillSubDao);
}
if (list.size() > 0)
{
baseMapper.batchDcBusiPlanBillSub(list);
if (StringUtils.isNotNull(dcBusiPlanBillSubDaoList)) {
for (DcBusiPlanBillSub dcBusiPlanBillSubDao : dcBusiPlanBillSubDaoList) {
dcBusiPlanBillSubDao.setBillNo(dcBusiPlanBillMaster.getBillNo());
dcBusiPlanBillSubMapper.insertDcBusiPlanBillSub(dcBusiPlanBillSubDao);
}
}
}

122
lzbi-module/src/main/resources/mapper/asset/DcBusiPlanBillMasterMapper.xml

@ -25,8 +25,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="oragnizeId" column="oragnize_id"/>
</resultMap>
<resultMap id="DcBusiPlanBillMasterDcBusiPlanBillSubResult" type="com.lzbi.bill.domain.DcBusiPlanBillMaster" extends="DcBusiPlanBillMasterResult">
<collection property="dcBusiPlanBillSubList" notNullColumn="sub_id" javaType="java.util.List" resultMap="DcBusiPlanBillSubResult" />
<resultMap id="DcBusiPlanBillMasterDcBusiPlanBillSubResult" type="com.lzbi.bill.domain.DcBusiPlanBillMaster"
extends="DcBusiPlanBillMasterResult">
<collection property="dcBusiPlanBillSubList" notNullColumn="sub_id" javaType="java.util.List"
resultMap="DcBusiPlanBillSubResult"/>
</resultMap>
<resultMap type="com.lzbi.bill.domain.DcBusiPlanBillSub" id="DcBusiPlanBillSubResult">
@ -53,10 +55,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDcBusiPlanBillMasterVo">
select id, bill_no, bill_income_date, bill_type, check_type, check_status, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, company_id, company_name, organize_name, oragnize_id from dc_busi_plan_bill_master
select id,
bill_no,
bill_income_date,
bill_type,
check_type,
check_status,
tenant_id,
revision,
created_by,
created_time,
updated_by,
updated_time,
delete_by,
delete_time,
company_id,
company_name,
organize_name,
oragnize_id
from dc_busi_plan_bill_master
</sql>
<select id="selectDcBusiPlanBillMasterList" parameterType="DcBusiPlanBillMaster" resultMap="DcBusiPlanBillMasterResult">
<select id="selectDcBusiPlanBillMasterList" parameterType="DcBusiPlanBillMaster"
resultMap="DcBusiPlanBillMasterResult">
<include refid="selectDcBusiPlanBillMasterVo"/>
<where>
<if test="billNo != null and billNo != ''">and bill_no = #{billNo}</if>
@ -69,15 +90,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectDcBusiPlanBillMasterById" parameterType="Long" resultMap="DcBusiPlanBillMasterDcBusiPlanBillSubResult">
select a.id, a.bill_no, a.bill_income_date, a.bill_type, a.check_type, a.check_status, a.tenant_id, a.revision, a.created_by, a.created_time, a.updated_by, a.updated_time, a.delete_by, a.delete_time, a.company_id, a.company_name, a.organize_name, a.oragnize_id,
b.id as sub_id, b.bill_no as sub_bill_no, b.field_code as sub_field_code, b.field_name as sub_field_name, b.asset_code as sub_asset_code, b.asset_name as sub_asset_name, b.target_code as sub_target_code, b.taget_name as sub_taget_name, b.plan_value as sub_plan_value, b.date_year as sub_date_year, b.date_month as sub_date_month, b.date_day as sub_date_day, b.tenant_id as sub_tenant_id, b.revision as sub_revision, b.created_by as sub_created_by, b.created_time as sub_created_time, b.updated_by as sub_updated_by, b.updated_time as sub_updated_time, b.delete_by as sub_delete_by, b.delete_time as sub_delete_time
<select id="selectDcBusiPlanBillMasterById" parameterType="Long"
resultMap="DcBusiPlanBillMasterResult">
select a.id,
a.bill_no,
a.bill_income_date,
a.bill_type,
a.check_type,
a.check_status,
a.tenant_id,
a.revision,
a.created_by,
a.created_time,
a.updated_by,
a.updated_time,
a.delete_by,
a.delete_time,
a.company_id,
a.company_name,
a.organize_name,
a.oragnize_id
from dc_busi_plan_bill_master a
left join dc_busi_plan_bill_sub b on b.bill_no = a.id
where a.id = #{id}
</select>
<insert id="insertDcBusiPlanBillMaster" parameterType="DcBusiPlanBillMaster" useGeneratedKeys="true" keyProperty="id">
<select id="selectDcBusiPlanBillMasterByBillNo" parameterType="String"
resultMap="DcBusiPlanBillMasterResult">
select a.id,
a.bill_no,
a.bill_income_date,
a.bill_type,
a.check_type,
a.check_status,
a.tenant_id,
a.revision,
a.created_by,
a.created_time,
a.updated_by,
a.updated_time,
a.delete_by,
a.delete_time,
a.company_id,
a.company_name,
a.organize_name,
a.oragnize_id
from dc_busi_plan_bill_master a
where a.bill_no = #{billNo}
</select>
<insert id="insertDcBusiPlanBillMaster" parameterType="DcBusiPlanBillMaster" useGeneratedKeys="true"
keyProperty="id">
insert into dc_busi_plan_bill_master
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billNo != null">bill_no,</if>
@ -143,8 +205,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<update id="updateDcBusiPlanBillMasterByBillNo" parameterType="DcBusiPlanBillMaster">
update dc_busi_plan_bill_master
<trim prefix="SET" suffixOverrides=",">
<if test="billIncomeDate != null">bill_income_date = #{billIncomeDate},</if>
<if test="billType != null">bill_type = #{billType},</if>
<if test="checkType != null">check_type = #{checkType},</if>
<if test="checkStatus != null">check_status = #{checkStatus},</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="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>
</trim>
where bill_no = #{billNo}
</update>
<delete id="deleteDcBusiPlanBillMasterById" parameterType="Long">
delete from dc_busi_plan_bill_master where id = #{id}
delete
from dc_busi_plan_bill_master
where id = #{id}
</delete>
<delete id="deleteDcBusiPlanBillMasterByIds" parameterType="String">
@ -161,14 +248,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<delete id="deleteDcBusiPlanBillSubByBillNo" parameterType="Long">
delete from dc_busi_plan_bill_sub where bill_no = #{billNo}
<delete id="deleteDcBusiPlanBillSubByBillNo" parameterType="String">
delete
from dc_busi_plan_bill_sub
where bill_no = #{billNo}
</delete>
<insert id="batchDcBusiPlanBillSub">
insert into dc_busi_plan_bill_sub( id, bill_no, field_code, field_name, asset_code, asset_name, target_code, taget_name, plan_value, date_year, date_month, date_day, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time) values
insert into dc_busi_plan_bill_sub( id, bill_no, field_code, field_name, asset_code, asset_name, target_code,
taget_name, plan_value, date_year, date_month, date_day, tenant_id, revision, created_by, created_time,
updated_by, updated_time, delete_by, delete_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.billNo}, #{item.fieldCode}, #{item.fieldName}, #{item.assetCode}, #{item.assetName}, #{item.targetCode}, #{item.tagetName}, #{item.planValue}, #{item.dateYear}, #{item.dateMonth}, #{item.dateDay}, #{item.tenantId}, #{item.revision}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}, #{item.deleteBy}, #{item.deleteTime})
( #{item.id}, #{item.billNo}, #{item.fieldCode}, #{item.fieldName}, #{item.assetCode}, #{item.assetName},
#{item.targetCode}, #{item.tagetName}, #{item.planValue}, #{item.dateYear}, #{item.dateMonth},
#{item.dateDay}, #{item.tenantId}, #{item.revision}, #{item.createdBy}, #{item.createdTime},
#{item.updatedBy}, #{item.updatedTime}, #{item.deleteBy}, #{item.deleteTime})
</foreach>
</insert>
</mapper>

44
lzbi-module/src/main/resources/mapper/asset/DcBusiPlanBillSubMapper.xml

@ -12,23 +12,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="assetCode" column="asset_code" />
<result property="assetName" column="asset_name" />
<result property="targetCode" column="target_code" />
<result property="tagetName" column="taget_name" />
<result property="targetName" column="target_name" />
<result property="planValue" column="plan_value" />
<result property="dateYear" column="date_year" />
<result property="dateMonth" column="date_month" />
<result property="dateDay" column="date_day" />
<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" />
</resultMap>
<sql id="selectDcBusiPlanBillSubVo">
select id, bill_no, field_code, field_name, asset_code, asset_name, target_code, taget_name, plan_value, date_year, date_month, date_day, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_busi_plan_bill_sub
select id, bill_no, field_code, field_name, asset_code, asset_name, target_code, target_name, plan_value, date_year, date_month, date_day, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_busi_plan_bill_sub
</sql>
<select id="selectDcBusiPlanBillSubList" parameterType="DcBusiPlanBillSub" resultMap="DcBusiPlanBillSubResult">
@ -40,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if>
<if test="tagetName != null and tagetName != ''"> and taget_name like concat('%', #{tagetName}, '%')</if>
<if test="targetName != null and targetName != ''"> and target_name like concat('%', #{targetName}, '%')</if>
<if test="planValue != null "> and plan_value = #{planValue}</if>
<if test="dateYear != null and dateYear != ''"> and date_year = #{dateYear}</if>
<if test="dateMonth != null and dateMonth != ''"> and date_month = #{dateMonth}</if>
@ -62,19 +54,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="assetCode != null">asset_code,</if>
<if test="assetName != null">asset_name,</if>
<if test="targetCode != null">target_code,</if>
<if test="tagetName != null">taget_name,</if>
<if test="targetName != null">target_name,</if>
<if test="planValue != null">plan_value,</if>
<if test="dateYear != null">date_year,</if>
<if test="dateMonth != null">date_month,</if>
<if test="dateDay != null">date_day,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billNo != null">#{billNo},</if>
@ -83,19 +67,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="assetCode != null">#{assetCode},</if>
<if test="assetName != null">#{assetName},</if>
<if test="targetCode != null">#{targetCode},</if>
<if test="tagetName != null">#{tagetName},</if>
<if test="targetName != null">#{targetName},</if>
<if test="planValue != null">#{planValue},</if>
<if test="dateYear != null">#{dateYear},</if>
<if test="dateMonth != null">#{dateMonth},</if>
<if test="dateDay != null">#{dateDay},</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>
</trim>
</insert>
@ -108,19 +84,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="assetCode != null">asset_code = #{assetCode},</if>
<if test="assetName != null">asset_name = #{assetName},</if>
<if test="targetCode != null">target_code = #{targetCode},</if>
<if test="tagetName != null">taget_name = #{tagetName},</if>
<if test="targetName != null">target_name = #{targetName},</if>
<if test="planValue != null">plan_value = #{planValue},</if>
<if test="dateYear != null">date_year = #{dateYear},</if>
<if test="dateMonth != null">date_month = #{dateMonth},</if>
<if test="dateDay != null">date_day = #{dateDay},</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>
</trim>
where id = #{id}
</update>

178
lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDaynewMapper.xml

@ -0,0 +1,178 @@
<?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.bi.mapper.DcBusiTargetDraftDaynewMapper">
<resultMap type="com.lzbi.bi.domain.DcBusiTargetDraftDaynew" id="DcBusiTargetDraftDaynewResult">
<result property="id" column="id" />
<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="companyId" column="company_id" />
<result property="companyName" column="company_name" />
<result property="organizeId" column="organize_id" />
<result property="organizeName" column="organize_name" />
<result property="assetCode" column="asset_code" />
<result property="assetName" column="asset_name" />
<result property="targetCode" column="target_code" />
<result property="tagetName" column="taget_name" />
<result property="targetModelCode" column="target_model_code" />
<result property="valueOriginal" column="value_original" />
<result property="valueResult" column="value_result" />
<result property="valuePlan" column="value_plan" />
<result property="dateYear" column="date_year" />
<result property="dateMonth" column="date_month" />
<result property="dateDay" column="date_day" />
<result property="valueTemp" column="value_temp" />
<result property="fieldCode" column="field_code" />
<result property="fieldName" column="field_name" />
<result property="valueAdjust" column="value_adjust" />
</resultMap>
<sql id="selectDcBusiTargetDraftDaynewVo">
select id, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, company_id, company_name, organize_id, organize_name, asset_code, asset_name, target_code, taget_name, target_model_code, value_original, value_result, value_plan, date_year, date_month, date_day, value_temp, field_code, field_name, value_adjust from dc_busi_target_draft_daynew
</sql>
<select id="selectDcBusiTargetDraftDaynewList" parameterType="DcBusiTargetDraftDaynew" resultMap="DcBusiTargetDraftDaynewResult">
<include refid="selectDcBusiTargetDraftDaynewVo"/>
<where>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="organizeId != null "> and organize_id = #{organizeId}</if>
<if test="organizeName != null and organizeName != ''"> and organize_name like concat('%', #{organizeName}, '%')</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="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if>
<if test="tagetName != null and tagetName != ''"> and taget_name like concat('%', #{tagetName}, '%')</if>
<if test="targetModelCode != null and targetModelCode != ''"> and target_model_code = #{targetModelCode}</if>
<if test="valueOriginal != null "> and value_original = #{valueOriginal}</if>
<if test="valueResult != null "> and value_result = #{valueResult}</if>
<if test="valuePlan != null "> and value_plan = #{valuePlan}</if>
<if test="dateYear != null and dateYear != ''"> and date_year = #{dateYear}</if>
<if test="dateMonth != null and dateMonth != ''"> and date_month = #{dateMonth}</if>
<if test="dateDay != null and dateDay != ''"> and date_day = #{dateDay}</if>
<if test="valueTemp != null "> and value_temp = #{valueTemp}</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="valueAdjust != null "> and value_adjust = #{valueAdjust}</if>
</where>
</select>
<select id="selectDcBusiTargetDraftDaynewById" parameterType="String" resultMap="DcBusiTargetDraftDaynewResult">
<include refid="selectDcBusiTargetDraftDaynewVo"/>
where id = #{id}
</select>
<insert id="insertDcBusiTargetDraftDaynew" parameterType="DcBusiTargetDraftDaynew" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_target_draft_daynew
<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="companyId != null">company_id,</if>
<if test="companyName != null">company_name,</if>
<if test="organizeId != null">organize_id,</if>
<if test="organizeName != null">organize_name,</if>
<if test="assetCode != null">asset_code,</if>
<if test="assetName != null">asset_name,</if>
<if test="targetCode != null">target_code,</if>
<if test="tagetName != null">taget_name,</if>
<if test="targetModelCode != null">target_model_code,</if>
<if test="valueOriginal != null">value_original,</if>
<if test="valueResult != null">value_result,</if>
<if test="valuePlan != null">value_plan,</if>
<if test="dateYear != null">date_year,</if>
<if test="dateMonth != null">date_month,</if>
<if test="dateDay != null">date_day,</if>
<if test="valueTemp != null">value_temp,</if>
<if test="fieldCode != null">field_code,</if>
<if test="fieldName != null">field_name,</if>
<if test="valueAdjust != null">value_adjust,</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="companyId != null">#{companyId},</if>
<if test="companyName != null">#{companyName},</if>
<if test="organizeId != null">#{organizeId},</if>
<if test="organizeName != null">#{organizeName},</if>
<if test="assetCode != null">#{assetCode},</if>
<if test="assetName != null">#{assetName},</if>
<if test="targetCode != null">#{targetCode},</if>
<if test="tagetName != null">#{tagetName},</if>
<if test="targetModelCode != null">#{targetModelCode},</if>
<if test="valueOriginal != null">#{valueOriginal},</if>
<if test="valueResult != null">#{valueResult},</if>
<if test="valuePlan != null">#{valuePlan},</if>
<if test="dateYear != null">#{dateYear},</if>
<if test="dateMonth != null">#{dateMonth},</if>
<if test="dateDay != null">#{dateDay},</if>
<if test="valueTemp != null">#{valueTemp},</if>
<if test="fieldCode != null">#{fieldCode},</if>
<if test="fieldName != null">#{fieldName},</if>
<if test="valueAdjust != null">#{valueAdjust},</if>
</trim>
</insert>
<update id="updateDcBusiTargetDraftDaynew" parameterType="DcBusiTargetDraftDaynew">
update dc_busi_target_draft_daynew
<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="companyId != null">company_id = #{companyId},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="organizeId != null">organize_id = #{organizeId},</if>
<if test="organizeName != null">organize_name = #{organizeName},</if>
<if test="assetCode != null">asset_code = #{assetCode},</if>
<if test="assetName != null">asset_name = #{assetName},</if>
<if test="targetCode != null">target_code = #{targetCode},</if>
<if test="tagetName != null">taget_name = #{tagetName},</if>
<if test="targetModelCode != null">target_model_code = #{targetModelCode},</if>
<if test="valueOriginal != null">value_original = #{valueOriginal},</if>
<if test="valueResult != null">value_result = #{valueResult},</if>
<if test="valuePlan != null">value_plan = #{valuePlan},</if>
<if test="dateYear != null">date_year = #{dateYear},</if>
<if test="dateMonth != null">date_month = #{dateMonth},</if>
<if test="dateDay != null">date_day = #{dateDay},</if>
<if test="valueTemp != null">value_temp = #{valueTemp},</if>
<if test="fieldCode != null">field_code = #{fieldCode},</if>
<if test="fieldName != null">field_name = #{fieldName},</if>
<if test="valueAdjust != null">value_adjust = #{valueAdjust},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcBusiTargetDraftDaynewById" parameterType="String">
delete from dc_busi_target_draft_daynew where id = #{id}
</delete>
<delete id="deleteDcBusiTargetDraftDaynewByIds" parameterType="String">
delete from dc_busi_target_draft_daynew where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

6
lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml

@ -70,6 +70,12 @@
where id = #{id}
</select>
<select id="selectDcBaseAssetTargetByTargetCodeAndAssetCode" resultMap="DcBaseAssetTargetResult">
<include refid="selectDcBaseAssetTargetVo"/>
where target_code = #{targetCode}
and asset_code = #{assetCode}
</select>
<insert id="insertDcBaseAssetTarget" parameterType="DcBaseAssetTarget" useGeneratedKeys="true" keyProperty="id">
insert into dc_base_asset_target
<trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save