Merge remote-tracking branch 'origin/dev' into dev
commit
c58e0d6747
@ -0,0 +1,40 @@
|
||||
package org.dromara.oa.base.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 模板变量赋值结果视图对象
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-01-XX
|
||||
*/
|
||||
@Data
|
||||
public class TemplateVariableAssignVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 变量名称
|
||||
*/
|
||||
private String varName;
|
||||
|
||||
/**
|
||||
* 变量显示名称
|
||||
*/
|
||||
private String varLabel;
|
||||
|
||||
/**
|
||||
* 已赋值的变量值
|
||||
*/
|
||||
private Object varValue;
|
||||
|
||||
/**
|
||||
* 变量类型(1文本 2数值 3时间 4数组)
|
||||
*/
|
||||
private String varType;
|
||||
}
|
||||
|
||||
@ -0,0 +1,116 @@
|
||||
package org.dromara.oa.crm.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.oa.crm.domain.vo.CrmSupplierInfoVo;
|
||||
import org.dromara.oa.crm.domain.bo.CrmSupplierInfoBo;
|
||||
import org.dromara.oa.crm.service.ICrmSupplierInfoService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 供应商信息
|
||||
* 前端访问路由地址为:/oa/crm/crmSupplierInfo
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/crm/crmSupplierInfo")
|
||||
public class CrmSupplierInfoController extends BaseController {
|
||||
|
||||
private final ICrmSupplierInfoService crmSupplierInfoService;
|
||||
|
||||
/**
|
||||
* 查询供应商信息列表
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmSupplierInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CrmSupplierInfoVo> list(CrmSupplierInfoBo bo, PageQuery pageQuery) {
|
||||
return crmSupplierInfoService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出供应商信息列表
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmSupplierInfo:export")
|
||||
@Log(title = "供应商信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CrmSupplierInfoBo bo, HttpServletResponse response) {
|
||||
List<CrmSupplierInfoVo> list = crmSupplierInfoService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "供应商信息", CrmSupplierInfoVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商信息详细信息
|
||||
*
|
||||
* @param supplierId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmSupplierInfo:query")
|
||||
@GetMapping("/{supplierId}")
|
||||
public R<CrmSupplierInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("supplierId") Long supplierId) {
|
||||
return R.ok(crmSupplierInfoService.queryById(supplierId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应商信息
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmSupplierInfo:add")
|
||||
@Log(title = "供应商信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CrmSupplierInfoBo bo) {
|
||||
return toAjax(crmSupplierInfoService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商信息
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmSupplierInfo:edit")
|
||||
@Log(title = "供应商信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CrmSupplierInfoBo bo) {
|
||||
return toAjax(crmSupplierInfoService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供应商信息
|
||||
*
|
||||
* @param supplierIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmSupplierInfo:remove")
|
||||
@Log(title = "供应商信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{supplierIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("supplierIds") Long[] supplierIds) {
|
||||
return toAjax(crmSupplierInfoService.deleteWithValidByIds(List.of(supplierIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询供应商信息列表
|
||||
*/
|
||||
@GetMapping("/getCrmSupplierInfoList")
|
||||
public R<List<CrmSupplierInfoVo>> getCrmSupplierInfoList(CrmSupplierInfoBo bo) {
|
||||
List<CrmSupplierInfoVo> list = crmSupplierInfoService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package org.dromara.oa.crm.service;
|
||||
|
||||
import org.dromara.oa.crm.domain.CrmSupplierInfo;
|
||||
import org.dromara.oa.crm.domain.vo.CrmSupplierInfoVo;
|
||||
import org.dromara.oa.crm.domain.bo.CrmSupplierInfoBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商信息Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
public interface ICrmSupplierInfoService {
|
||||
|
||||
/**
|
||||
* 查询供应商信息
|
||||
*
|
||||
* @param supplierId 主键
|
||||
* @return 供应商信息
|
||||
*/
|
||||
CrmSupplierInfoVo queryById(Long supplierId);
|
||||
|
||||
/**
|
||||
* 分页查询供应商信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 供应商信息分页列表
|
||||
*/
|
||||
TableDataInfo<CrmSupplierInfoVo> queryPageList(CrmSupplierInfoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的供应商信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 供应商信息列表
|
||||
*/
|
||||
List<CrmSupplierInfoVo> queryList(CrmSupplierInfoBo bo);
|
||||
|
||||
/**
|
||||
* 新增供应商信息
|
||||
*
|
||||
* @param bo 供应商信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(CrmSupplierInfoBo bo);
|
||||
|
||||
/**
|
||||
* 修改供应商信息
|
||||
*
|
||||
* @param bo 供应商信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(CrmSupplierInfoBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除供应商信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,217 @@
|
||||
package org.dromara.oa.crm.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.oa.crm.domain.bo.CrmSupplierInfoBo;
|
||||
import org.dromara.oa.crm.domain.vo.CrmSupplierInfoVo;
|
||||
import org.dromara.oa.crm.domain.CrmSupplierInfo;
|
||||
import org.dromara.oa.crm.mapper.CrmSupplierInfoMapper;
|
||||
import org.dromara.oa.crm.service.ICrmSupplierInfoService;
|
||||
import org.dromara.resource.api.RemoteFileService;
|
||||
import org.dromara.resource.api.domain.RemoteFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 供应商信息Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CrmSupplierInfoServiceImpl implements ICrmSupplierInfoService {
|
||||
|
||||
private final CrmSupplierInfoMapper baseMapper;
|
||||
@DubboReference(mock = "true")
|
||||
private RemoteFileService remoteFileService;
|
||||
|
||||
/**
|
||||
* 查询供应商信息
|
||||
*
|
||||
* @param supplierId 主键
|
||||
* @return 供应商信息
|
||||
*/
|
||||
@Override
|
||||
public CrmSupplierInfoVo queryById(Long supplierId){
|
||||
CrmSupplierInfoVo vo = baseMapper.selectVoById(supplierId);
|
||||
fillAttachmentInfo(Collections.singletonList(vo));
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询供应商信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 供应商信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CrmSupplierInfoVo> queryPageList(CrmSupplierInfoBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<CrmSupplierInfo> lqw = buildQueryWrapper(bo);
|
||||
Page<CrmSupplierInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
fillAttachmentInfo(result.getRecords());
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的供应商信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 供应商信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<CrmSupplierInfoVo> queryList(CrmSupplierInfoBo bo) {
|
||||
MPJLambdaWrapper<CrmSupplierInfo> lqw = buildQueryWrapper(bo);
|
||||
List<CrmSupplierInfoVo> list = baseMapper.selectVoList(lqw);
|
||||
fillAttachmentInfo(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<CrmSupplierInfo> buildQueryWrapper(CrmSupplierInfoBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<CrmSupplierInfo> lqw = JoinWrappers.lambda(CrmSupplierInfo.class)
|
||||
.selectAll(CrmSupplierInfo.class)
|
||||
// // 左连接 sys_user 表获取归属人员名称
|
||||
// .selectAs(SysUser::getNickName, CrmSupplierInfo::getOwnerName)
|
||||
// .leftJoin(SysUser.class, SysUser::getUserId, CrmSupplierInfo::getOwnerId)
|
||||
.eq(CrmSupplierInfo::getDelFlag, "0")
|
||||
.like(StringUtils.isNotBlank(bo.getSupplierName()), CrmSupplierInfo::getSupplierName, bo.getSupplierName())
|
||||
.like(StringUtils.isNotBlank(bo.getMnemonicName()), CrmSupplierInfo::getMnemonicName, bo.getMnemonicName())
|
||||
.eq(StringUtils.isNotBlank(bo.getSupplierType()), CrmSupplierInfo::getSupplierType, bo.getSupplierType())
|
||||
.eq(bo.getRegisteredCapital() != null, CrmSupplierInfo::getRegisteredCapital, bo.getRegisteredCapital())
|
||||
.eq(bo.getEstablishmentDate() != null, CrmSupplierInfo::getEstablishmentDate, bo.getEstablishmentDate())
|
||||
.eq(StringUtils.isNotBlank(bo.getBusinessScope()), CrmSupplierInfo::getBusinessScope, bo.getBusinessScope())
|
||||
.eq(StringUtils.isNotBlank(bo.getMainIndustry()), CrmSupplierInfo::getMainIndustry, bo.getMainIndustry())
|
||||
.eq(StringUtils.isNotBlank(bo.getLegalRepresentative()), CrmSupplierInfo::getLegalRepresentative, bo.getLegalRepresentative())
|
||||
.eq(StringUtils.isNotBlank(bo.getBusinessLicenseNumber()), CrmSupplierInfo::getBusinessLicenseNumber, bo.getBusinessLicenseNumber())
|
||||
.eq(StringUtils.isNotBlank(bo.getTaxNumber()), CrmSupplierInfo::getTaxNumber, bo.getTaxNumber())
|
||||
.eq(StringUtils.isNotBlank(bo.getBankAccountOpening()), CrmSupplierInfo::getBankAccountOpening, bo.getBankAccountOpening())
|
||||
.eq(StringUtils.isNotBlank(bo.getBankNumber()), CrmSupplierInfo::getBankNumber, bo.getBankNumber())
|
||||
.eq(StringUtils.isNotBlank(bo.getRegisteredAddress()), CrmSupplierInfo::getRegisteredAddress, bo.getRegisteredAddress())
|
||||
.eq(StringUtils.isNotBlank(bo.getBusinessAddress()), CrmSupplierInfo::getBusinessAddress, bo.getBusinessAddress())
|
||||
.eq(StringUtils.isNotBlank(bo.getContactPerson()), CrmSupplierInfo::getContactPerson, bo.getContactPerson())
|
||||
.eq(StringUtils.isNotBlank(bo.getContactPhone()), CrmSupplierInfo::getContactPhone, bo.getContactPhone())
|
||||
.eq(StringUtils.isNotBlank(bo.getContactMobile()), CrmSupplierInfo::getContactMobile, bo.getContactMobile())
|
||||
.eq(StringUtils.isNotBlank(bo.getContactEmail()), CrmSupplierInfo::getContactEmail, bo.getContactEmail())
|
||||
.eq(StringUtils.isNotBlank(bo.getContactFax()), CrmSupplierInfo::getContactFax, bo.getContactFax())
|
||||
.eq(StringUtils.isNotBlank(bo.getWebsite()), CrmSupplierInfo::getWebsite, bo.getWebsite())
|
||||
.eq(bo.getOwnerId() != null, CrmSupplierInfo::getOwnerId, bo.getOwnerId())
|
||||
.eq(StringUtils.isNotBlank(bo.getDetailedAddress()), CrmSupplierInfo::getDetailedAddress, bo.getDetailedAddress())
|
||||
.eq(StringUtils.isNotBlank(bo.getOssId()), CrmSupplierInfo::getOssId, bo.getOssId())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), CrmSupplierInfo::getActiveFlag, bo.getActiveFlag());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
private void fillAttachmentInfo(List<CrmSupplierInfoVo> voList) {
|
||||
if (voList == null || voList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Set<String> ossIdSet = new LinkedHashSet<>();
|
||||
Map<CrmSupplierInfoVo, List<String>> voOssMapping = new HashMap<>();
|
||||
for (CrmSupplierInfoVo vo : voList) {
|
||||
if (vo == null || StringUtils.isBlank(vo.getOssId())) {
|
||||
continue;
|
||||
}
|
||||
List<String> ids = List.of(StringUtils.split(vo.getOssId(), ","));
|
||||
if (ids.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
voOssMapping.put(vo, ids);
|
||||
ossIdSet.addAll(ids);
|
||||
}
|
||||
if (ossIdSet.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
List<RemoteFile> files = remoteFileService.selectByIds(String.join(",", ossIdSet));
|
||||
Map<Long, RemoteFile> fileMap = files.stream()
|
||||
.filter(item -> item.getOssId() != null)
|
||||
.collect(Collectors.toMap(RemoteFile::getOssId, item -> item, (a, b) -> a));
|
||||
for (Entry<CrmSupplierInfoVo, List<String>> entry : voOssMapping.entrySet()) {
|
||||
List<RemoteFile> voFiles = entry.getValue().stream()
|
||||
.map(id -> {
|
||||
if (!StringUtils.isNumeric(id)) {
|
||||
return null;
|
||||
}
|
||||
Long key = Long.parseLong(id);
|
||||
return fileMap.get(key);
|
||||
})
|
||||
.filter(item -> item != null)
|
||||
.collect(Collectors.toList());
|
||||
entry.getKey().setAttachmentList(voFiles);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
// 远程文件服务异常时忽略附件
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应商信息
|
||||
*
|
||||
* @param bo 供应商信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CrmSupplierInfoBo bo) {
|
||||
CrmSupplierInfo add = MapstructUtils.convert(bo, CrmSupplierInfo.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setSupplierId(add.getSupplierId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商信息
|
||||
*
|
||||
* @param bo 供应商信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CrmSupplierInfoBo bo) {
|
||||
CrmSupplierInfo update = MapstructUtils.convert(bo, CrmSupplierInfo.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CrmSupplierInfo entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除供应商信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,130 @@
|
||||
package org.dromara.oa.erp.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.oa.erp.domain.vo.ErpProjectPlanVo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpProjectPlanBo;
|
||||
import org.dromara.oa.erp.service.IErpProjectPlanService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 项目计划
|
||||
* 前端访问路由地址为:/oa/erp/erpProjectPlan
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-10-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/erp/erpProjectPlan")
|
||||
public class ErpProjectPlanController extends BaseController {
|
||||
|
||||
private final IErpProjectPlanService erpProjectPlanService;
|
||||
|
||||
/**
|
||||
* 查询项目计划列表
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlan:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ErpProjectPlanVo> list(ErpProjectPlanBo bo, PageQuery pageQuery) {
|
||||
return erpProjectPlanService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出项目计划列表
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlan:export")
|
||||
@Log(title = "项目计划", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ErpProjectPlanBo bo, HttpServletResponse response) {
|
||||
List<ErpProjectPlanVo> list = erpProjectPlanService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "项目计划", ErpProjectPlanVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目计划详细信息
|
||||
*
|
||||
* @param projectPlanId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlan:query")
|
||||
@GetMapping("/{projectPlanId}")
|
||||
public R<ErpProjectPlanVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("projectPlanId") Long projectPlanId) {
|
||||
return R.ok(erpProjectPlanService.queryById(projectPlanId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增项目计划
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlan:add")
|
||||
@Log(title = "项目计划", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<ErpProjectPlanVo> add(@Validated(AddGroup.class) @RequestBody ErpProjectPlanBo bo) {
|
||||
erpProjectPlanService.insertByBo(bo);
|
||||
return R.ok(erpProjectPlanService.queryById(bo.getProjectPlanId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目计划
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlan:edit")
|
||||
@Log(title = "项目计划", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ErpProjectPlanBo bo) {
|
||||
return toAjax(erpProjectPlanService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目计划
|
||||
*
|
||||
* @param projectPlanIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlan:remove")
|
||||
@Log(title = "项目计划", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{projectPlanIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("projectPlanIds") Long[] projectPlanIds) {
|
||||
return toAjax(erpProjectPlanService.deleteWithValidByIds(List.of(projectPlanIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询项目计划列表
|
||||
*/
|
||||
@GetMapping("/getErpProjectPlanList")
|
||||
public R<List<ErpProjectPlanVo>> getErpProjectPlanList(ErpProjectPlanBo bo) {
|
||||
List<ErpProjectPlanVo> list = erpProjectPlanService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交项目计划并发起流程
|
||||
* @param bo 项目计划
|
||||
* @return 项目计划
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlan:add")
|
||||
@Log(title = "项目计划", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/projectPlanSubmitAndFlowStart")
|
||||
public R<ErpProjectPlanVo> projectPlanSubmitAndFlowStart(@Validated(AddGroup.class) @RequestBody ErpProjectPlanBo bo) {
|
||||
return R.ok(erpProjectPlanService.projectPlanSubmitAndFlowStart(bo));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package org.dromara.oa.erp.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.oa.erp.domain.vo.ErpProjectPlanStageVo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpProjectPlanStageBo;
|
||||
import org.dromara.oa.erp.service.IErpProjectPlanStageService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 项目计划阶段
|
||||
* 前端访问路由地址为:/oa/erp/erpProjectPlanStage
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-10-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/erp/erpProjectPlanStage")
|
||||
public class ErpProjectPlanStageController extends BaseController {
|
||||
|
||||
private final IErpProjectPlanStageService erpProjectPlanStageService;
|
||||
|
||||
/**
|
||||
* 查询项目计划阶段列表
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlanStage:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ErpProjectPlanStageVo> list(ErpProjectPlanStageBo bo, PageQuery pageQuery) {
|
||||
return erpProjectPlanStageService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出项目计划阶段列表
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlanStage:export")
|
||||
@Log(title = "项目计划阶段", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ErpProjectPlanStageBo bo, HttpServletResponse response) {
|
||||
List<ErpProjectPlanStageVo> list = erpProjectPlanStageService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "项目计划阶段", ErpProjectPlanStageVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目计划阶段详细信息
|
||||
*
|
||||
* @param planStageId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlanStage:query")
|
||||
@GetMapping("/{planStageId}")
|
||||
public R<ErpProjectPlanStageVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("planStageId") Long planStageId) {
|
||||
return R.ok(erpProjectPlanStageService.queryById(planStageId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增项目计划阶段
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlanStage:add")
|
||||
@Log(title = "项目计划阶段", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ErpProjectPlanStageBo bo) {
|
||||
return toAjax(erpProjectPlanStageService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目计划阶段
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlanStage:edit")
|
||||
@Log(title = "项目计划阶段", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ErpProjectPlanStageBo bo) {
|
||||
return toAjax(erpProjectPlanStageService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目计划阶段
|
||||
*
|
||||
* @param planStageIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:erpProjectPlanStage:remove")
|
||||
@Log(title = "项目计划阶段", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planStageIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("planStageIds") Long[] planStageIds) {
|
||||
return toAjax(erpProjectPlanStageService.deleteWithValidByIds(List.of(planStageIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询项目计划阶段列表
|
||||
*/
|
||||
@GetMapping("/getErpProjectPlanStageList")
|
||||
public R<List<ErpProjectPlanStageVo>> getErpProjectPlanStageList(ErpProjectPlanStageBo bo) {
|
||||
List<ErpProjectPlanStageVo> list = erpProjectPlanStageService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package org.dromara.oa.erp.service;
|
||||
|
||||
import org.dromara.oa.erp.domain.ErpProjectPlan;
|
||||
import org.dromara.oa.erp.domain.vo.ErpProjectPlanVo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpProjectPlanBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目计划Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-10-30
|
||||
*/
|
||||
public interface IErpProjectPlanService {
|
||||
|
||||
/**
|
||||
* 查询项目计划
|
||||
*
|
||||
* @param projectPlanId 主键
|
||||
* @return 项目计划
|
||||
*/
|
||||
ErpProjectPlanVo queryById(Long projectPlanId);
|
||||
|
||||
/**
|
||||
* 分页查询项目计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 项目计划分页列表
|
||||
*/
|
||||
TableDataInfo<ErpProjectPlanVo> queryPageList(ErpProjectPlanBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的项目计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 项目计划列表
|
||||
*/
|
||||
List<ErpProjectPlanVo> queryList(ErpProjectPlanBo bo);
|
||||
|
||||
/**
|
||||
* 新增项目计划
|
||||
*
|
||||
* @param bo 项目计划
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(ErpProjectPlanBo bo);
|
||||
|
||||
/**
|
||||
* 修改项目计划
|
||||
*
|
||||
* @param bo 项目计划
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(ErpProjectPlanBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除项目计划信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 提交项目计划并发起流程
|
||||
* @param bo 项目计划
|
||||
* @return 项目计划
|
||||
*/
|
||||
ErpProjectPlanVo projectPlanSubmitAndFlowStart(ErpProjectPlanBo bo);
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package org.dromara.oa.erp.service;
|
||||
|
||||
import org.dromara.oa.erp.domain.ErpProjectPlanStage;
|
||||
import org.dromara.oa.erp.domain.vo.ErpProjectPlanStageVo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpProjectPlanStageBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目计划阶段Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-10-30
|
||||
*/
|
||||
public interface IErpProjectPlanStageService {
|
||||
|
||||
/**
|
||||
* 查询项目计划阶段
|
||||
*
|
||||
* @param planStageId 主键
|
||||
* @return 项目计划阶段
|
||||
*/
|
||||
ErpProjectPlanStageVo queryById(Long planStageId);
|
||||
|
||||
/**
|
||||
* 分页查询项目计划阶段列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 项目计划阶段分页列表
|
||||
*/
|
||||
TableDataInfo<ErpProjectPlanStageVo> queryPageList(ErpProjectPlanStageBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的项目计划阶段列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 项目计划阶段列表
|
||||
*/
|
||||
List<ErpProjectPlanStageVo> queryList(ErpProjectPlanStageBo bo);
|
||||
|
||||
/**
|
||||
* 新增项目计划阶段
|
||||
*
|
||||
* @param bo 项目计划阶段
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(ErpProjectPlanStageBo bo);
|
||||
|
||||
/**
|
||||
* 修改项目计划阶段
|
||||
*
|
||||
* @param bo 项目计划阶段
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(ErpProjectPlanStageBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除项目计划阶段信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,149 @@
|
||||
package org.dromara.oa.erp.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.oa.erp.domain.bo.ErpProjectPlanStageBo;
|
||||
import org.dromara.oa.erp.domain.vo.ErpProjectPlanStageVo;
|
||||
import org.dromara.oa.erp.domain.ErpProjectPlanStage;
|
||||
import org.dromara.oa.erp.mapper.ErpProjectPlanStageMapper;
|
||||
import org.dromara.oa.erp.service.IErpProjectPlanStageService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 项目计划阶段Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-10-30
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ErpProjectPlanStageServiceImpl implements IErpProjectPlanStageService {
|
||||
|
||||
private final ErpProjectPlanStageMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询项目计划阶段
|
||||
*
|
||||
* @param planStageId 主键
|
||||
* @return 项目计划阶段
|
||||
*/
|
||||
@Override
|
||||
public ErpProjectPlanStageVo queryById(Long planStageId){
|
||||
return baseMapper.selectVoById(planStageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询项目计划阶段列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 项目计划阶段分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ErpProjectPlanStageVo> queryPageList(ErpProjectPlanStageBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<ErpProjectPlanStage> lqw = buildQueryWrapper(bo);
|
||||
Page<ErpProjectPlanStageVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的项目计划阶段列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 项目计划阶段列表
|
||||
*/
|
||||
@Override
|
||||
public List<ErpProjectPlanStageVo> queryList(ErpProjectPlanStageBo bo) {
|
||||
MPJLambdaWrapper<ErpProjectPlanStage> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<ErpProjectPlanStage> buildQueryWrapper(ErpProjectPlanStageBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<ErpProjectPlanStage> lqw = JoinWrappers.lambda(ErpProjectPlanStage.class)
|
||||
.selectAll(ErpProjectPlanStage.class)
|
||||
.eq(ErpProjectPlanStage::getDelFlag, "0")
|
||||
.eq(bo.getProjectId() != null, ErpProjectPlanStage::getProjectId, bo.getProjectId())
|
||||
.eq(bo.getProjectPlanId() != null, ErpProjectPlanStage::getProjectPlanId, bo.getProjectPlanId())
|
||||
.eq(StringUtils.isNotBlank(bo.getProjectPhases()), ErpProjectPlanStage::getProjectPhases, bo.getProjectPhases())
|
||||
.eq(bo.getPlanStartTime() != null, ErpProjectPlanStage::getPlanStartTime, bo.getPlanStartTime())
|
||||
.eq(bo.getPlanEndTime() != null, ErpProjectPlanStage::getPlanEndTime, bo.getPlanEndTime())
|
||||
.eq(StringUtils.isNotBlank(bo.getCollectionStage()), ErpProjectPlanStage::getCollectionStage, bo.getCollectionStage())
|
||||
.eq(bo.getRepaymentRate() != null, ErpProjectPlanStage::getRepaymentRate, bo.getRepaymentRate())
|
||||
.eq(bo.getRepaymentAmount() != null, ErpProjectPlanStage::getRepaymentAmount, bo.getRepaymentAmount())
|
||||
.eq(bo.getRepaymentTime() != null, ErpProjectPlanStage::getRepaymentTime, bo.getRepaymentTime())
|
||||
.eq(bo.getDelayDay() != null, ErpProjectPlanStage::getDelayDay, bo.getDelayDay())
|
||||
.eq(bo.getReceivableDate() != null, ErpProjectPlanStage::getReceivableDate, bo.getReceivableDate())
|
||||
.eq(StringUtils.isNotBlank(bo.getReasonsExplanation()), ErpProjectPlanStage::getReasonsExplanation, bo.getReasonsExplanation())
|
||||
.eq(StringUtils.isNotBlank(bo.getScheduleRemark()), ErpProjectPlanStage::getScheduleRemark, bo.getScheduleRemark())
|
||||
.eq(bo.getRealStartTime() != null, ErpProjectPlanStage::getRealStartTime, bo.getRealStartTime())
|
||||
.eq(bo.getRealEndTime() != null, ErpProjectPlanStage::getRealEndTime, bo.getRealEndTime())
|
||||
.eq(bo.getSortOrder() != null, ErpProjectPlanStage::getSortOrder, bo.getSortOrder())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), ErpProjectPlanStage::getActiveFlag, bo.getActiveFlag())
|
||||
;
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增项目计划阶段
|
||||
*
|
||||
* @param bo 项目计划阶段
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ErpProjectPlanStageBo bo) {
|
||||
ErpProjectPlanStage add = MapstructUtils.convert(bo, ErpProjectPlanStage.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setPlanStageId(add.getPlanStageId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目计划阶段
|
||||
*
|
||||
* @param bo 项目计划阶段
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ErpProjectPlanStageBo bo) {
|
||||
ErpProjectPlanStage update = MapstructUtils.convert(bo, ErpProjectPlanStage.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ErpProjectPlanStage entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除项目计划阶段信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,319 @@
|
||||
<?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="org.dromara.oa.crm.mapper.CrmSupplierInfoMapper">
|
||||
<resultMap type="org.dromara.oa.crm.domain.vo.CrmSupplierInfoVo" id="CrmSupplierInfoResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomCrmSupplierInfoVoList" resultMap="CrmSupplierInfoResult">
|
||||
select t.supplier_id, t.tenant_id, t.supplier_name, t.mnemonic_name, t.supplier_type,
|
||||
t.registered_capital, t.establishment_date, t.business_scope, t.main_industry,
|
||||
t.legal_representative, t.business_license_number, t.tax_number, t.bank_account_opening,
|
||||
t.bank_number, t.registered_address, t.business_address, t.contact_person, t.contact_phone, t.contact_mobile,
|
||||
t.contact_email, t.contact_fax, t.website, t.owner_id, t.detailed_address, t.oss_id, t.remark, t.active_flag, t.del_flag, t.create_dept,
|
||||
u1.nick_name as ownerName,
|
||||
t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_supplier_info t
|
||||
left join sys_user u1 on u1.user_id = t.owner_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 根据ID查询详情 -->
|
||||
<select id="selectCustomCrmSupplierInfoVoById" resultMap="CrmSupplierInfoResult">
|
||||
select t.supplier_id, t.tenant_id, t.supplier_name, t.mnemonic_name, t.supplier_type, t.registered_capital, t.establishment_date, t.business_scope, t.main_industry, t.legal_representative, t.business_license_number, t.tax_number, t.bank_account_opening, t.bank_number, t.registered_address, t.business_address, t.contact_person, t.contact_phone, t.contact_mobile, t.contact_email, t.contact_fax, t.website, t.owner_id, t.detailed_address, t.oss_id, t.remark, t.active_flag, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_supplier_info t
|
||||
where t.supplier_id = #{supplierId}
|
||||
</select>
|
||||
|
||||
<!-- 批量查询 - 根据ID列表 -->
|
||||
<select id="selectCustomCrmSupplierInfoVoByIds" resultMap="CrmSupplierInfoResult">
|
||||
select t.supplier_id, t.tenant_id, t.supplier_name, t.mnemonic_name, t.supplier_type, t.registered_capital, t.establishment_date, t.business_scope, t.main_industry, t.legal_representative, t.business_license_number, t.tax_number, t.bank_account_opening, t.bank_number, t.registered_address, t.business_address, t.contact_person, t.contact_phone, t.contact_mobile, t.contact_email, t.contact_fax, t.website, t.owner_id, t.detailed_address, t.oss_id, t.remark, t.active_flag, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_supplier_info t
|
||||
where t.supplier_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 统计查询 -->
|
||||
<select id="countCustomCrmSupplierInfo" resultType="java.lang.Long">
|
||||
select count(1) from crm_supplier_info t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 分页查询(带自定义条件) -->
|
||||
<select id="selectCustomCrmSupplierInfoVoPage" resultMap="CrmSupplierInfoResult">
|
||||
select t.supplier_id, t.tenant_id, t.supplier_name, t.mnemonic_name, t.supplier_type, t.registered_capital, t.establishment_date, t.business_scope, t.main_industry, t.legal_representative, t.business_license_number, t.tax_number, t.bank_account_opening, t.bank_number, t.registered_address, t.business_address, t.contact_person, t.contact_phone, t.contact_mobile, t.contact_email, t.contact_fax, t.website, t.owner_id, t.detailed_address, t.oss_id, t.remark, t.active_flag, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_supplier_info t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsertCrmSupplierInfo">
|
||||
insert into crm_supplier_info(
|
||||
tenant_id,
|
||||
|
||||
supplier_name,
|
||||
|
||||
mnemonic_name,
|
||||
|
||||
supplier_type,
|
||||
|
||||
registered_capital,
|
||||
|
||||
establishment_date,
|
||||
|
||||
business_scope,
|
||||
|
||||
main_industry,
|
||||
|
||||
legal_representative,
|
||||
|
||||
business_license_number,
|
||||
|
||||
tax_number,
|
||||
|
||||
bank_account_opening,
|
||||
|
||||
bank_number,
|
||||
|
||||
registered_address,
|
||||
|
||||
business_address,
|
||||
|
||||
contact_person,
|
||||
|
||||
contact_phone,
|
||||
|
||||
contact_mobile,
|
||||
|
||||
contact_email,
|
||||
|
||||
contact_fax,
|
||||
|
||||
website,
|
||||
|
||||
owner_id,
|
||||
|
||||
detailed_address,
|
||||
|
||||
oss_id,
|
||||
|
||||
remark,
|
||||
|
||||
active_flag,
|
||||
|
||||
del_flag,
|
||||
|
||||
create_dept,
|
||||
|
||||
create_by,
|
||||
|
||||
create_time,
|
||||
|
||||
update_by,
|
||||
|
||||
update_time
|
||||
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.tenantId},
|
||||
|
||||
#{item.supplierName},
|
||||
|
||||
#{item.mnemonicName},
|
||||
|
||||
#{item.supplierType},
|
||||
|
||||
#{item.registeredCapital},
|
||||
|
||||
#{item.establishmentDate},
|
||||
|
||||
#{item.businessScope},
|
||||
|
||||
#{item.mainIndustry},
|
||||
|
||||
#{item.legalRepresentative},
|
||||
|
||||
#{item.businessLicenseNumber},
|
||||
|
||||
#{item.taxNumber},
|
||||
|
||||
#{item.bankAccountOpening},
|
||||
|
||||
#{item.bankNumber},
|
||||
|
||||
#{item.registeredAddress},
|
||||
|
||||
#{item.businessAddress},
|
||||
|
||||
#{item.contactPerson},
|
||||
|
||||
#{item.contactPhone},
|
||||
|
||||
#{item.contactMobile},
|
||||
|
||||
#{item.contactEmail},
|
||||
|
||||
#{item.contactFax},
|
||||
|
||||
#{item.website},
|
||||
|
||||
#{item.ownerId},
|
||||
|
||||
#{item.detailedAddress},
|
||||
|
||||
#{item.ossId},
|
||||
|
||||
#{item.remark},
|
||||
|
||||
#{item.activeFlag},
|
||||
|
||||
#{item.delFlag},
|
||||
|
||||
#{item.createDept},
|
||||
|
||||
#{item.createBy},
|
||||
|
||||
#{item.createTime},
|
||||
|
||||
#{item.updateBy},
|
||||
|
||||
#{item.updateTime}
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新 -->
|
||||
<update id="batchUpdateCrmSupplierInfo">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update crm_supplier_info
|
||||
<set>
|
||||
<if test="item.tenantId != null and item.tenantId != ''">
|
||||
tenant_id = #{item.tenantId},
|
||||
</if>
|
||||
<if test="item.supplierName != null and item.supplierName != ''">
|
||||
supplier_name = #{item.supplierName},
|
||||
</if>
|
||||
<if test="item.mnemonicName != null and item.mnemonicName != ''">
|
||||
mnemonic_name = #{item.mnemonicName},
|
||||
</if>
|
||||
<if test="item.supplierType != null and item.supplierType != ''">
|
||||
supplier_type = #{item.supplierType},
|
||||
</if>
|
||||
<if test="item.registeredCapital != null">
|
||||
registered_capital = #{item.registeredCapital},
|
||||
</if>
|
||||
<if test="item.establishmentDate != null">
|
||||
establishment_date = #{item.establishmentDate},
|
||||
</if>
|
||||
<if test="item.businessScope != null and item.businessScope != ''">
|
||||
business_scope = #{item.businessScope},
|
||||
</if>
|
||||
<if test="item.mainIndustry != null and item.mainIndustry != ''">
|
||||
main_industry = #{item.mainIndustry},
|
||||
</if>
|
||||
<if test="item.legalRepresentative != null and item.legalRepresentative != ''">
|
||||
legal_representative = #{item.legalRepresentative},
|
||||
</if>
|
||||
<if test="item.businessLicenseNumber != null and item.businessLicenseNumber != ''">
|
||||
business_license_number = #{item.businessLicenseNumber},
|
||||
</if>
|
||||
<if test="item.taxNumber != null and item.taxNumber != ''">
|
||||
tax_number = #{item.taxNumber},
|
||||
</if>
|
||||
<if test="item.bankAccountOpening != null and item.bankAccountOpening != ''">
|
||||
bank_account_opening = #{item.bankAccountOpening},
|
||||
</if>
|
||||
<if test="item.bankNumber != null and item.bankNumber != ''">
|
||||
bank_number = #{item.bankNumber},
|
||||
</if>
|
||||
<if test="item.registeredAddress != null and item.registeredAddress != ''">
|
||||
registered_address = #{item.registeredAddress},
|
||||
</if>
|
||||
<if test="item.businessAddress != null and item.businessAddress != ''">
|
||||
business_address = #{item.businessAddress},
|
||||
</if>
|
||||
<if test="item.contactPerson != null and item.contactPerson != ''">
|
||||
contact_person = #{item.contactPerson},
|
||||
</if>
|
||||
<if test="item.contactPhone != null and item.contactPhone != ''">
|
||||
contact_phone = #{item.contactPhone},
|
||||
</if>
|
||||
<if test="item.contactMobile != null and item.contactMobile != ''">
|
||||
contact_mobile = #{item.contactMobile},
|
||||
</if>
|
||||
<if test="item.contactEmail != null and item.contactEmail != ''">
|
||||
contact_email = #{item.contactEmail},
|
||||
</if>
|
||||
<if test="item.contactFax != null and item.contactFax != ''">
|
||||
contact_fax = #{item.contactFax},
|
||||
</if>
|
||||
<if test="item.website != null and item.website != ''">
|
||||
website = #{item.website},
|
||||
</if>
|
||||
<if test="item.ownerId != null">
|
||||
owner_id = #{item.ownerId},
|
||||
</if>
|
||||
<if test="item.detailedAddress != null and item.detailedAddress != ''">
|
||||
detailed_address = #{item.detailedAddress},
|
||||
</if>
|
||||
<if test="item.ossId != null and item.ossId != ''">
|
||||
oss_id = #{item.ossId},
|
||||
</if>
|
||||
<if test="item.remark != null and item.remark != ''">
|
||||
remark = #{item.remark},
|
||||
</if>
|
||||
<if test="item.activeFlag != null and item.activeFlag != ''">
|
||||
active_flag = #{item.activeFlag},
|
||||
</if>
|
||||
<if test="item.delFlag != null and item.delFlag != ''">
|
||||
del_flag = #{item.delFlag},
|
||||
</if>
|
||||
<if test="item.createDept != null">
|
||||
create_dept = #{item.createDept},
|
||||
</if>
|
||||
<if test="item.createBy != null">
|
||||
create_by = #{item.createBy},
|
||||
</if>
|
||||
<if test="item.createTime != null">
|
||||
create_time = #{item.createTime},
|
||||
</if>
|
||||
<if test="item.updateBy != null">
|
||||
update_by = #{item.updateBy},
|
||||
</if>
|
||||
<if test="item.updateTime != null">
|
||||
update_time = #{item.updateTime}
|
||||
</if>
|
||||
</set>
|
||||
where supplier_id = #{item.supplierId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据自定义条件删除 -->
|
||||
<delete id="deleteCustomCrmSupplierInfo">
|
||||
delete from crm_supplier_info
|
||||
${ew.getCustomSqlSegment}
|
||||
</delete>
|
||||
|
||||
<!-- 根据ID列表批量删除 -->
|
||||
<delete id="deleteCustomCrmSupplierInfoByIds">
|
||||
delete from crm_supplier_info
|
||||
where supplier_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 检查是否存在 -->
|
||||
<select id="existsCrmSupplierInfo" resultType="java.lang.Boolean">
|
||||
select count(1) > 0 from crm_supplier_info t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,307 @@
|
||||
<?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="org.dromara.oa.erp.mapper.ErpProjectPlanMapper">
|
||||
<resultMap type="org.dromara.oa.erp.domain.vo.ErpProjectPlanVo" id="ErpProjectPlanResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomErpProjectPlanVoList" resultMap="ErpProjectPlanResult">
|
||||
select t.project_plan_id,
|
||||
t.tenant_id,
|
||||
t.project_id,
|
||||
t.manager_id,
|
||||
t.charge_id,
|
||||
t.payment_method,
|
||||
t.project_plan_status,
|
||||
t.flow_status,
|
||||
t.sort_order,
|
||||
t.contract_id,
|
||||
t.remark,
|
||||
t.active_flag,
|
||||
t.del_flag,
|
||||
t.create_dept,
|
||||
t.create_by,
|
||||
t.create_time,
|
||||
t.update_by,
|
||||
t.update_time,
|
||||
p.project_name,
|
||||
u1.nick_name as managerName,
|
||||
u2.nick_name as chargeName,
|
||||
c.contract_name as contractName
|
||||
from erp_project_plan t
|
||||
left join erp_project_info p on t.project_id = p.project_id
|
||||
left join sys_user u1 on t.manager_id = u1.user_id
|
||||
left join sys_user u2 on t.charge_id = u2.user_id
|
||||
left join erp_contract_info c on t.contract_id = c.contract_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 根据ID查询详情 -->
|
||||
<select id="selectCustomErpProjectPlanVoById" resultMap="ErpProjectPlanResult">
|
||||
select t.project_plan_id,
|
||||
t.tenant_id,
|
||||
t.project_id,
|
||||
t.manager_id,
|
||||
t.charge_id,
|
||||
t.payment_method,
|
||||
t.project_plan_status,
|
||||
t.flow_status,
|
||||
t.sort_order,
|
||||
t.contract_id,
|
||||
t.remark,
|
||||
t.active_flag,
|
||||
t.del_flag,
|
||||
t.create_dept,
|
||||
t.create_by,
|
||||
t.create_time,
|
||||
t.update_by,
|
||||
t.update_time,
|
||||
p.project_name,
|
||||
u1.nick_name as managerName,
|
||||
u2.nick_name as chargeName,
|
||||
c.contract_name as contractName
|
||||
from erp_project_plan t
|
||||
left join erp_project_info p on t.project_id = p.project_id
|
||||
left join sys_user u1 on t.manager_id = u1.user_id
|
||||
left join sys_user u2 on t.charge_id = u2.user_id
|
||||
left join erp_contract_info c on t.contract_id = c.contract_id
|
||||
where t.project_plan_id = #{projectPlanId}
|
||||
</select>
|
||||
|
||||
<!-- 批量查询 - 根据ID列表 -->
|
||||
<select id="selectCustomErpProjectPlanVoByIds" resultMap="ErpProjectPlanResult">
|
||||
select t.project_plan_id,
|
||||
t.tenant_id,
|
||||
t.project_id,
|
||||
t.manager_id,
|
||||
t.charge_id,
|
||||
t.payment_method,
|
||||
t.project_plan_status,
|
||||
t.flow_status,
|
||||
t.sort_order,
|
||||
t.contract_id,
|
||||
t.remark,
|
||||
t.active_flag,
|
||||
t.del_flag,
|
||||
t.create_dept,
|
||||
t.create_by,
|
||||
t.create_time,
|
||||
t.update_by,
|
||||
t.update_time,
|
||||
p.project_name,
|
||||
u1.nick_name as managerName,
|
||||
u2.nick_name as chargeName,
|
||||
c.contract_name as contractName
|
||||
from erp_project_plan t
|
||||
left join erp_project_info p on t.project_id = p.project_id
|
||||
left join sys_user u1 on t.manager_id = u1.user_id
|
||||
left join sys_user u2 on t.charge_id = u2.user_id
|
||||
left join erp_contract_info c on t.contract_id = c.contract_id
|
||||
where t.project_plan_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 统计查询 -->
|
||||
<select id="countCustomErpProjectPlan" resultType="java.lang.Long">
|
||||
select count(1) from erp_project_plan t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 分页查询(带自定义条件) -->
|
||||
<select id="selectCustomErpProjectPlanVoPage" resultMap="ErpProjectPlanResult">
|
||||
select t.project_plan_id,
|
||||
t.tenant_id,
|
||||
t.project_id,
|
||||
t.manager_id,
|
||||
t.charge_id,
|
||||
t.payment_method,
|
||||
t.project_plan_status,
|
||||
t.flow_status,
|
||||
t.sort_order,
|
||||
t.contract_id,
|
||||
t.remark,
|
||||
t.active_flag,
|
||||
t.del_flag,
|
||||
t.create_dept,
|
||||
t.create_by,
|
||||
t.create_time,
|
||||
t.update_by,
|
||||
t.update_time,
|
||||
p.project_name,
|
||||
u1.nick_name as managerName,
|
||||
u2.nick_name as chargeName,
|
||||
c.contract_name as contractName
|
||||
from erp_project_plan t
|
||||
left join erp_project_info p on t.project_id = p.project_id
|
||||
left join sys_user u1 on t.manager_id = u1.user_id
|
||||
left join sys_user u2 on t.charge_id = u2.user_id
|
||||
left join erp_contract_info c on t.contract_id = c.contract_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsertErpProjectPlan">
|
||||
insert into erp_project_plan(
|
||||
tenant_id,
|
||||
|
||||
project_id,
|
||||
|
||||
manager_id,
|
||||
|
||||
charge_id,
|
||||
|
||||
payment_method,
|
||||
|
||||
project_plan_status,
|
||||
|
||||
flow_status,
|
||||
|
||||
sort_order,
|
||||
|
||||
contract_id,
|
||||
|
||||
remark,
|
||||
|
||||
active_flag,
|
||||
|
||||
del_flag,
|
||||
|
||||
create_dept,
|
||||
|
||||
create_by,
|
||||
|
||||
create_time,
|
||||
|
||||
update_by,
|
||||
|
||||
update_time
|
||||
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.tenantId},
|
||||
|
||||
#{item.projectId},
|
||||
|
||||
#{item.managerId},
|
||||
|
||||
#{item.chargeId},
|
||||
|
||||
#{item.paymentMethod},
|
||||
|
||||
#{item.projectPlanStatus},
|
||||
|
||||
#{item.flowStatus},
|
||||
|
||||
#{item.sortOrder},
|
||||
|
||||
#{item.contractId},
|
||||
|
||||
#{item.remark},
|
||||
|
||||
#{item.activeFlag},
|
||||
|
||||
#{item.delFlag},
|
||||
|
||||
#{item.createDept},
|
||||
|
||||
#{item.createBy},
|
||||
|
||||
#{item.createTime},
|
||||
|
||||
#{item.updateBy},
|
||||
|
||||
#{item.updateTime}
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新 -->
|
||||
<update id="batchUpdateErpProjectPlan">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update erp_project_plan
|
||||
<set>
|
||||
<if test="item.tenantId != null and item.tenantId != ''">
|
||||
tenant_id = #{item.tenantId},
|
||||
</if>
|
||||
<if test="item.projectId != null">
|
||||
project_id = #{item.projectId},
|
||||
</if>
|
||||
<if test="item.managerId != null">
|
||||
manager_id = #{item.managerId},
|
||||
</if>
|
||||
<if test="item.chargeId != null">
|
||||
charge_id = #{item.chargeId},
|
||||
</if>
|
||||
<if test="item.paymentMethod != null and item.paymentMethod != ''">
|
||||
payment_method = #{item.paymentMethod},
|
||||
</if>
|
||||
<if test="item.projectPlanStatus != null and item.projectPlanStatus != ''">
|
||||
project_plan_status = #{item.projectPlanStatus},
|
||||
</if>
|
||||
<if test="item.flowStatus != null and item.flowStatus != ''">
|
||||
flow_status = #{item.flowStatus},
|
||||
</if>
|
||||
<if test="item.sortOrder != null">
|
||||
sort_order = #{item.sortOrder},
|
||||
</if>
|
||||
<if test="item.contractId != null">
|
||||
contract_id = #{item.contractId},
|
||||
</if>
|
||||
<if test="item.remark != null and item.remark != ''">
|
||||
remark = #{item.remark},
|
||||
</if>
|
||||
<if test="item.activeFlag != null and item.activeFlag != ''">
|
||||
active_flag = #{item.activeFlag},
|
||||
</if>
|
||||
<if test="item.delFlag != null and item.delFlag != ''">
|
||||
del_flag = #{item.delFlag},
|
||||
</if>
|
||||
<if test="item.createDept != null">
|
||||
create_dept = #{item.createDept},
|
||||
</if>
|
||||
<if test="item.createBy != null">
|
||||
create_by = #{item.createBy},
|
||||
</if>
|
||||
<if test="item.createTime != null">
|
||||
create_time = #{item.createTime},
|
||||
</if>
|
||||
<if test="item.updateBy != null">
|
||||
update_by = #{item.updateBy},
|
||||
</if>
|
||||
<if test="item.updateTime != null">
|
||||
update_time = #{item.updateTime}
|
||||
</if>
|
||||
</set>
|
||||
where project_plan_id = #{item.projectPlanId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据自定义条件删除 -->
|
||||
<delete id="deleteCustomErpProjectPlan">
|
||||
delete from erp_project_plan
|
||||
${ew.getCustomSqlSegment}
|
||||
</delete>
|
||||
|
||||
<!-- 根据ID列表批量删除 -->
|
||||
<delete id="deleteCustomErpProjectPlanByIds">
|
||||
delete from erp_project_plan
|
||||
where project_plan_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 检查是否存在 -->
|
||||
<select id="existsErpProjectPlan" resultType="java.lang.Boolean">
|
||||
select count(1) > 0 from erp_project_plan t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,262 @@
|
||||
<?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="org.dromara.oa.erp.mapper.ErpProjectPlanStageMapper">
|
||||
<resultMap type="org.dromara.oa.erp.domain.vo.ErpProjectPlanStageVo" id="ErpProjectPlanStageResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomErpProjectPlanStageVoList" resultMap="ErpProjectPlanStageResult">
|
||||
select plan_stage_id, tenant_id, project_id, project_plan_id, project_phases, plan_start_time, plan_end_time, collection_stage, repayment_rate, repayment_amount, repayment_time, delay_day, receivable_date, reasons_explanation, schedule_remark, real_start_time, real_end_time, sort_order, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time from erp_project_plan_stage t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 根据ID查询详情 -->
|
||||
<select id="selectCustomErpProjectPlanStageVoById" resultMap="ErpProjectPlanStageResult">
|
||||
select plan_stage_id, tenant_id, project_id, project_plan_id, project_phases, plan_start_time, plan_end_time, collection_stage, repayment_rate, repayment_amount, repayment_time, delay_day, receivable_date, reasons_explanation, schedule_remark, real_start_time, real_end_time, sort_order, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time
|
||||
from erp_project_plan_stage t
|
||||
where t.plan_stage_id = #{planStageId}
|
||||
</select>
|
||||
|
||||
<!-- 批量查询 - 根据ID列表 -->
|
||||
<select id="selectCustomErpProjectPlanStageVoByIds" resultMap="ErpProjectPlanStageResult">
|
||||
select plan_stage_id, tenant_id, project_id, project_plan_id, project_phases, plan_start_time, plan_end_time, collection_stage, repayment_rate, repayment_amount, repayment_time, delay_day, receivable_date, reasons_explanation, schedule_remark, real_start_time, real_end_time, sort_order, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time
|
||||
from erp_project_plan_stage t
|
||||
where t.plan_stage_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 统计查询 -->
|
||||
<select id="countCustomErpProjectPlanStage" resultType="java.lang.Long">
|
||||
select count(1) from erp_project_plan_stage t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 分页查询(带自定义条件) -->
|
||||
<select id="selectCustomErpProjectPlanStageVoPage" resultMap="ErpProjectPlanStageResult">
|
||||
select plan_stage_id, tenant_id, project_id, project_plan_id, project_phases, plan_start_time, plan_end_time, collection_stage, repayment_rate, repayment_amount, repayment_time, delay_day, receivable_date, reasons_explanation, schedule_remark, real_start_time, real_end_time, sort_order, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time
|
||||
from erp_project_plan_stage t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsertErpProjectPlanStage">
|
||||
insert into erp_project_plan_stage(
|
||||
tenant_id,
|
||||
|
||||
project_id,
|
||||
|
||||
project_plan_id,
|
||||
|
||||
project_phases,
|
||||
|
||||
plan_start_time,
|
||||
|
||||
plan_end_time,
|
||||
|
||||
collection_stage,
|
||||
|
||||
repayment_rate,
|
||||
|
||||
repayment_amount,
|
||||
|
||||
repayment_time,
|
||||
|
||||
delay_day,
|
||||
|
||||
receivable_date,
|
||||
|
||||
reasons_explanation,
|
||||
|
||||
schedule_remark,
|
||||
|
||||
real_start_time,
|
||||
|
||||
real_end_time,
|
||||
|
||||
sort_order,
|
||||
|
||||
remark,
|
||||
|
||||
active_flag,
|
||||
|
||||
del_flag,
|
||||
|
||||
create_dept,
|
||||
|
||||
create_by,
|
||||
|
||||
create_time,
|
||||
|
||||
update_by,
|
||||
|
||||
update_time
|
||||
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.tenantId},
|
||||
|
||||
#{item.projectId},
|
||||
|
||||
#{item.projectPlanId},
|
||||
|
||||
#{item.projectPhases},
|
||||
|
||||
#{item.planStartTime},
|
||||
|
||||
#{item.planEndTime},
|
||||
|
||||
#{item.collectionStage},
|
||||
|
||||
#{item.repaymentRate},
|
||||
|
||||
#{item.repaymentAmount},
|
||||
|
||||
#{item.repaymentTime},
|
||||
|
||||
#{item.delayDay},
|
||||
|
||||
#{item.receivableDate},
|
||||
|
||||
#{item.reasonsExplanation},
|
||||
|
||||
#{item.scheduleRemark},
|
||||
|
||||
#{item.realStartTime},
|
||||
|
||||
#{item.realEndTime},
|
||||
|
||||
#{item.sortOrder},
|
||||
|
||||
#{item.remark},
|
||||
|
||||
#{item.activeFlag},
|
||||
|
||||
#{item.delFlag},
|
||||
|
||||
#{item.createDept},
|
||||
|
||||
#{item.createBy},
|
||||
|
||||
#{item.createTime},
|
||||
|
||||
#{item.updateBy},
|
||||
|
||||
#{item.updateTime}
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新 -->
|
||||
<update id="batchUpdateErpProjectPlanStage">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update erp_project_plan_stage
|
||||
<set>
|
||||
<if test="item.tenantId != null and item.tenantId != ''">
|
||||
tenant_id = #{item.tenantId},
|
||||
</if>
|
||||
<if test="item.projectId != null">
|
||||
project_id = #{item.projectId},
|
||||
</if>
|
||||
<if test="item.projectPlanId != null">
|
||||
project_plan_id = #{item.projectPlanId},
|
||||
</if>
|
||||
<if test="item.projectPhases != null and item.projectPhases != ''">
|
||||
project_phases = #{item.projectPhases},
|
||||
</if>
|
||||
<if test="item.planStartTime != null">
|
||||
plan_start_time = #{item.planStartTime},
|
||||
</if>
|
||||
<if test="item.planEndTime != null">
|
||||
plan_end_time = #{item.planEndTime},
|
||||
</if>
|
||||
<if test="item.collectionStage != null and item.collectionStage != ''">
|
||||
collection_stage = #{item.collectionStage},
|
||||
</if>
|
||||
<if test="item.repaymentRate != null">
|
||||
repayment_rate = #{item.repaymentRate},
|
||||
</if>
|
||||
<if test="item.repaymentAmount != null">
|
||||
repayment_amount = #{item.repaymentAmount},
|
||||
</if>
|
||||
<if test="item.repaymentTime != null">
|
||||
repayment_time = #{item.repaymentTime},
|
||||
</if>
|
||||
<if test="item.delayDay != null">
|
||||
delay_day = #{item.delayDay},
|
||||
</if>
|
||||
<if test="item.receivableDate != null">
|
||||
receivable_date = #{item.receivableDate},
|
||||
</if>
|
||||
<if test="item.reasonsExplanation != null and item.reasonsExplanation != ''">
|
||||
reasons_explanation = #{item.reasonsExplanation},
|
||||
</if>
|
||||
<if test="item.scheduleRemark != null and item.scheduleRemark != ''">
|
||||
schedule_remark = #{item.scheduleRemark},
|
||||
</if>
|
||||
<if test="item.realStartTime != null">
|
||||
real_start_time = #{item.realStartTime},
|
||||
</if>
|
||||
<if test="item.realEndTime != null">
|
||||
real_end_time = #{item.realEndTime},
|
||||
</if>
|
||||
<if test="item.sortOrder != null">
|
||||
sort_order = #{item.sortOrder},
|
||||
</if>
|
||||
<if test="item.remark != null and item.remark != ''">
|
||||
remark = #{item.remark},
|
||||
</if>
|
||||
<if test="item.activeFlag != null and item.activeFlag != ''">
|
||||
active_flag = #{item.activeFlag},
|
||||
</if>
|
||||
<if test="item.delFlag != null and item.delFlag != ''">
|
||||
del_flag = #{item.delFlag},
|
||||
</if>
|
||||
<if test="item.createDept != null">
|
||||
create_dept = #{item.createDept},
|
||||
</if>
|
||||
<if test="item.createBy != null">
|
||||
create_by = #{item.createBy},
|
||||
</if>
|
||||
<if test="item.createTime != null">
|
||||
create_time = #{item.createTime},
|
||||
</if>
|
||||
<if test="item.updateBy != null">
|
||||
update_by = #{item.updateBy},
|
||||
</if>
|
||||
<if test="item.updateTime != null">
|
||||
update_time = #{item.updateTime}
|
||||
</if>
|
||||
</set>
|
||||
where plan_stage_id = #{item.planStageId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据自定义条件删除 -->
|
||||
<delete id="deleteCustomErpProjectPlanStage">
|
||||
delete from erp_project_plan_stage
|
||||
${ew.getCustomSqlSegment}
|
||||
</delete>
|
||||
|
||||
<!-- 根据ID列表批量删除 -->
|
||||
<delete id="deleteCustomErpProjectPlanStageByIds">
|
||||
delete from erp_project_plan_stage
|
||||
where plan_stage_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 检查是否存在 -->
|
||||
<select id="existsErpProjectPlanStage" resultType="java.lang.Boolean">
|
||||
select count(1) > 0 from erp_project_plan_stage t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue